https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103188
Bug ID: 103188 Summary: ICE on valid code at -O2 and -O3 on x86_64-linux-gnu: Segmentation fault Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: zhendong.su at inf dot ethz.ch Target Milestone: --- [635] % gcctk -O2 small.c gcctk: internal compiler error: Segmentation fault signal terminated program cc1 Please submit a full bug report, with preprocessed source if appropriate. See <https://gcc.gnu.org/bugs/> for instructions. [636] % [636] % [636] % gcctk -v Using built-in specs. COLLECT_GCC=gcctk COLLECT_LTO_WRAPPER=/local/suz-local/software/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-trunk/configure --disable-bootstrap --prefix=/local/suz-local/software/local/gcc-trunk --enable-languages=c,c++ --disable-werror --enable-multilib --with-system-zlib Thread model: posix Supported LTO compression algorithms: zlib gcc version 12.0.0 20211111 (experimental) [master r12-5143-ga97fdde627e] (GCC) [637] % [637] % gcctk -O1 small.c; ./a.out [638] % [638] % gcctk -O2 small.c gcctk: internal compiler error: Segmentation fault signal terminated program cc1 Please submit a full bug report, with preprocessed source if appropriate. See <https://gcc.gnu.org/bugs/> for instructions. [639] % [639] % cat small.c int a, b, c, d = 10, e = 1, f, g, h, i; int main() { int j = -1; k: h = c; l: c = ~c; if (e) m: a = 0; if (j > 1) goto m; if (!e) goto l; if (c) goto p; n: goto m; o: if (f) { if (g) goto k; j = 0; p: if (d) goto o; goto n; } if (i) goto l; for (; a < 1; a++) while (a > d) b++; return 0; }