------- 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