https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95045
Bug ID: 95045 Summary: wrong code at -O3 on x86_64-linux-gnu Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: qrzhang at gatech dot edu Target Milestone: --- Recent regression. Bisection points to g:283cb9ea6293e813e4 $ gcc-trunk -v gcc version 11.0.0 20200510 (experimental) [master revision 4ae915cdbf0:8eedda9eef3:ef6394205d7bcab00dca01182d708ad5a6360a7b] (GCC) $ gcc-trunk abc.c ; ./a.out 4 $ gcc-trunk -O3 abc.c ; ./a.out 0 $ cat abc.c int a, c, f; long b; char d; int e[3]; int g[9][3][2]; int main() { { h: for (f = 0; f <= 5; f++) { b = 3; for (; b >= 0; b--) { e[2] = d = 0; for (; d <= 3; d++) { g[8][2][0] = e[1] = c = 0; for (; c <= 1; c++) e[c + 1] = g[d + 5][2][c] = 4; } if (a) goto h; } } } printf("%d\n", e[2]); }