Patch to type_hash_eq

Joseph S. Myers jsm@polyomino.org.uk
Sat Jul 3 19:46:00 GMT 2004


This patch fixes the apparent typo in type_hash_eq noted in
<http://gcc.gnu.org/ml/gcc-patches/2004-07/msg00078.html>, confirmed
by Kenner in
<http://gcc.gnu.org/ml/gcc-patches/2004-07/msg00079.html>.  (As far as
I know, without other patches creating types for which this is a
problem, it is a latent bug, not one for which a testcase can be
created.  With the bit-field patch it showed up as a problem in
objc.dg/bitfield-4.m.)

Bootstrapped with no regressions on i686-pc-linux-gnu.  OK to commit?

2004-07-03  Joseph S. Myers  <jsm@polyomino.org.uk>

	* tree.c (type_hash_eq): Allow TYPE_MIN_VALUE which compares equal
	with tree_int_cst_equal.


-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)


diff -rupN GCC.orig/gcc/tree.c GCC/gcc/tree.c
--- GCC.orig/gcc/tree.c	2004-07-01 14:55:54.000000000 +0000
+++ GCC/gcc/tree.c	2004-07-01 16:01:43.000000000 +0000
@@ -3240,7 +3240,7 @@ type_hash_eq (const void *va, const void
 	       || tree_int_cst_equal (TYPE_MAX_VALUE (a->type),
 				      TYPE_MAX_VALUE (b->type)))
 	      && (TYPE_MIN_VALUE (a->type) == TYPE_MIN_VALUE (b->type)
-		  && tree_int_cst_equal (TYPE_MIN_VALUE (a->type),
+		  || tree_int_cst_equal (TYPE_MIN_VALUE (a->type),
 					 TYPE_MIN_VALUE (b->type))));
 
     case OFFSET_TYPE:



More information about the Gcc-patches mailing list