This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Inline ASM and stack/base pointer


Daniel Mierswa <impulze@impulze.org> writes:

>> What happens if you compile only with -fomit-frame-pointer? I'm not sure
>> if it will be activated without adding an -Ox option. Can you add an
>> example code?
> impulze@istari ~ $ gcc-4.4 -S -fomit-frame-pointer test.c && grep -m1
> lea test.s
> 	lea 12(%esp), %edi
> impulze@istari ~ $ gcc-4.5 -S -fomit-frame-pointer test.c && grep -m1
> lea test.s
> 	lea 12(%esp), %edi
> impulze@istari ~ $ gcc-4.6 -S -fomit-frame-pointer test.c && grep -m1
> lea test.s
> 	lea 12(%esp), %edi
> impulze@istari ~ $ cat test.c
> void f()
> {
>     int i;
>     __asm__ __volatile__("lea %0, %%edi\n"::"m"(i):"%esp");
> }
>
>> What gcc you use?
> 4.4.5, 4.5.2, 4.6.0

Bother, you're right, I was looking at an invalid example.  I don't know
of a way to do this.  Sorry.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]