public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/36646]  New: [4.4 regression] Unnecessary moves generated on loop boundaries
@ 2008-06-27  4:58 astrange at ithinksw dot com
  2008-06-27  4:58 ` [Bug tree-optimization/36646] " astrange at ithinksw dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: astrange at ithinksw dot com @ 2008-06-27  4:58 UTC (permalink / raw)
  To: gcc-bugs

The attached source is a loop+switch statement, where only some of the switch
cases change the variable 'val'. 4.4 generates moves for it in every case, even
the ones where it's not mentioned, while 4.2 didn't; the difference is visible
in tree dumps.

This part:
            case Op_Inc1: (*tape)++; break;

with 4.2 at -O:

<L3>:;
  *tape = *tape + 1;
  goto <bb 3> (<L0>);

L5:
        incb    (%edx)
        jmp     L13

SVN at -O:
<L3>:;
  *tape.17 = *tape.17 + 1;
  val.16 = val;
  goto <bb 3> (<L10>);

L6:
        incb    (%esi)
        movl    %edx, %eax
        jmp     L10

Suprisingly, -O3 is worse:
L6:
        movl    %edx, %eax
        incb    (%esi)
        movl    %eax, %edx
        jmp     L2

IRA doesn't improve it.
This isn't from real-world code, so it's not really important, but I'd like to
make a code-copying VM out of this.


-- 
           Summary: [4.4 regression] Unnecessary moves generated on loop
                    boundaries
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          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=36646


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

end of thread, other threads:[~2009-11-07  9:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-27  4:58 [Bug tree-optimization/36646] New: [4.4 regression] Unnecessary moves generated on loop boundaries astrange at ithinksw dot com
2008-06-27  4:58 ` [Bug tree-optimization/36646] " astrange at ithinksw dot com
2008-06-27  5:04 ` astrange at ithinksw dot com
2008-06-27  9:24 ` [Bug tree-optimization/36646] [4.3/4.4 " rguenth at gcc dot gnu dot org
2008-07-10 14:27 ` [Bug tree-optimization/36646] [4.3/4.4 Regression] " rguenth at gcc dot gnu dot org
2008-08-27 22:10 ` jsm28 at gcc dot gnu dot org
2009-01-24 10:25 ` rguenth at gcc dot gnu dot org
2009-08-04 12:41 ` [Bug tree-optimization/36646] [4.3/4.4/4.5 " rguenth at gcc dot gnu dot org
2009-10-20 21:10 ` astrange at ithinksw dot com
2009-11-07  9:04 ` astrange at ithinksw 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).