[Ada] Fix bogus error on conversion from Float to 128-bit unsigned
Pierre-Marie de Rodat
derodat@adacore.com
Thu Oct 22 12:12:12 GMT 2020
The compiler confuses itself because it generates a range check in Float
whose upper bound is 2 ** 128, but this number is larger than the largest
number representable in Float so it triggers an error when converted to
Float as part of the check.
The fix is to saturate the upper bound of the check to that of Float.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* checks.adb (Apply_Float_Conversion_Check): Saturate the bounds
of the check to those of the base type of the expression.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 1175 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20201022/1ddd7cf3/attachment-0001.bin>
More information about the Gcc-patches
mailing list