This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[wide-int 4/5] Fix canonize handling of "small_prec" case


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;
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]