cse.c (cse_basic_block): Fixup hash flushing loop so we do not accidently walk into...
authorDavid S. Miller <davem@pierdol.cobaltnet.com>
Fri, 16 Oct 1998 01:23:51 +0000 (01:23 +0000)
committerDavid S. Miller <davem@gcc.gnu.org>
Fri, 16 Oct 1998 01:23:51 +0000 (18:23 -0700)
* cse.c (cse_basic_block): Fixup hash flushing loop so we do not
accidently walk into the free list.  Comment how that can happen.
(invalidate): Fix indentation.

From-SVN: r23122

gcc/ChangeLog
gcc/cse.c

index 55cc43ea5936a749f5f5fbefc2078636f80dc088..36aff77a3f9ad2b5ccac3f12453c6012746bbc76 100644 (file)
@@ -1,3 +1,9 @@
+Fri Oct 16 08:13:46 1998  David S. Miller  <davem@pierdol.cobaltnet.com>
+
+       * cse.c (cse_basic_block): Fixup hash flushing loop so we do not
+       accidently walk into the free list.  Comment how that can happen.
+       (invalidate): Fix indentation.
+
 Thu Oct 15 23:53:29 1998 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
                         Jeffrey A Law  (law@cygnus.com)
 
index 1933fbc75d13c43abb091174e8fa0eb5717938b7..7e64ef305f2ed98a60d63bdb2e29ee509cb73643 100644 (file)
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -1651,7 +1651,7 @@ invalidate (x, full_mode)
                  tendregno
                    = tregno + HARD_REGNO_NREGS (tregno, GET_MODE (p->exp));
                  if (tendregno > regno && tregno < endregno)
-                 remove_from_table (p, hash);
+                   remove_from_table (p, hash);
                }
        }
 
@@ -8706,7 +8706,7 @@ cse_basic_block (from, to, next_branch, around_loop)
     {
       register enum rtx_code code = GET_CODE (insn);
       int i;
-      struct table_elt *p, *next;
+      struct table_elt *p;
 
       /* If we have processed 1,000 insns, flush the hash table to
         avoid extreme quadratic behavior.  We must not include NOTEs
@@ -8720,10 +8720,10 @@ cse_basic_block (from, to, next_branch, around_loop)
       if (code != NOTE && num_insns++ > 1000)
        {
          for (i = 0; i < NBUCKETS; i++)
-           for (p = table[i]; p; p = next)
+           for (p = table[i]; p; p = table[i])
              {
-               next = p->next_same_hash;
-
+               /* Note that invalidate can remove elements
+                  after P in the current hash chain.  */
                if (GET_CODE (p->exp) == REG)
                  invalidate (p->exp, p->mode);
                else