aboutsummaryrefslogtreecommitdiff
path: root/gcc/cse.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1995-11-26 14:47:28 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1995-11-26 14:47:28 -0500
commitf353588adaad75336ab10149afdb0728be08830d (patch)
tree5f3cd5d9779bef7cbe5fbfd8a11fab898620ca07 /gcc/cse.c
parentde3cb7c346e71aa17e37bc48c19105c9fa2cb772 (diff)
downloadgcc-f353588adaad75336ab10149afdb0728be08830d.zip
gcc-f353588adaad75336ab10149afdb0728be08830d.tar.gz
gcc-f353588adaad75336ab10149afdb0728be08830d.tar.bz2
(insert): Don't put a REG into qty_const.
From-SVN: r10607
Diffstat (limited to 'gcc/cse.c')
-rw-r--r--gcc/cse.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/cse.c b/gcc/cse.c
index 7fa597e..efd05de 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -1371,20 +1371,22 @@ insert (x, classp, hash, mode)
update `qty_const_insn' to show that `this_insn' is the latest
insn making that quantity equivalent to the constant. */
- if (elt->is_const && classp && GET_CODE (classp->exp) == REG)
+ if (elt->is_const && classp && GET_CODE (classp->exp) == REG
+ && GET_CODE (x) != REG)
{
qty_const[reg_qty[REGNO (classp->exp)]]
= gen_lowpart_if_possible (qty_mode[reg_qty[REGNO (classp->exp)]], x);
qty_const_insn[reg_qty[REGNO (classp->exp)]] = this_insn;
}
- else if (GET_CODE (x) == REG && classp && ! qty_const[reg_qty[REGNO (x)]])
+ else if (GET_CODE (x) == REG && classp && ! qty_const[reg_qty[REGNO (x)]]
+ && ! elt->is_const)
{
register struct table_elt *p;
for (p = classp; p != 0; p = p->next_same_value)
{
- if (p->is_const)
+ if (p->is_const && GET_CODE (p->exp) != REG)
{
qty_const[reg_qty[REGNO (x)]]
= gen_lowpart_if_possible (GET_MODE (x), p->exp);