[Ada] Ensure that Scan_Real result does not depend on trailing zeros
authorNicolas Roche <roche@adacore.com>
Wed, 18 Sep 2019 08:32:23 +0000 (08:32 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Wed, 18 Sep 2019 08:32:23 +0000 (08:32 +0000)
commitb67723ddeea0206e68f122a26b1a7b46382b79e7
tree679d3f9a2a3cd0c71e0f14cbc55318b4c748deb6
parentd2880e695410cf607d77be03908d7107e41a5271
[Ada] Ensure that Scan_Real result does not depend on trailing zeros

Previous change in that procedure to handle overflow issues during
scanning removed the special handling for trailing zeros in the decimal
part. Beside the absence of overflow during scanning the special
handling of these zeros is still necessary.

2019-09-18  Nicolas Roche  <roche@adacore.com>

gcc/ada/

* libgnat/s-valrea.adb (Scan_Integral_Digits): New procedure.
(Scan_Decimal_Digits): New procedure.
(As_Digit): New function.
(Scan_Real): Use Scan_Integral_Digits and Scan_Decimal_Digits.

gcc/testsuite/

* gnat.dg/float_value2.adb: New testcase.

From-SVN: r275849
gcc/ada/ChangeLog
gcc/ada/libgnat/s-valrea.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/float_value2.adb [new file with mode: 0644]