diff options
author | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1994-07-14 13:42:18 +0000 |
---|---|---|
committer | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1994-07-14 13:42:18 +0000 |
commit | b3c852011539bd00f58e18292453f17715ef5c67 (patch) | |
tree | 53aaf236f329389b5a1f975bf929954e0ae4cef1 /gcc/explow.c | |
parent | 3bc8e4d6ff9f20084da2d7e73834a4b8f1556d3b (diff) | |
download | gcc-b3c852011539bd00f58e18292453f17715ef5c67.tar.gz |
(force_reg): Don't make a REG_EQUAL note for an insn that doesn't set
TEMP.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@7771 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/explow.c')
-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 1c94b816c19..b72e468e050 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); |