public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/60520] New: stack adjustment are not merged anymore
@ 2014-03-13 21:26 ubizjak at gmail dot com
  2014-03-13 21:41 ` [Bug target/60520] " hjl.tools at gmail dot com
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: ubizjak at gmail dot com @ 2014-03-13 21:26 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60520
           Summary: stack adjustment are not merged anymore
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ubizjak at gmail dot com

Following testcase:

--cut here--
extern void foo (int *);
extern int *bar;

void test (void)
{
  if (*bar)
    foo (bar);
}
--cut here--

compiles with gcc-4.9 to (-O2 -m32):

test:
        movl    bar, %eax
        movl    (%eax), %edx
        testl   %edx, %edx
        jne     .L7
        ret
        .p2align 4,,10
        .p2align 3
.L7:
        subl    $24, %esp
        pushl   %eax
        call    foo
        addl    $16, %esp      <<<
        addl    $12, %esp      <<<
        ret

A single "addl $28, %esp" should be emitted here, as is the case with gcc-4.8:

test:
        movl    bar, %eax
        movl    (%eax), %edx
        testl   %edx, %edx
        jne     .L7
        ret
        .p2align 4,,7
        .p2align 3
.L7:
        subl    $28, %esp
        movl    %eax, (%esp)
        call    foo
        addl    $28, %esp     <<<
        ret


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

end of thread, other threads:[~2014-03-19 21:56 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-13 21:26 [Bug target/60520] New: stack adjustment are not merged anymore ubizjak at gmail dot com
2014-03-13 21:41 ` [Bug target/60520] " hjl.tools at gmail dot com
2014-03-13 22:02 ` hjl.tools at gmail dot com
2014-03-13 22:22 ` hjl.tools at gmail dot com
2014-03-14  5:14 ` hjl.tools at gmail dot com
2014-03-14  8:03 ` rguenth at gcc dot gnu.org
2014-03-14  8:27 ` jakub at gcc dot gnu.org
2014-03-14  8:49 ` ubizjak at gmail dot com
2014-03-14  8:59 ` ubizjak at gmail dot com
2014-03-14 15:45 ` hjl.tools at gmail dot com
2014-03-14 16:20 ` jakub at gcc dot gnu.org
2014-03-14 20:33 ` hjl.tools at gmail dot com
2014-03-19 21:56 ` hjl.tools at gmail dot com

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).