https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69522
Bug ID: 69522 Summary: gcc hangs on valid code on x86_64-linux-gnu Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: helloqirun at gmail dot com Target Milestone: --- The current gcc trunk hangs on the following valid code snippets on x86_64-linux-gnu in both 32-bit and 64-bit modes. I assume the code snippets are valid since both gcc-4.4 and clang-trunk compile them. gcc-4.4 and clang-trunk generate no warning for the first code snippet. The second one is essentially the same as the first one having the line control removed. I tested them for gcc-4.6, gcc-4.8, gcc-4.9, gcc-5.1, gcc-5.2 and gcc-5.3. Only gcc-4.8 got an ICE for "abc2.c", the others were just hanging. $ gcc-4.4 -Wall -Wextra abc1.c -c $ clang-trunk -Wall -Wextra -Wpedantic abc1.c -c $ gcc-trunk -v Using built-in specs. COLLECT_GCC=gcc-trunk COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc --enable-languages=c,c++ --disable-werror --enable-multilib Thread model: posix gcc version 6.0.0 20160127 (experimental) [trunk revision 232874] (GCC) $ time gcc-trunk abc1.c ^C real 21m50.378s user 0m0.000s sys 0m0.002s $ cat abc1.c # 1 "" 3 struct str {}; struct { struct str b; float c[4]; int d; float e[2]; int f; } a = {{}, 0, 0, 0, 0, {0.5}, 0, 0, {0}}; ================ $ time gcc-trunk abc2.c abc.c:8:1: warning: braces around scalar initializer } a = {{}, 0, 0, 0, 0, {0.5}, 0, 0, {0}}; ^ abc.c:8:1: note: (near initialization for ‘a.d’) abc.c:8:1: warning: braces around scalar initializer abc.c:8:1: note: (near initialization for ‘a.f’) ^C real 14m22.631s user 0m0.000s sys 0m0.002s $ gcc-4.8 abc2.c abc.c:8:1: warning: braces around scalar initializer [enabled by default] } a = {{}, 0, 0, 0, 0, {0.5}, 0, 0, {0}}; ^ abc.c:8:1: warning: (near initialization for ‘a.d’) [enabled by default] abc.c:8:1: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions. Preprocessed source stored into /tmp/ccVkQrfE.out file, please attach this to your bugreport. $cat abc2.c struct str {}; struct { struct str b; float c[4]; int d; float e[2]; int f; } a = {{}, 0, 0, 0, 0, {0.5}, 0, 0, {0}};