diff mbox

[committed] Fix bogus CONST_WIDE_INT hash

Message ID 87shgldzit.fsf@linaro.org
State New
Headers show

Commit Message

Richard Sandiford Aug. 21, 2017, 9:46 a.m. UTC
The CONST_WIDE_INT case in const_rtx_hash_1 started the hash
with the precision of the mode, but the mode is always VOIDmode.

Tested on aarch64-linux-gnu and x86_64-linux-gnu.  Applied as obvious.

Richard


2017-08-21  Richard Sandiford  <richard.sandiford@linaro.org>
	    Alan Hayward  <alan.hayward@arm.com>
	    David Sherwood  <david.sherwood@arm.com>

gcc/
	* varasm.c (const_rtx_hash_1): Don't hash in the mode of a
	CONST_WIDE_INT.
diff mbox

Patch

Index: gcc/varasm.c
===================================================================
--- gcc/varasm.c	2017-08-10 14:36:08.449457108 +0100
+++ gcc/varasm.c	2017-08-21 10:43:04.352530400 +0100
@@ -3639,7 +3639,7 @@  const_rtx_hash_1 (const_rtx x)
       break;
 
     case CONST_WIDE_INT:
-      hwi = GET_MODE_PRECISION (mode);
+      hwi = 0;
       {
 	for (i = 0; i < CONST_WIDE_INT_NUNITS (x); i++)
 	  hwi ^= CONST_WIDE_INT_ELT (x, i);