summaryrefslogtreecommitdiff
path: root/gcc/cse.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-21 23:39:26 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-21 23:39:26 +0000
commitb57e33a433988215880ee38d0f392bba7a5c8726 (patch)
tree49088fd6a9e8184dc04437a6c07f6a9e4adb6534 /gcc/cse.c
parentc857cd60b89c8c9cb6f064ab3d1de1eaae22db1d (diff)
downloadgcc-b57e33a433988215880ee38d0f392bba7a5c8726.tar.gz
PR rtl-opt/16114
* cse.c (merge_equiv_classes): Also rehash in response to delete_reg_equiv changes. (rehash_using_reg): Don't exclude REGs from rehashing. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83463 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cse.c')
-rw-r--r--gcc/cse.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/cse.c b/gcc/cse.c
index bb898d0498c..e322ec7fbb8 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -1633,15 +1633,20 @@ merge_equiv_classes (struct table_elt *class1, struct table_elt *class2)
hash code (it also isn't necessary). */
if (REG_P (exp) || exp_equiv_p (exp, exp, 1, 0))
{
+ bool need_rehash = false;
+
hash_arg_in_memory = 0;
hash = HASH (exp, mode);
if (REG_P (exp))
- delete_reg_equiv (REGNO (exp));
+ {
+ need_rehash = (unsigned) REG_QTY (REGNO (exp)) != REGNO (exp);
+ delete_reg_equiv (REGNO (exp));
+ }
remove_from_table (elt, hash);
- if (insert_regs (exp, class1, 0))
+ if (insert_regs (exp, class1, 0) || need_rehash)
{
rehash_using_reg (exp);
hash = HASH (exp, mode);
@@ -1914,14 +1919,13 @@ rehash_using_reg (rtx x)
return;
/* Scan all hash chains looking for valid entries that mention X.
- If we find one and it is in the wrong hash chain, move it. We can skip
- objects that are registers, since they are handled specially. */
+ If we find one and it is in the wrong hash chain, move it. */
for (i = 0; i < HASH_SIZE; i++)
for (p = table[i]; p; p = next)
{
next = p->next_same_hash;
- if (!REG_P (p->exp) && reg_mentioned_p (x, p->exp)
+ if (reg_mentioned_p (x, p->exp)
&& exp_equiv_p (p->exp, p->exp, 1, 0)
&& i != (hash = safe_hash (p->exp, p->mode) & HASH_MASK))
{