From f353588adaad75336ab10149afdb0728be08830d Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Sun, 26 Nov 1995 14:47:28 -0500 Subject: (insert): Don't put a REG into qty_const. From-SVN: r10607 --- gcc/cse.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gcc') 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); -- cgit v1.1