This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/32200] New: IV-OPTS does not produce good code for some loops
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Jun 2007 05:27:41 -0000
- Subject: [Bug tree-optimization/32200] New: IV-OPTS does not produce good code for some loops
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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