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]

stabilize java assertion tables


Using TYPE_UID rather than pointers to hash type_assertions shaved off
another 70 -fvar-tracking-assignments (and, probably -g vs -g0)
codegen differences.  Now I'm down to four differences on
x86_64-linux-gnu libs, yay.

Ok for trunk, after retesting in it (rather than in the vta branch)
completes?

for  gcc/ChangeLog.vta => gcc/java/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* java/expr.c (type_assertion_hash): Hash type uids rather
	than tree pointers.

Index: gcc/java/expr.c
===================================================================
--- gcc/java/expr.c.orig	2007-09-08 20:11:06.000000000 -0300
+++ gcc/java/expr.c	2007-11-08 00:40:04.000000000 -0200
@@ -433,8 +433,26 @@ type_assertion_hash (const void *p)
   const type_assertion *k_p = p;
   hashval_t hash = iterative_hash (&k_p->assertion_code, sizeof
 				   k_p->assertion_code, 0);
-  hash = iterative_hash (&k_p->op1, sizeof k_p->op1, hash);
-  return iterative_hash (&k_p->op2, sizeof k_p->op2, hash);
+
+  switch (k_p->assertion_code) {
+  case JV_ASSERT_TYPES_COMPATIBLE:
+    hash = iterative_hash (&TYPE_UID (k_p->op2), sizeof TYPE_UID (k_p->op2),
+			   hash);
+    /* Fall through.  */
+
+  case JV_ASSERT_IS_INSTANTIABLE:
+    hash = iterative_hash (&TYPE_UID (k_p->op1), sizeof TYPE_UID (k_p->op1),
+			   hash);
+    /* Fall through.  */
+
+  case JV_ASSERT_END_OF_TABLE:
+    break;
+
+  default:
+    gcc_unreachable ();
+  }
+
+  return hash;
 }
 
 /* Add an entry to the type assertion table for the given class.  
-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
FSF Latin America Board Member         http://www.fsfla.org/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

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