[PR117182, LRA]: Move point of skipping postponed insn

Working on PR117182 I found that a pseudo generated for save/restore
value around call is changed by equivalence which is constant as we
propagate equivalence for such pseudos to generate a better code.  The
constant substitutes output of the save insn which can be changed to
memory containing constant by reload insn.  We don't want this.  The
patch fixes this.

gcc/ChangeLog:

	PR target/117182
	* lra-constraints.cc (curr_insn_transform): Don't change an output
	operand by constant or invariant equivalence.
This commit is contained in:
Vladimir N. Makarov
2026-03-13 16:19:33 -04:00
parent e256eb478a
commit 6bfe24239a

View File

@@ -4419,7 +4419,12 @@ curr_insn_transform (bool check_only_p)
&& !targetm.hard_regno_mode_ok (REGNO (subst), outer_mode))
continue;
if (subst != old)
if (subst != old
/* We don't want to change an out operand by constant or invariant
which will require additional reloads, e.g. by putting a constant
into memory. */
&& (curr_static_id->operand[i].type == OP_IN || MEM_P (subst)
|| (GET_CODE (subst) == SUBREG && MEM_P (SUBREG_REG (subst)))))
{
equiv_substition_p[i] = true;
rtx new_subst = copy_rtx (subst);