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;