This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[wide-int 4/5] Fix canonize handling of "small_prec" case
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: zadeck at naturalbridge dot com, mikestump at comcast dot net
- Date: Fri, 25 Apr 2014 14:44:56 +0100
- Subject: [wide-int 4/5] Fix canonize handling of "small_prec" case
- Authentication-results: sourceware.org; auth=none
We should write back the sign-extended value.
Tested on x86_64-linux-gnu. OK to install?
Thanks,
Richard
Index: gcc/wide-int.cc
===================================================================
--- gcc/wide-int.cc 2014-04-25 09:15:14.297359380 +0100
+++ gcc/wide-int.cc 2014-04-25 09:15:50.755637670 +0100
@@ -81,7 +81,7 @@ canonize (HOST_WIDE_INT *val, unsigned i
top = val[len - 1];
if (len * HOST_BITS_PER_WIDE_INT > precision)
- top = sext_hwi (top, precision % HOST_BITS_PER_WIDE_INT);
+ val[len - 1] = top = sext_hwi (top, precision % HOST_BITS_PER_WIDE_INT);
if (top != 0 && top != (HOST_WIDE_INT)-1)
return len;