public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/26553]  New: PIC stubs vs regparm
@ 2006-03-03 20:41 pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; only message in thread
From: pinskia at gcc dot gnu dot org @ 2006-03-03 20:41 UTC (permalink / raw)
  To: gcc-bugs

While looking at PR 26552, I noticed that stubs would override eax, that is
wrong as it is used to pass regparms.

Testcase:
int f(int ) __attribute__((regparm(3)));

int g(void)
{
  return f(1);
}
------
We get:
_g:
        pushl   %ebp
        movl    %esp, %ebp
        subl    $8, %esp
        movl    $1, %eax
        call    L_f$stub
        leave
        ret
        .picsymbol_stub
L_f$stub:
        .indirect_symbol _f
        call LPC$1
LPC$1:  popl %eax
        movl L1$lz-LPC$1(%eax),%edx
        jmp *%edx
L_f$stub_binder:
        lea L1$lz-LPC$1(%eax),%eax
        pushl %eax
        jmp dyld_stub_binding_helper
L1$lz:
        .indirect_symbol _f
        .long L_f$stub_binder

So we get eax clobbered each time calling the stub.


-- 
           Summary: PIC stubs vs regparm
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
GCC target triplet: i686-darwin


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26553


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-03-03 20:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-03 20:41 [Bug target/26553] New: PIC stubs vs regparm pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).