https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111943
Bug ID: 111943 Summary: ICE in gimple_split_edge, at tree-cfg.cc:3019 on 20050510-1.c with new -fharden-control-flow-redundancy Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: mjires at suse dot cz CC: aoliva at gcc dot gnu.org Target Milestone: --- Following testcase causes ICE with new -fharden-control-flow-redundancy $ cat 20050510-1.c /* { dg-require-effective-target indirect_jumps } */ /* { dg-require-effective-target label_values } */ void bar (int k) { void *label = (k) ? &&x : &&y; if (k) goto *label; x: if (k) dont_remove (); y: return; } $ gcc 20050510-1.c -fharden-control-flow-redundancy --param=max-jump-thread-duplication-stmts=0 -Ofast 20050510-1.c: In function ‘bar’: 20050510-1.c:12:5: warning: implicit declaration of function ‘dont_remove’ [-Wimplicit-function-declaration] 12 | dont_remove (); | ^~~~~~~~~~~ during GIMPLE pass: hardcfr 20050510-1.c:4:6: internal compiler error: in gimple_split_edge, at tree-cfg.cc:3019 4 | void bar (int k) | ^~~ 0x7f2c1b gimple_split_edge /home/mjires/git/GCC/master/gcc/tree-cfg.cc:3019 0xad6acb split_edge(edge_def*) /home/mjires/git/GCC/master/gcc/cfghooks.cc:670 0xc83916 gimple_find_edge_insert_loc /home/mjires/git/GCC/master/gcc/gimple-iterator.cc:829 0xc8457b gsi_insert_seq_on_edge_immediate(edge_def*, gimple*) /home/mjires/git/GCC/master/gcc/gimple-iterator.cc:873 0x1d5468e rt_bb_visited::insert_exit_check_on_edge(gimple*, edge_def*) /home/mjires/git/GCC/master/gcc/gimple-harden-control-flow.cc:706 0x1d5468e rt_bb_visited::check(auto_vec<edge_def*, 10ul>&, int, auto_sbitmap const&) /home/mjires/git/GCC/master/gcc/gimple-harden-control-flow.cc:807 0x1d530b6 execute /home/mjires/git/GCC/master/gcc/gimple-harden-control-flow.cc:1476 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. $ gcc -v Using built-in specs. COLLECT_GCC=/home/mjires/checks/master/bin/gcc COLLECT_LTO_WRAPPER=/home/mjires/checks/master/libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /home/mjires/git/GCC/master/configure --prefix=/home/mjires/checks/master Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 14.0.0 20231023 (experimental) (GCC)