https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97333

            Bug ID: 97333
           Summary: [gimple_can_duplicate_bb_p == false,
                    tree-ssa-threadupdate] ICE in duplicate_block, at
                    cfghooks.c:1093
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

With this patch:
...
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 406441751a9..b9168755155 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -6213,7 +6213,7 @@ gimple_split_block_before_cond_jump (basic_block bb)
 static bool
 gimple_can_duplicate_bb_p (const_basic_block bb ATTRIBUTE_UNUSED)
 {
-  return true;
+  return false;
 }

 /* Create a duplicate of the basic block BB.  NOTE: This does not
...
we run into:
...
spawn -ignore SIGHUP
/dev/shm/tdevries/data/master/2020-10-07T08-04-46-02-00-c475cfa435b/build/gcc/xgcc
-B/dev/shm/tdevries/data/master/2020-10-07T08-04-46-02-00-c475cfa435b/build/gcc/
-fdiagnostics-plain-output -O1 -w -c -o 20041018-1.o
/labs/tdevries/gcc/src/gcc/testsuite/gcc.c-torture/compile/20041018-1.c^M
during GIMPLE pass: dom^M
/labs/tdevries/gcc/src/gcc/testsuite/gcc.c-torture/compile/20041018-1.c: In
function 'foo':^M
/labs/tdevries/gcc/src/gcc/testsuite/gcc.c-torture/compile/20041018-1.c:2:1:
internal compiler error: in duplicate_block, at cfghooks.c:1093^M
0xbfebaf duplicate_block(basic_block_def*, edge_def*, basic_block_def*,
copy_bb_data*)^M
        /labs/tdevries/gcc/src/gcc/cfghooks.c:1093^M
0x16d794b create_block_for_threading^M
        /labs/tdevries/gcc/src/gcc/tree-ssa-threadupdate.c:342^M
0x16d90e7 ssa_create_duplicates(redirection_data**, ssa_local_info_t*)^M
        /labs/tdevries/gcc/src/gcc/tree-ssa-threadupdate.c:1130^M
0x16dfe86 void hash_table<redirection_data, false,
xcallocator>::traverse_noresize<ssa_local_info_t*,
&(ssa_create_duplicates(redirection_data**,
ssa_local_info_t*))>(ssa_local_info_t*)^M
        /labs/tdevries/gcc/src/gcc/hash-table.h:1081^M
0x16df31a void hash_table<redirection_data, false,
xcallocator>::traverse<ssa_local_info_t*,
&(ssa_create_duplicates(redirection_data**,
ssa_local_info_t*))>(ssa_local_info_t*)^M
        /labs/tdevries/gcc/src/gcc/hash-table.h:1102^M
0x16d9dff thread_block_1^M
        /labs/tdevries/gcc/src/gcc/tree-ssa-threadupdate.c:1495^M
0x16d9ee5 thread_block^M
        /labs/tdevries/gcc/src/gcc/tree-ssa-threadupdate.c:1539^M
0x16da3d7 thread_through_loop_header^M
        /labs/tdevries/gcc/src/gcc/tree-ssa-threadupdate.c:1781^M
0x16dc767 thread_through_all_blocks(bool)^M
        /labs/tdevries/gcc/src/gcc/tree-ssa-threadupdate.c:2667^M
0x15522d2 execute^M
        /labs/tdevries/gcc/src/gcc/tree-ssa-dom.c:776^M
...

Reply via email to