Commit 759bd8b7 by J"orn Rennecke Committed by Joern Rennecke

* cse (cse_insn): Don't make change without validation.

From-SVN: r20996
parent 8ea2460f
Tue Jul 7 21:05:25 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
* cse (cse_insn): Don't make change without validation.
Tue Jul 7 11:40:05 1998 Jeffrey A Law (law@cygnus.com) Tue Jul 7 11:40:05 1998 Jeffrey A Law (law@cygnus.com)
* mn10200.md (various zero/sign extension patterns): zero and sign * mn10200.md (various zero/sign extension patterns): zero and sign
......
...@@ -7004,17 +7004,24 @@ cse_insn (insn, libcall_insn) ...@@ -7004,17 +7004,24 @@ cse_insn (insn, libcall_insn)
SRC is a hard register. */ SRC is a hard register. */
{ {
int first = qty_first_reg[reg_qty[REGNO (src)]]; int first = qty_first_reg[reg_qty[REGNO (src)]];
rtx new_src
src = SET_SRC (sets[i].rtl) = (first >= FIRST_PSEUDO_REGISTER
= first >= FIRST_PSEUDO_REGISTER ? regno_reg_rtx[first] ? regno_reg_rtx[first] : gen_rtx_REG (GET_MODE (src), first));
: gen_rtx_REG (GET_MODE (src), first);
/* We must use validate-change even for this, because this
/* If we had a constant that is cheaper than what we are now might be a special no-op instruction, suitable only to
setting SRC to, use that constant. We ignored it when we tag notes onto. */
thought we could make this into a no-op. */ if (validate_change (insn, &SET_SRC (sets[i].rtl), new_src, 0))
if (src_const && COST (src_const) < COST (src) {
&& validate_change (insn, &SET_SRC (sets[i].rtl), src_const, 0)) src = new_src;
src = src_const; /* If we had a constant that is cheaper than what we are now
setting SRC to, use that constant. We ignored it when we
thought we could make this into a no-op. */
if (src_const && COST (src_const) < COST (src)
&& validate_change (insn, &SET_SRC (sets[i].rtl), src_const,
0))
src = src_const;
}
} }
/* If we made a change, recompute SRC values. */ /* If we made a change, recompute SRC values. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment