https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94618
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |vmakarov at gcc dot gnu.org Keywords| |ra Component|debug |rtl-optimization --- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index e99fb9ff5d1..e508d736de8 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -9019,7 +9019,7 @@ split_critical_edges (bool for_edge_insertion_p /* = false */) { gimple_stmt_iterator gsi; - gsi = gsi_last_bb (e->src); + gsi = gsi_last_nondebug_bb (e->src); if (!gsi_end_p (gsi) && stmt_ends_bb_p (gsi_stmt (gsi)) && (gimple_code (gsi_stmt (gsi)) != GIMPLE_RETURN Doesn't fix it, disabling tail merging doesn't either. The difference is --- t.gkd 2020-04-16 16:15:15.906645135 +0200 +++ t.gk.gkd 2020-04-16 16:15:16.082647662 +0200 @@ -29,7 +29,7 @@ (pc))) "t.C":17:5# {*jcc} (expr_list:REG_DEAD (reg:CCZ 17 flags) (int_list:REG_BR_PROB 536870916 (nil))) - -> 13) + -> 14) (note # 0 0 [bb 3] NOTE_INSN_BASIC_BLOCK) (note # 0 0 NOTE_INSN_DELETED) (insn/f:TI # 0 0 3 (set (mem:DI (pre_dec:DI (reg/f:DI 7 sp)) [ S8 A8]) @@ -74,13 +74,13 @@ (const_int 8 [0x8])) [ MEM[(struct S *)this_2(D) + 8B].ae+0 S4 A32])) "t.C":8:12# {*movsi_internal} (expr_list:REG_EH_REGION (const_int -5 [0xfffffffffffffffb]) (nil))) +(note # 0 0 # NOTE_INSN_EH_REGION_BEG) (insn # 0 0 3 (set (reg:CCZ 17 flags) (compare:CCZ (mem:SI (plus:DI (reg/f:DI 5 di [orig:93 this ] [93]) (const_int 12 [0xc])) [ MEM[(struct S *)this_2(D) + 8B].af+0 S4 A32]) (reg:SI 6 bp [orig:87 _10 ] [87]))) "t.C":18:28# {*cmpsi_1} (expr_list:REG_DEAD (reg/f:DI 5 di [orig:93 this ] [93]) - (expr_list:REG_EH_REGION (const_int -6 [0xfffffffffffffffa]) - (nil)))) + (nil))) (jump_insn # 0 0 3 (set (pc) (if_then_else (eq (reg:CCZ 17 flags) (const_int 0 [0])) @@ -98,7 +98,6 @@ (insn # 0 0 4 (set (reg:DI 5 di) (reg/f:DI 41 r13 [orig:82 _1 ] [82])) "t.C":19:4# {*movdi_internal} (nil)) -(note # 0 0 # NOTE_INSN_EH_REGION_BEG) (call_insn:TI # 0 0 4 (call (mem:QI (symbol_ref:DI ("_ZN1S1iEi") [flags 0x41] <function_decl # i>) [ i S1 A8]) (const_int 0 [0])) "t.C":19:4# {*call} (expr_list:REG_DEAD (reg:DI 5 di) @@ -246,7 +245,7 @@ -> simple_return) (barrier # 0 0) (note # 0 0 NOTE_INSN_DELETED) -(code_label # 0 0 9 13 (nil) [1 uses]) +(code_label # 0 0 9 14 (nil) [1 uses]) (note # 0 0 [bb 9] NOTE_INSN_BASIC_BLOCK) (insn:TI # 0 0 9 (unspec_volatile [ (const_int 0 [0]) but on GIMPLE I cannot see any difference in EH info. Starting with LRA I see the disconnect with REG_EH_REGION notes on insn 17 / 41: (insn 17 16 18 3 (set (reg:CCZ 17 flags) (compare:CCZ (mem:SI (plus:DI (reg/f:DI 3 bx [orig:93 this ] [93]) (const_int 12 [0xc])) [1 MEM[(struct S *)this_2(D) + 8B].af+0 S4 A32]) (reg:SI 6 bp [orig:87 _10 ] [87]))) "t.C":18:28 11 {*cmpsi_1} (expr_list:REG_EH_REGION (const_int -6 [0xfffffffffffffffa]) (nil))) vs. (insn 41 40 42 3 (set (reg:CCZ 17 flags) (compare:CCZ (mem:SI (plus:DI (reg/f:DI 3 bx [orig:93 this ] [93]) (const_int 12 [0xc])) [1 MEM[(struct S *)this_2(D) + 8B].af+0 S4 A32]) (reg:SI 6 bp [orig:87 _10 ] [87]))) "t.C":18:28 11 {*cmpsi_1} (nil))