From 7d3d820693627633e4f8057e0405ccd5907d2ae0 Mon Sep 17 00:00:00 2001 From: Markus Trippelsdorf Date: Wed, 30 Nov 2016 12:22:55 +0000 Subject: [PATCH] Fix part of PR78555 - gcc/real.c:2890:25: runtime error: left shift of negative value -125 PR ipa/78555 * real.c (real_hash): Add cast to avoid left shifting of negative values. From-SVN: r243012 --- gcc/ChangeLog | 6 ++++++ gcc/real.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8fd098bc85a..2a33ff416c7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-11-30 Markus Trippelsdorf + + PR ipa/78555 + * real.c (real_hash): Add cast to avoid left + shifting of negative values. + 2016-11-30 Kyrylo Tkachov PR target/78362 diff --git a/gcc/real.c b/gcc/real.c index 66e88e2ad36..eabe22de851 100644 --- a/gcc/real.c +++ b/gcc/real.c @@ -2887,7 +2887,7 @@ real_hash (const REAL_VALUE_TYPE *r) return h; case rvc_normal: - h |= REAL_EXP (r) << 3; + h |= (unsigned int)REAL_EXP (r) << 3; break; case rvc_nan: -- 2.30.2