Message ID | 878uqtedcl.fsf@talisman.default |
---|---|
State | New |
Headers | show |
richard, I think that this patch is fine as is. but in looking at the surrounding code, i saw something that appears to be somewhat troubling. I am worried about the two asserts. Given that we now require that some users write code similar to the code in tree-vrp.c:2628, it seems that these asserts are only latent land mines. kenny 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;
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;
Kenneth Zadeck <zadeck@naturalbridge.com> writes: > I think that this patch is fine as is. but in looking at the > surrounding code, i saw something that appears to be somewhat troubling. > > I am worried about the two asserts. Given that we now require that > some users write code similar to the code in tree-vrp.c:2628, it seems > that these asserts are only latent land mines. Yeah, they should probably go. OK to remove them? 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;