public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] Fix bogus CONST_WIDE_INT hash
@ 2017-08-21 10:50 Richard Sandiford
  0 siblings, 0 replies; only message in thread
From: Richard Sandiford @ 2017-08-21 10:50 UTC (permalink / raw)
  To: gcc-patches

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.

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-08-21  9:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-21 10:50 [committed] Fix bogus CONST_WIDE_INT hash Richard Sandiford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).