This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/36758] New: address addition moved out of the loop


Take the following testcase:
extern int f0(int *);
void
f1()
{
  int x;
  while (f0(&x));
}

-- CUT ---
Currently GCC produces:
        addi 31,1,112
        .p2align 3,,7
.L2:
        mr 3,31
        bl f0
        nop
        cmpdi 7,3,0
        bne 7,.L2

Notice how there is mr 3, 31 inside the loop.  At least on the Cell, the mr and
addi both have the same cycle count so we should not be moving the addition
outside of the loop.  This will save at least one volatile register which
should reduce code size.  This is a definite win for code size.


-- 
           Summary: address addition moved out of the loop
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
GCC target triplet: powerpc*-*-*


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]