This is the mail archive of the
gcc-cvs@gcc.gnu.org
mailing list for the GCC project.
r260882 - in /trunk/gcc: ada/ChangeLog ada/libg...
- From: pmderodat at gcc dot gnu dot org
- To: gcc-cvs at gcc dot gnu dot org
- Date: Tue, 29 May 2018 09:42:05 -0000
- Subject: r260882 - in /trunk/gcc: ada/ChangeLog ada/libg...
Author: pmderodat
Date: Tue May 29 09:42:05 2018
New Revision: 260882
URL: https://gcc.gnu.org/viewcvs?rev=260882&root=gcc&view=rev
Log:
[Ada] Improper behavior of floating-point attributes
This patch fixes an error in the handling of attributes Pred qnd Succ when
applied to the limit values of a floating-point type. The RM mandates that
such operations must raise constraint_error, but GNAT generated in most cases
an infinite value, regardless of whether overflow checks were enabled.
2018-05-29 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* libgnat/s-fatgen.adb (Succ, Pred): Raise Constraint_Error
unconditionally when applied to the largest positive (resp. largest
negative) value of a floating-point type.
gcc/testsuite/
* gnat.dg/float_attributes_overflows.adb: New testcase.
Added:
trunk/gcc/testsuite/gnat.dg/float_attributes_overflows.adb
Modified:
trunk/gcc/ada/ChangeLog
trunk/gcc/ada/libgnat/s-fatgen.adb
trunk/gcc/testsuite/ChangeLog