Converting MSVC to intel-style gcc inline assembly

Andi Kleen ak@muc.de
Sat Mar 6 18:41:00 GMT 2004


Jamie Lokier <jamie@shareable.org> writes:

> Andi Kleen wrote:
>> it's not possible to clobber %ebp
>
> I seem to recall that was true even with -fno-frame-pointer: you'd get
> silently incorrect code, even though GCC had no special uses for %ebp
> in that mode.
>
> Is that still so?

Yes. The only way to clobber ebp is to push/pop ebp manually,
but then you have to be careful to not get any direct stack references
from gcc as arguments.

The latest gcc (at least latest hammer branch) at least gives n error now
when you try, older ones just generated silently wrong code

In -fPIC code the same applies to the PIC register too.

-Andi




More information about the Gcc mailing list