[Ada] Small adjustment to parameterization of System.Value_R

Pierre-Marie de Rodat derodat@adacore.com
Tue Dec 15 11:42:41 GMT 2020


This changes Precision_Limit from being computed based on the unsigned
type to being explicitly specified in the instantiation, and restores
its value to the precision of the mantissa for floating-pointt types.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* doc/gnat_ugn/gnat_and_program_execution.rst: Minor fix.
	* gnat_ugn.texi: Regenerate.
	* libgnat/s-valuer.ads (Precision_Limit): New formal parameter.
	* libgnat/s-valuer.adb (Precision_Limit): Remove.
	(Scan_Decimal_Digits): Robustify overflow check.
	(Scan_Integral_Digits): Likewise.
	* libgnat/s-valrea.adb: Add assertion on the size of the unsigned
	type and instantiate System.Value_R with the mantissa limit.
	(Integer_to_Real): Add Extra parameter and take it into account.
	(Scan_Real): Pass Extra to Integer_to_Real.
	(Value_Real): Likewise.
	* libgnat/s-valued.adb: Add assertion on the size of the unsigned
	type and instantiate System.Value_R with the mantissa limit.
	* libgnat/s-valuef.adb: Likewise.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 9332 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20201215/2af4f038/attachment-0001.bin>


More information about the Gcc-patches mailing list