Consider: void foo (int *__restrict__ p, int *__restrict__ q, int count) { while (--count >= 0) { *p++ = 0; *q++ = 0; } }
I get: $ ./cc1 -quiet -O2 -ftree-loop-distribution min.c min.c: In function 'foo': min.c:2: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. This is as of Revision 143741, which is after the fix for PR tree-optimization/38997 has gone in: http://gcc.gnu.org/ml/gcc-cvs/2009-01/msg00752.html FWIW, if I try: void foo (int *__restrict__ p, int *__restrict__ q, int count) { int i; for (i = 0; i < count; i++) { *p++ = 0; *q++ = 0; } } I get: *** glibc detected *** ./cc1: malloc(): memory corruption: 0xf7efd160 *** I am guessing that depending on the exact memory allocation pattern, different parts of memory get corrupted. -- Summary: -ftree-loop-distribution ICEs Product: gcc Version: 4.4.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: kazu at gcc dot gnu dot org GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39007