diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1994-07-14 09:42:18 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1994-07-14 09:42:18 -0400 |
commit | 62874575d9628c6e7b3bf072ca754c74b64fd3a0 (patch) | |
tree | 53aaf236f329389b5a1f975bf929954e0ae4cef1 | |
parent | eb3a6507538a18ed673f1e395ab7d5a4532f1dd7 (diff) | |
download | gcc-62874575d9628c6e7b3bf072ca754c74b64fd3a0.zip gcc-62874575d9628c6e7b3bf072ca754c74b64fd3a0.tar.gz gcc-62874575d9628c6e7b3bf072ca754c74b64fd3a0.tar.bz2 |
(force_reg): Don't make a REG_EQUAL note for an insn that doesn't set
TEMP.
From-SVN: r7771
-rw-r--r-- | gcc/explow.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/explow.c b/gcc/explow.c index 1c94b81..b72e468 100644 --- a/gcc/explow.c +++ b/gcc/explow.c @@ -578,15 +578,19 @@ force_reg (mode, x) enum machine_mode mode; rtx x; { - register rtx temp, insn; + register rtx temp, insn, set; if (GET_CODE (x) == REG) return x; temp = gen_reg_rtx (mode); insn = emit_move_insn (temp, x); + /* Let optimizers know that TEMP's value never changes - and that X can be substituted for it. */ - if (CONSTANT_P (x)) + and that X can be substituted for it. Don't get confused + if INSN set something else (such as a SUBREG of TEMP). */ + if (CONSTANT_P (x) + && (set = single_set (insn)) != 0 + && SET_DEST (set) == temp) { rtx note = find_reg_note (insn, REG_EQUAL, NULL_RTX); |