Re: [patch] Prevent dead code/data removal with gcc 3.4

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



David Daney wrote:
> Thiemo Seufer wrote:
> 
> >Ralf Baechle wrote:
> > 
> >
> >>On Fri, Feb 13, 2004 at 03:20:27PM +0100, Maciej W. Rozycki wrote:
> >>
> >>   
> >>
> >>>2. It changes inline-assembly function prologues to be embedded within 
> >>>the
> >>>functions, which makes them a bit safer as they can now explicitly refer
> >>>to the "regs" struct and assures the code won't be removed or reordered.
> >>>     
> >>>
> >>It is possible that gcc changes one of the registers before save_static
> >>and I can't imagine there's a reliable way to fix this in the inline
> >>version.
> >
> >As long as __asm__ __volatile__ works as documented, this can't happen.
> >
> My understanding is that with gcc-3.4 that __asm__ __volatile__ does not 
> protect against dead code removal.  If the code is not dead __volatile__ 
> works as documented, but dead code removal still happens.

The inline version isn't dead code, and gcc isn't allowed to reschedule
code around a __asm__ __volatile__, so the patch should be ok.


Thiemo


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux