public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/36318]  New: SRA pessimizes struct copies without -Os
@ 2008-05-23 21:37 astrange at ithinksw dot com
  2008-05-23 21:38 ` [Bug tree-optimization/36318] " astrange at ithinksw dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: astrange at ithinksw dot com @ 2008-05-23 21:37 UTC (permalink / raw)
  To: gcc-bugs

> /usr/local/gcc44/bin/gcc -v
Using built-in specs.
Target: i386-apple-darwin9.2.2
Configured with: ../gcc/configure --prefix=/usr/local/gcc44
--enable-threads=posix --with-arch=core2 --with-tune=core2 --with-gmp=/sw
--with-mpfr=/sw --disable-nls --disable-bootstrap --enable-checking=yes,rtl
--enable-languages=c,c++,objc
Thread model: posix
gcc version 4.4.0 20080523 (experimental) (GCC) 

and these options:
> gcc -fno-pic -fomit-frame-pointer -O3 -S wc.c

For the attached source, gcc generates good code for global variable
assignment:
_foo0:
        subl    $12, %esp
        movl    _b, %eax
        movl    %eax, _a
        addl    $12, %esp
        ret

but uses byte copies for pointer assignment:
_foo1:
        subl    $12, %esp
        movl    %ebx, 4(%esp)
        movl    %esi, 8(%esp)
        movl    20(%esp), %eax
        movl    16(%esp), %edx
        movzbl  (%eax), %esi
        movzbl  1(%eax), %ebx
        movzbl  2(%eax), %ecx
        movzbl  3(%eax), %eax
        movb    %cl, 2(%edx)
        movb    %al, 3(%edx)
        movb    %bl, 1(%edx)
        movl    %esi, %eax
        movb    %al, (%edx)
        movl    4(%esp), %ebx
        movl    8(%esp), %esi
        addl    $12, %esp
        ret

Using either -Os or -fno-tree-sra fixes it.


-- 
           Summary: SRA pessimizes struct copies without -Os
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: astrange at ithinksw dot com
GCC target triplet: i?86-*-*


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


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

end of thread, other threads:[~2009-06-05  8:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-23 21:37 [Bug tree-optimization/36318] New: SRA pessimizes struct copies without -Os astrange at ithinksw dot com
2008-05-23 21:38 ` [Bug tree-optimization/36318] " astrange at ithinksw dot com
2009-05-30  0:19 ` astrange at ithinksw dot com
2009-05-30  9:50 ` rguenth at gcc dot gnu dot org
2009-06-05  4:31 ` astrange at ithinksw dot com
2009-06-05  8:30 ` rguenth 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).