http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56097
Bug #: 56097 Summary: Segmentation fault with -01 -ftree-vrp -ftree-loop-distribute-patterns -funswitch-loops Classification: Unclassified Product: gcc Version: 4.7.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassig...@gcc.gnu.org ReportedBy: sti...@gmail.com Possible duplicate of bug 55964. The following test case fails with -01 -ftree-vrp -ftree-loop-distribute-patterns -funswitch-loops. The same test case worked fine with gcc 4.5: $ cat test3.c struct test_struct { int a, b[10], c[10], d[10]; }; extern struct test_struct* new_struct; void testfunc(struct test_struct* old_struct) { int i; for (i = 0; i < 10; ++i) { new_struct->b[i] = old_struct ? old_struct->b[i] : -1; new_struct->c[i] = old_struct ? old_struct->c[i] : 0; new_struct->d[i] = old_struct ? old_struct->d[i] : 0; } /* commenting out the following line eliminates the crash */ if (old_struct) old_struct->a++; } $ gcc -c -O1 -ftree-vrp -ftree-loop-distribution -funswitch-loops -o test3.o test3.c test3.c: In function ‘testfunc’: test3.c:7:6: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. $ gcc -v gcc version 4.7.2 (Ubuntu/Linaro 4.7.2-2ubuntu1)