Re: GCC-3.4 reorders asm() with -O2

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

 



On Sun, Jan 25, 2004 at 08:28:07PM +0100, Andi Kleen wrote:

> > > It is.  Ralf already knows about the problem, I think - we leave
> > > markers outside of functions which define an entry point, save some
> > > additional registers to the stack, and try to fall through to the
> > > following function.  If the function gets emitted elsewhere, obviously,
> > > we've lost :)
> > > 
> > > [This is save_static_function...]
> > 
> > I only recently fixed the problem with the save_static() inline function
> > which of course was fragile, speculating on the compiler doing the
> > right thing ...  I'll cook up a fix ...
> 
> You can always use __attribute__((noinline))

Not in this particular case.   save_static's purpose was saving all
caller saved registers into the stack so they can be accessed via the
usual struct pt_regs pointer and to make that work it to be inline before
any change of these registers.  That was a small optimization but it also
was fragile so I removed that.  save_static_function was meant to be
used immediately preceeding a syscall's C function and served the same
purpose.  As the implementation ``knew'' gcc wasn't going to move around
the code just falling though worked fine but again that was fragile.

  Ralf


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

  Powered by Linux