> The following testcase ICEs on ppc64le.  The problem is that
> copy_reg_eh_region_note_* functions accept either some instruction, or
> REG_EH_REGION note directly.  To differentiate between those it uses INSN_P
> test (and returns early if the insn doesn't contain any REG_EH_REGION
> notes).  If the function is called on a rtx_insn * that isn't INSN_P, like
> on the testcase on a NOTE, it assumes it must be REG_EH_REGION note, uses
> XEXP (note, 0) on it, which is actually PREV_INSN in this case and stores
> an instruction (JUMP_INSN in this case) into REG_EH_REGION notes it creates.

It took me a few minutes to clear the confusion between NOTE & REG_NOTE here.

> I believe we should treat rtx_insn * that aren't INSN_P like instructions
> that don't have any REG_EH_REGION notes.
>
> 2019-02-07  Jakub Jelinek  <ja...@redhat.com>
> 
>       PR rtl-optimization/89234
>       * except.c (copy_reg_eh_region_note_forward): Return if note_or_insn
>       is a NOTE, CODE_LABEL etc. - rtx_insn * other than INSN_P.
>       (copy_reg_eh_region_note_backward): Likewise.
> 
>       * g++.dg/ubsan/pr89234.C: New test.

OK, thanks.

-- 
Eric Botcazou

Reply via email to