Message ID | C3C2B9D8-4F40-40EB-BF2A-755192576473@comcast.net |
---|---|
State | New |
Headers | show |
> So, given the last change, the remaining bit is: > > Index: gcc/ada/gcc-interface/cuintp.c > =================================================================== > --- gcc/ada/gcc-interface/cuintp.c (revision 209754) > +++ gcc/ada/gcc-interface/cuintp.c (working copy) > @@ -160,7 +160,11 @@ UI_From_gnu (tree Input) > in a signed 64-bit integer. */ > if (tree_fits_shwi_p (Input)) > return UI_From_Int (tree_to_shwi (Input)); > - else if (wi::neg_p (Input) && TYPE_UNSIGNED (gnu_type)) > + > + gcc_assert (TYPE_PRECISION (gnu_type) <= 64); > + if (TYPE_UNSIGNED (gnu_type) > + && TYPE_PRECISION (gnu_type) == 64 > + && wi::neg_p (Input, SIGNED)) > return No_Uint; > #endif > > We need this to ensure that 32 to 63 bit values with the high bit set don’t > return No_Uint. This should also address the performance concerns as well. OK, thanks.
Index: gcc/ada/gcc-interface/cuintp.c =================================================================== --- gcc/ada/gcc-interface/cuintp.c (revision 209754) +++ gcc/ada/gcc-interface/cuintp.c (working copy) @@ -160,7 +160,11 @@ UI_From_gnu (tree Input) in a signed 64-bit integer. */ if (tree_fits_shwi_p (Input)) return UI_From_Int (tree_to_shwi (Input)); - else if (wi::neg_p (Input) && TYPE_UNSIGNED (gnu_type)) + + gcc_assert (TYPE_PRECISION (gnu_type) <= 64); + if (TYPE_UNSIGNED (gnu_type) + && TYPE_PRECISION (gnu_type) == 64 + && wi::neg_p (Input, SIGNED)) return No_Uint; #endif