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]

Re: [wide-int 3/5] Fix large widths in shifted_mask


approved
On 04/25/2014 09:40 AM, Richard Sandiford wrote:
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;


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