public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/39148]  New: -Os increase code size when stack is aligned
@ 2009-02-10 20:19 hjl dot tools at gmail dot com
  2009-02-10 20:19 ` [Bug target/39148] " hjl dot tools at gmail dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-02-10 20:19 UTC (permalink / raw)
  To: gcc-bugs

[hjl@gnu-6 pr39137]$ cat pr39137-3.i
void foo (unsigned long long *);

void
bar (void)
{
  unsigned long long l __attribute__ ((aligned(32)));
  foo (&l);
}
[hjl@gnu-6 pr39137]$ /export/build/gnu/gcc-work/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc-avx/build-x86_64-linux/gcc/ -m32 -Os  pr39137-3.i -S
[hjl@gnu-6 pr39137]$ cat pr39137-3.s
        .file   "pr39137-3.i"
        .text
.globl bar
        .type   bar, @function
bar:
        leal    4(%esp), %ecx
        andl    $-32, %esp
        pushl   -4(%ecx)
        pushl   %ebp
        movl    %esp, %ebp
        pushl   %ecx
        subl    $64, %esp
        leal    -56(%ebp), %eax
        pushl   %eax
        call    foo
        movl    -4(%ebp), %ecx
        addl    $16, %esp
        leave
        leal    -4(%ecx), %esp
        ret
        .size   bar, .-bar
[hjl@gnu-6 pr39137]$ /export/build/gnu/gcc-work/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc-avx/build-x86_64-linux/gcc/ -m32 -O  pr39137-3.i -S
[hjl@gnu-6 pr39137]$ cat pr39137-3.s
        .file   "pr39137-3.i"
        .text
.globl bar
        .type   bar, @function
bar:
        pushl   %ebp
        movl    %esp, %ebp
        andl    $-32, %esp
        subl    $48, %esp
        leal    16(%esp), %eax
        movl    %eax, (%esp)
        call    foo
        leave
        ret
        .size   bar, .-bar
[hjl@gnu-6 pr39137]$ 

-Os generates bigger binary.


-- 
           Summary: -Os increase code size when stack is aligned
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hjl dot tools at gmail dot com
GCC target triplet: i686-pc-linux-gnu


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


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

end of thread, other threads:[~2009-02-12  2:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-10 20:19 [Bug target/39148] New: -Os increase code size when stack is aligned hjl dot tools at gmail dot com
2009-02-10 20:19 ` [Bug target/39148] " hjl dot tools at gmail dot com
2009-02-10 20:46 ` hjl dot tools at gmail dot com
2009-02-11 15:54 ` hjl dot tools at gmail dot com
2009-02-11 17:12 ` jakub at gcc dot gnu dot org
2009-02-11 17:16 ` hjl dot tools at gmail dot com
2009-02-12  0:45 ` hjl dot tools at gmail dot com
2009-02-12  2:33 ` Joey dot ye at intel dot com
2009-02-12  2:37 ` hjl dot 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).