https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99694
Bug ID: 99694 Summary: gcc: fatal error: Killed signal terminated program cc1 under -O2 to -Os Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi all. GCC takes too much compiling time and then crashes on the valid small.c under -O2 to -Os. Also, all GCC-9 upward versions behave the same. $cat small.c #include <stdint.h> int a, b, c; void d() { uint16_t e; int32_t *f; int32_t *g; if (a) { int32_t *k; for (;; *k += 1) { int32_t **i = &f; int32_t **l = &g; for (e = 6; e; e++) { g = k = f; j: **l = 0; } *i = c; } } uint16_t i = &e; b = i / 0; goto j; } $time gcc -w -c -O1 small.c real 0m0.057s user 0m0.023s sys 0m0.006s $time gcc -w -c -Os small.c (same as -O2 and -O3) gcc: fatal error: Killed signal terminated program cc1 compilation terminated. real 79m53.073s user 78m10.888s sys 0m28.194s $gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/home/tuhaoxin/compilers/gcc/build-20210320/libexec/gcc/x86_64-pc-linux-gnu/11.0.1/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../configure --prefix=/home/tuhaoxin/compilers/gcc/build-20210320/ --enable-bootstrap --enable-checking=release --enable-languages=c,c++ -disable-multilib Thread model: posix Supported LTO compression algorithms: zlib gcc version 11.0.1 20210320 (experimental) (GCC) Thanks, Haoxin