https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104402
Bug ID: 104402 Summary: ICE on valid code: in do_jump_1, at dojump.c Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: k.even-mendoza at imperial dot ac.uk Target Milestone: --- ICE started from gcc-9 and still appears in gcc-12 (I tested it with gcc (GCC) 12.0.0 20220116 (experimental)) with this code and -O2: #include <stdlib.h> _Complex a; char b; void main() {} void c() { if (b != 2 + (long)(a != 0 ^ 0)) abort(); } dump this: /home/user42/data/gcc-csmith-1201/gcc-install/bin/gcc -O2 fuzzer-file-37731.c ====================== during RTL pass: expand fuzzer-file-37731.c: In function ācā: fuzzer-file-37731.c:5:6: internal compiler error: in do_jump_1, at dojump.c:207 5 | void c() { | ^ 0x6e6d97 do_jump_1 .././../gcc-source/gcc/dojump.c:207 0xb49847 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode, expand_modifier) .././../gcc-source/gcc/expr.c:10242 0xb4f24f expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) .././../gcc-source/gcc/expr.c:10502 0xa9b916 expand_normal .././../gcc-source/gcc/expr.h:307 0xa9b916 do_compare_and_jump .././../gcc-source/gcc/dojump.c:1257 0xa9d929 do_jump_1 .././../gcc-source/gcc/dojump.c:219 0xa238e0 expand_gimple_cond .././../gcc-source/gcc/cfgexpand.c:2645 0xa240fc expand_gimple_basic_block .././../gcc-source/gcc/cfgexpand.c:5928 0xa25ce7 execute .././../gcc-source/gcc/cfgexpand.c:6795 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. It works fine with gcc-8 and below.