aboutsummaryrefslogtreecommitdiff
path: root/gcc/cse.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@pierdol.cobaltnet.com>1998-10-16 01:23:51 +0000
committerDavid S. Miller <davem@gcc.gnu.org>1998-10-15 18:23:51 -0700
commit925be47cd54bcdb5e6da71a37de22ca08f367f83 (patch)
tree9def81cd0e6f0f1c919ba36f812a91b498a74a73 /gcc/cse.c
parent748f2a2298e1b15954f5d113b4dba07fa8231bc6 (diff)
downloadgcc-925be47cd54bcdb5e6da71a37de22ca08f367f83.zip
gcc-925be47cd54bcdb5e6da71a37de22ca08f367f83.tar.gz
gcc-925be47cd54bcdb5e6da71a37de22ca08f367f83.tar.bz2
cse.c (cse_basic_block): Fixup hash flushing loop so we do not accidently walk into the free list.
* 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
Diffstat (limited to 'gcc/cse.c')
-rw-r--r--gcc/cse.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/cse.c b/gcc/cse.c
index 1933fbc..7e64ef3 100644
--- 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