https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123092
--- Comment #12 from Peter Bergner <bergner at gcc dot gnu.org> ---
(In reply to Jeffrey A. Law from comment #11)
> So as I hinted at on Tuesday, the LRA code is making changes to the relevant
> insn without checking for the validity of those changes.
>
> However, it's happening through a path I'm not familiar with. In particular
> here:
>
> if (curr_insn_transform (false))
> changed_p = true;
> /* Check non-transformed insns too for equiv change as USE
> or CLOBBER don't need reloads but can contain pseudos
> being changed on their equivalences. */
> else if (bitmap_bit_p (equiv_insn_bitmap, INSN_UID (curr_insn))
> && loc_equivalence_change_p (&PATTERN (curr_insn)))
> {
> lra_update_insn_regno_info (curr_insn);
> changed_p = true;
> }
Heh, yes, I debugged it to this path as well and confirm we never revisit the
insn after forcing in the equivalence without checking it against any
constraints. I agree with you, I'd like Vlad's input on how this is supposed
to work.