This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
cselib fix
- To: <gcc-patches at gcc dot gnu dot org>
- Subject: cselib fix
- From: Bernd Schmidt <bernds at cambridge dot redhat dot com>
- Date: Thu, 15 Mar 2001 12:53:19 +0000 (GMT)
This should fix the problem Colin Howell has found. Seems like I broke this
just two days after checking in the cselib code. Of course we can't add the
rtx code of an expression into the hash value for REGs and MEMs; the code
absolutely depends on returning the same hash value for two rtx's with the
same value. Now where's my brown paper bag?
Bootstrapped on i686-linux. Will install on 3.0 branch as well after another
bootstrap.
Bernd
* cselib.c (hash_rtx): For REG and MEM, just use value of expression
without adding in rtx code and mode.
Index: cselib.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cselib.c,v
retrieving revision 1.3
diff -u -p -r1.3 cselib.c
--- cselib.c 2001/03/09 17:03:46 1.3
+++ cselib.c 2001/03/15 12:36:30
@@ -579,8 +579,7 @@ hash_rtx (x, mode, create)
if (! e)
return 0;
- hash += e->value;
- return hash ? hash : (unsigned int) MEM;
+ return e->value;
case CONST_INT:
hash += ((unsigned) CONST_INT << 7) + (unsigned) mode + INTVAL (x);