From 38fbc003332134ef0a04d319fb71b297f67c6988 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Mon, 21 Aug 2017 09:46:05 +0000 Subject: [PATCH] Fix bogus CONST_WIDE_INT hash 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. 2017-08-21 Richard Sandiford Alan Hayward David Sherwood gcc/ * varasm.c (const_rtx_hash_1): Don't hash in the mode of a CONST_WIDE_INT. Co-Authored-By: Alan Hayward Co-Authored-By: David Sherwood From-SVN: r251218 --- gcc/ChangeLog | 7 +++++++ gcc/varasm.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 213b5c803ab..34ecfdc8188 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2017-08-21 Richard Sandiford + Alan Hayward + David Sherwood + + * varasm.c (const_rtx_hash_1): Don't hash in the mode of a + CONST_WIDE_INT. + 2017-08-21 Richard Biener PR middle-end/81884 diff --git a/gcc/varasm.c b/gcc/varasm.c index e0834a1ff3b..91680d692b4 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -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); -- 2.30.2