https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67282
Bug ID: 67282 Summary: Wrong code with -floop-nest-optimize Product: gcc Version: 5.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: mpolacek at gcc dot gnu.org Target Milestone: --- I think that we're generating a wrong code when using -O2 -floop-nest-optimize: double A[64][64]; double C[64][64]; int main () { int i, j, k; for (i = 0; i < 64; i++) for (j = 0; j < 64; j++) for (k = 0; k < 64; k++) C[i][j] = A[i][k]; } $ ./a.out Segmentation fault (core dumped) It doesn't segv if I use -frapv/-fsanitize=undefined/... Might be related to PR66980.