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

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
distribute_notes has:
          /* If this register is set or clobbered in I3, put the note there
             unless there is one already.  */
          if (reg_set_p (XEXP (note, 0), PATTERN (i3)))
            {
              if (from_insn != i3)
                break;

              if (! (REG_P (XEXP (note, 0))
                     ? find_regno_note (i3, REG_UNUSED, REGNO (XEXP (note, 0)))
                     : find_reg_note (i3, REG_UNUSED, XEXP (note, 0))))
                place = i3;
            }
          /* Otherwise, if this register is used by I3, then this register
             now dies here, so we must put a REG_DEAD note here unless there
             is one already.  */
          else if (reg_referenced_p (XEXP (note, 0), PATTERN (i3))
                   && ! (REG_P (XEXP (note, 0))
                         ? find_regno_note (i3, REG_DEAD,
                                            REGNO (XEXP (note, 0)))
                         : find_reg_note (i3, REG_DEAD, XEXP (note, 0))))
            {
              PUT_REG_NOTE_KIND (note, REG_DEAD);
              place = i3;
            }
the if (reg_set_p (...)) is false, as flags is not set by the insn, it is used.
But the else if is clearly not true, at least when XEXP (note, 0) is set in
instructions in between i3 and i2 (or from whatever insn the notes come from).

Reply via email to