]> gcc.gnu.org Git - gcc.git/commitdiff
re PR rtl-optimization/16114 (Hang in cse.c (flush_hash_table))
authorRichard Henderson <rth@redhat.com>
Mon, 21 Jun 2004 23:39:26 +0000 (16:39 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Mon, 21 Jun 2004 23:39:26 +0000 (16:39 -0700)
        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.

From-SVN: r83463

gcc/ChangeLog
gcc/cse.c

index 161dba3f8b07d50fce5d9cae4f646bada6ca7f6e..9cc5d53db731c84f4748136e6aa97f08f76319bf 100644 (file)
@@ -1,3 +1,10 @@
+2004-06-21  Richard Henderson  <rth@redhat.com>
+
+        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.
+
 2004-06-21  Richard Henderson  <rth@redhat.com>
 
        * c-common.def (RETURN_STMT): Remove.
index bb898d0498c4ad8d1abcf22c4d6e1645f7bdd8a1..e322ec7fbb8d53674dba7d4f9d19e6afe4a8558f 100644 (file)
--- 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))
          {
This page took 0.090532 seconds and 5 git commands to generate.