public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/24374]  New: [4.0/4.1 Regression] Sibcalling optimization is happening in main
@ 2005-10-14 20:11 pinskia at gcc dot gnu dot org
  2005-10-14 20:12 ` [Bug target/24374] " pinskia at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-14 20:11 UTC (permalink / raw)
  To: gcc-bugs

Take the following example:
int main1(void);

int main(void)
{
  return main1();
}
----
With 3.4.0, we got at -O2:
main:
        pushl   %ebp
        movl    %esp, %ebp
        subl    $8, %esp
        andl    $-16, %esp
        subl    $16, %esp
        call    main1
        leave
        ret

While with 4.0.0 and above we get:
main:
        pushl   %ebp
        movl    %esp, %ebp
        subl    $8, %esp
        andl    $-16, %esp
        subl    $16, %esp
        leave
        jmp     main1
        .size   main, .-main

This is wrong, we should not be sibcalling optimizing in main at all.


-- 
           Summary: [4.0/4.1 Regression] Sibcalling optimization is
                    happening in main
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
GCC target triplet: i?86-*-*


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2005-11-03  1:42 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-14 20:11 [Bug target/24374] New: [4.0/4.1 Regression] Sibcalling optimization is happening in main pinskia at gcc dot gnu dot org
2005-10-14 20:12 ` [Bug target/24374] " pinskia at gcc dot gnu dot org
2005-10-15 17:40 ` pinskia at gcc dot gnu dot org
2005-10-15 20:02 ` jkj at sco dot com
2005-10-15 20:14 ` jkj at sco dot com
2005-10-15 21:18 ` jkj at sco dot com
2005-10-16  4:25 ` rth at gcc dot gnu dot org
2005-10-31  6:25 ` mmitchel at gcc dot gnu dot org
2005-10-31  7:13 ` jkj at sco dot com
2005-11-03  1:40 ` rth at gcc dot gnu dot org
2005-11-03  1:42 ` rth 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).