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 tree-optimization/32200] New: IV-OPTS does not produce good code for some loops


While just looking around on the pointer_plus branch I noticed that if I have
independent IVs to start, the code is much worse and there are storing to the
stack (on x86) and everything go crazy after that.
Compare:
void foo (int *a, int *b, int *c, int *d, int *e, int *f)
{
  int i;

  for (i = 0; i < 8; i++)
    *(b++) = *(a++) = *(c++) = *(d++) = *(e++) = *(f++);
}



To:

void foo (int *a, int *b, int *c, int *d, int *e, int *f)
{
  int i;

  for (i = 0; i < 8; i++)
    b[i] = a[i] = c[i] = d[i] = e[i] = f[i];
}


----------- cut ---------
You will see that in the latter case, we optimize the IV based on one IV (i)
while in the first case, we have 7 IVs which is just wrong.


-- 
           Summary: IV-OPTS does not produce good code for some loops
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org


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


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