This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix disable-checking bootstrap problem on ppc-darwin


Under just the right circumstances, usually involving
--disable-checking, and dependent on environment size and ulimit
settings, you can get a hash collision in value_table which causes two
things with different vuses to compare the same, which is (I think)
not what is wanted.

I see that the whole vuses thing is a work-in-progress, so I won't
worry too much about some of the things I saw.  I would point out,
though, that it seems somewhat strange that in

x = a + b;
y = *x;

the two 'x's get numbered differently; there might be an opportunity
there.

Bootstrapped & tested on powerpc-darwin.

-- 
- Geoffrey Keating <geoffk@apple.com>

===File ~/patches/gcc-treevn-hasheq.patch===================
2004-08-10  Geoffrey Keating  <geoffk@apple.com>

	* tree-vn.c (val_expr_pair_expr_eq): Compare vuses, to match the
	hash function.

Index: tree-vn.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-vn.c,v
retrieving revision 2.3.12.1
diff -u -p -u -p -r2.3.12.1 tree-vn.c
--- tree-vn.c	6 Aug 2004 05:16:47 -0000	2.3.12.1
+++ tree-vn.c	10 Aug 2004 09:13:04 -0000
@@ -151,11 +151,20 @@ val_expr_pair_expr_eq (const void *p1, c
 {
   const val_expr_pair_t ve1 = (val_expr_pair_t) p1;
   const val_expr_pair_t ve2 = (val_expr_pair_t) p2;
+  size_t i;
 
-  if (expressions_equal_p (ve1->e, ve2->e))
-    return true;
+  if (! expressions_equal_p (ve1->e, ve2->e))
+    return false;
+
+  if (NUM_VUSES (ve1->vuses) != NUM_VUSES (ve2->vuses))
+    return false;
+  
+  for (i = 0; i < NUM_VUSES (ve1->vuses); i++)
+    if (! expressions_equal_p (VUSE_OP (ve1->vuses, i),
+			       VUSE_OP (ve2->vuses, i)))
+      return false;
   
-  return false;
+  return true;
 }
 
 
============================================================


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]