public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug regression/40886]  New: No loop counter reversal for simple loops anymore
@ 2009-07-27 21:40 andi-gcc at firstfloor dot org
  2009-07-28 11:09 ` [Bug regression/40886] [4.3/4.4/4.5 Regression] " rguenth at gcc dot gnu dot org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: andi-gcc at firstfloor dot org @ 2009-07-27 21:40 UTC (permalink / raw)
  To: gcc-bugs

Given this simple program:

main()
{
        int i;
        for (i = 0; i < 10; i++) 
                f2();
}

compiled with -O2
gcc33-hammer detects that the loop index is not used in the loop body
and rewrites it to a downwards counting loop, elimitinating one instruction
(inc/cmp -> dec)

  movl    $9, %ebx
        .p2align 4,,7
.L6:
        xorl    %eax, %eax
        call    f2
        decl    %ebx
        jns     .L6
        popq    %rbx

but gcc 4.0 - 4.3 don't anymore (tried 4.1, 4.3 and 4.4):

       xorl    %ebx, %ebx
        .p2align 4,,7
.L2:
        xorl    %eax, %eax
        incl    %ebx
        call    f2
        cmpl    $10, %ebx
        jne     .L2


-- 
           Summary: No loop counter reversal for simple loops anymore
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: regression
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: andi-gcc at firstfloor dot org
  GCC host triplet: x86_64-linux
GCC target triplet: x86_64-linux


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


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

end of thread, other threads:[~2010-06-09 11:57 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-27 21:40 [Bug regression/40886] New: No loop counter reversal for simple loops anymore andi-gcc at firstfloor dot org
2009-07-28 11:09 ` [Bug regression/40886] [4.3/4.4/4.5 Regression] " rguenth at gcc dot gnu dot org
2009-08-04 12:49 ` rguenth at gcc dot gnu dot org
2009-08-07  8:44 ` rakdver at gcc dot gnu dot org
2009-08-07  8:50 ` andi-gcc at firstfloor dot org
2009-08-07  8:54 ` rakdver at kam dot mff dot cuni dot cz
2009-08-07  9:39 ` andi-gcc at firstfloor dot org
2009-08-07  9:47 ` steven at gcc dot gnu dot org
2009-08-07  9:52 ` andi-gcc at firstfloor dot org
2009-08-16 21:42 ` rguenth at gcc dot gnu dot org
2010-02-09  4:57 ` spop at gcc dot gnu dot org
2010-02-09  6:00 ` spop at gcc dot gnu dot org
2010-02-09  8:30 ` rakdver at kam dot mff dot cuni dot cz
2010-02-09 17:17 ` spop at gcc dot gnu dot org
2010-02-11 15:46 ` spop at gcc dot gnu dot org
2010-02-11 15:47 ` [Bug regression/40886] [4.3/4.4 " spop at gcc dot gnu dot org
2010-05-22 18:33 ` rguenth at gcc dot gnu dot org
2010-06-09 11:21 ` andi-gcc at firstfloor dot org
2010-06-09 11:57 ` 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).