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.sandif...@linaro.org>
            Alan Hayward  <alan.hayw...@arm.com>
            David Sherwood  <david.sherw...@arm.com>

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

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);

Reply via email to