diff options
author | Ed Schonberg <schonberg@adacore.com> | 2018-05-29 09:42:05 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2018-05-29 09:42:05 +0000 |
commit | ef22a3b26940b059888ea409a53f5a91af44887d (patch) | |
tree | 05d1f19e7f5eb43fc4f1ec7e06934cd79cc17617 /gcc/tree-cfg.c | |
parent | 54e33e5f6a0f566e6b0e96da3d5f27449d807248 (diff) | |
download | gcc-ef22a3b26940b059888ea409a53f5a91af44887d.zip gcc-ef22a3b26940b059888ea409a53f5a91af44887d.tar.gz gcc-ef22a3b26940b059888ea409a53f5a91af44887d.tar.bz2 |
[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.
From-SVN: r260882
Diffstat (limited to 'gcc/tree-cfg.c')
0 files changed, 0 insertions, 0 deletions