This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/19078] [4.0 Regression] Poor quality code after loop unrolling.
- From: "rakdver at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Dec 2004 19:41:44 -0000
- Subject: [Bug rtl-optimization/19078] [4.0 Regression] Poor quality code after loop unrolling.
- References: <20041219105831.19078.chris@bubblescope.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From rakdver at gcc dot gnu dot org 2004-12-19 19:41 -------
Unroller splits the induction variables, so that the final code looks basically
like
if (a[0] == 2)
return a;
if (a[1] == 2)
return a + 4;
if (a[2] == 2)
return a + 8;
...
if (a[7] == 2)
return a + 28;
a+=32;
Which is good in some cases, but obviously not here.
However even with -fno-split-ivs-in-unroller we do not get the autoincrements;
we also need -fno-ivopts. The reason is that with ivopts the code looks like
a = a.1;
a.1 = a + 1;
if (*a == 2)
return a;
Whereas the old loop optimizer makes things look like
a = a + 1
if (*a == 2)
return 0;
by changing the initial value of a, which enables the autoinc creation pass to
work.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19078