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] Fix exact_log2 zext test


...which I'd fluffed when doing the wi:: conversion.

Tested on powerpc64-linux-gnu and x86_64-linux-gnu.  It fixed a spurious
gcc.dg difference on alpha-linux-gnu.  Applied as obvious.

Thanks,
Richard


Index: gcc/wide-int.cc
===================================================================
--- gcc/wide-int.cc	(revision 204311)
+++ gcc/wide-int.cc	(working copy)
@@ -2044,7 +2044,7 @@
 
   /* Get a zero-extended form of block CRUX.  */
   unsigned HOST_WIDE_INT hwi = x.val[crux];
-  if (crux * HOST_BITS_PER_WIDE_INT > x.precision)
+  if ((crux + 1) * HOST_BITS_PER_WIDE_INT > x.precision)
     hwi = zext_hwi (hwi, x.precision % HOST_BITS_PER_WIDE_INT);
 
   /* Now it's down to whether HWI is a power of 2.  */


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