This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[wide-int 3/5] Fix large widths in shifted_mask
- 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:40:58 +0100
- Subject: [wide-int 3/5] Fix large widths in shifted_mask
- Authentication-results: sourceware.org; auth=none
Very minor, but since shifted_mask copes with out-of-range widths,
I think mask should too.
Tested on x86_64-linux-gnu. OK to install?
Thanks,
Richard
Index: gcc/wide-int.cc
===================================================================
--- gcc/wide-int.cc 2014-04-25 09:26:57.025944460 +0100
+++ gcc/wide-int.cc 2014-04-25 09:37:16.873811137 +0100
@@ -716,7 +716,7 @@ wi::mask (HOST_WIDE_INT *val, unsigned i
gcc_assert (width < 4 * MAX_BITSIZE_MODE_ANY_INT);
gcc_assert (prec <= 4 * MAX_BITSIZE_MODE_ANY_INT);
- if (width == prec)
+ if (width >= prec)
{
val[0] = negate ? 0 : -1;
return 1;