Re: Bug: gcc ignores ebp clobber

Michael Brown <[email protected]>
Newsgroups gmane.network.etherboot.user
Message-ID <[email protected]>
On Saturday 15 August 2009 08:41:53 Stefan Hajnoczi wrote:
> With gcc (Debian 4.3.3-14) 4.3.3 and the latest gpxe.git tree:
> ./arch/i386/drivers/net/undiload.c:                            :
> "ebx", "ecx", "edx", "esi", "edi", "ebp" );
> %ebp not live across inline asm.
>
> ./arch/i386/drivers/net/undinet.c:                             :
> "ecx", "edx", "esi", "ebp" );
> %ebp not live across inline asm.
>
> ./arch/i386/interface/pxe/pxe_call.c:                          :
> "esi", "ebp", "memory" );
> %ebp not live across inline asm.
>
> ./arch/i386/firmware/pcbios/bios_console.c:
> : "ebp" );
>
> %ebp not live across inline asm.
>
> ./arch/i386/image/nbi.c:                : "ecx", "edx", "ebp" );
> ./arch/i386/image/nbi.c:                : "ecx", "edx", "ebp", "memory" );
> %ebp not live across inline asm.
>
> ./arch/i386/image/elfboot.c:                           : "eax", "ebx",
> "ecx", "edx", "esi", "ebp",
> %ebp not live across inline asm.
>
> ./arch/i386/image/bootsector.c:                        : "eax", "ecx",
> "esi", "ebp" );
> %ebp not live across inline asm.
>
> We should still fix this since a new version of GCC may come along and
> decide to use %ebp in one of these functions.

Following on from the e-mail I just wrote, talking about using "=B" as an 
alternative to the clobber list:

Most of those are calls to real-mode code.

If we can use "=B" (or whatever the correct constraint is) to mark %ebp as an 
output constraint, then that would be the best solution.

If we *can't* use such an output constraint, then we can never usefully return 
a value via %ebp anyway, so we may as well cause real_call() to preserve %ebp 
automatically, in which case we can just remove %ebp from the clobber list in 
those cases.

Does someone familiar with gcc internals want to comment on what the correct 
output constraint (if any) should be for %ebp?

Michael

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.