On Mon, Mar 18, 2024 at 6:59 PM Uros Bizjak <ubiz...@gmail.com> wrote: > > On Mon, Mar 18, 2024 at 11:52 AM liuhongt <hongtao....@intel.com> wrote: > > > > Commit r14-9459-g618e34d56cc38e only handles > > general_scalar_chain::convert_op. The patch also handles > > timode_scalar_chain::convert_op to avoid potential similar bug. > > > > Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. > > Ok for trunk and backport to releases/gcc-13 branch? > > I have the following patch in testing that merges > {general,timode}_scalar_chain::convert_op, so in addition to less code > duplication, it will fix the issue for both chains. WDYT? It would be better for maintenance, I prefer your patch. > > Uros. > > > > > gcc/ChangeLog: > > > > PR target/111822 > > * config/i386/i386-features.cc > > (timode_scalar_chain::convert_op): Handle REG_EH_REGION note. > > --- > > gcc/config/i386/i386-features.cc | 20 +++++++++++++++++--- > > 1 file changed, 17 insertions(+), 3 deletions(-) > > > > diff --git a/gcc/config/i386/i386-features.cc > > b/gcc/config/i386/i386-features.cc > > index c7d7a965901..38f57d96df5 100644 > > --- a/gcc/config/i386/i386-features.cc > > +++ b/gcc/config/i386/i386-features.cc > > @@ -1794,12 +1794,26 @@ timode_scalar_chain::convert_op (rtx *op, rtx_insn > > *insn) > > *op = gen_rtx_SUBREG (V1TImode, *op, 0); > > else if (MEM_P (*op)) > > { > > + rtx_insn* eh_insn; > > rtx tmp = gen_reg_rtx (V1TImode); > > - emit_insn_before (gen_rtx_SET (tmp, > > - gen_gpr_to_xmm_move_src (V1TImode, > > *op)), > > - insn); > > + eh_insn > > + = emit_insn_before (gen_rtx_SET (tmp, > > + gen_gpr_to_xmm_move_src (V1TImode, > > + *op)), > > + insn); > > *op = tmp; > > > > + if (cfun->can_throw_non_call_exceptions) > > + { > > + /* Handle REG_EH_REGION note. */ > > + rtx note = find_reg_note (insn, REG_EH_REGION, NULL_RTX); > > + if (note) > > + { > > + control_flow_insns.safe_push (eh_insn); > > + add_reg_note (eh_insn, REG_EH_REGION, XEXP (note, 0)); > > + } > > + } > > + > > if (dump_file) > > fprintf (dump_file, " Preloading operand for insn %d into r%d\n", > > INSN_UID (insn), REGNO (tmp)); > > -- > > 2.31.1 > >
-- BR, Hongtao