------- Comment #7 from sandra at codesourcery dot com 2010-07-07 00:42 ------- Hmmm. It's possible I built my toolchain incorrectly, but I'm seeing that it aborts when compiled with -m64 but not with -m32. The failure mode looks identical to that reported in PR39794:
(gdb) print a $1 = {0, 1, 4, 2, 10, 12, 24, 44, 72, 92, 60, 34, 244, 47, 58, 291} (gdb) print ref $2 = {0, 1, 4, 2, 10, 12, 24, 44, 72, 136, 232, 416, 736, 1296, 2304, 2032} This slightly modified version of the test case fails when compiled with -m64 -O2 -funroll-loops -fno-ivopts: extern void abort (); void foo (int *a, int n) { int *lasta = a + n; for (; a != lasta; a++) { *a *= 2; a[1] = a[-1] + a[-2]; } } int a[16]; int ref[16] = { 0, 1, 4, 2, 10, 12, 24, 44, 72, 136, 232, 416, 736, 1296, 2304, 2032 }; int main () { int i; for (i = 0; i < 16; i++) a[i] = i; foo (a + 2, 16 - 3); for (i = 0; i < 16; i++) if (ref[i] != a[i]) abort (); return 0; } So, not an ivopts problem at all? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44838