>From gcc.dg/vect/no-scevccp-noreassoc-outer-2.c: 6 #define N 40 7 int a[200*N]; 8 9 __attribute__ ((noinline)) void 10 foo (){ 11 int i,j; 12 int sum,s=0; 13 14 for (i = 0; i < 200*N; i++) { 15 sum = 0; 16 for (j = 0; j < N; j++) { 17 sum += (i + j); 18 i++; 19 } 20 a[i] = sum; // i exceeds 8000, runs off array end 21 } 22 }
In function foo(), at line 20, variable 'i' can exceed the bounds of array 'a', and segv is possible. The fix may be as simple as padding array 'a', provided this does not affect the other things that this test validates. -- Summary: gcc.dg/vect/no-scevccp-noreassoc-outer-2.c can segv Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: trivial Priority: P3 Component: testsuite AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: simon_baldwin at yahoo dot com GCC build triplet: x86_64-unknown-linux-gnu GCC host triplet: x86_64-unknown-linux-gnu GCC target triplet: x86_64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40829