https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105231
--- Comment #22 from rguenther at suse dot de <rguenther at suse dot de> --- On Wed, 13 Apr 2022, ebotcazou at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105231 > > --- Comment #21 from Eric Botcazou <ebotcazou at gcc dot gnu.org> --- > > I'm not sure that's a general enough fix though since we seem to drop > > the REG_EQUAL note and as soon as we do that there's a disconnect > > between what CFG generation thinks throws and what combine thinks > > is good enough to put a REG_EH_REGION note on. > > Yes, we actually drop 2 REG_EQUAL notes: > > (insn 22 17 78 3 (set (reg:SF 92) > (mem/u/c:SF (symbol_ref/u:SI ("*.LC0") [flags 0x2]) [0 S4 A32])) > "pr105231.c":6:3 142 {*movsf_internal} > (expr_list:REG_EQUAL (const_double:SF 1.8446744073709551616e+19 > [0x0.8p+65]) > (nil))) > > (insn 78 22 24 3 (set (reg:XF 99) > (float_extend:XF (reg:SF 92))) 166 {*extendsfxf2_i387} > (expr_list:REG_DEAD (reg:SF 92) > (expr_list:REG_EQUAL (const_double:XF 1.8446744073709551616e+19 > [0x0.8p+65]) > (nil)))) > > --> > > (insn 78 22 24 3 (set (reg:XF 99) > (float_extend:XF (mem/u/c:SF (symbol_ref/u:SI ("*.LC0") [flags 0x2]) > [0 > S4 A32]))) 166 {*extendsfxf2_i387} > (expr_list:REG_EH_REGION (const_int 1 [0x1]) > (nil))) > > so an immediate solution would be to preserve the one on insn 78 (and arrange > for the purge_dead_edge magic to trigger again). Yes. If i3 is always the insn we combine into any REG_EQUAL note on that insn can always prevail. I suppose the purge_dead_edge magic would need to be postponed until we distributed all notes - not sure where a safe place would be to remove EH_REGION notes in combine after note distribution finalized?