aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-07-16 16:01:46 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2014-07-16 16:01:46 +0200
commit6cade1b0a0c3b50e1c1d60357a948f29de016ed5 (patch)
treea0f511d53c196978cd381722eee72529fc5dc536
parente59243faa1bfc9f5a84779ef20c4cb5a5046ffbe (diff)
downloadgcc-6cade1b0a0c3b50e1c1d60357a948f29de016ed5.zip
gcc-6cade1b0a0c3b50e1c1d60357a948f29de016ed5.tar.gz
gcc-6cade1b0a0c3b50e1c1d60357a948f29de016ed5.tar.bz2
[multiple changes]
2014-07-16 Yannick Moy <moy@adacore.com> * sem_attr.adb (Analyze_Attribute/cases Pred and Succ): Always enable range check on fixed-point types if not suppressed for the type. 2014-07-16 Hristian Kirtchev <kirtchev@adacore.com> * sem_util.adb (State_Has_Enabled_Property): Account for an external property denoted by an others choice. From-SVN: r212647
-rw-r--r--gcc/ada/ChangeLog11
-rw-r--r--gcc/ada/sem_attr.adb10
-rw-r--r--gcc/ada/sem_util.adb9
3 files changed, 25 insertions, 5 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index ab74e4e..e5f0504 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,14 @@
+2014-07-16 Yannick Moy <moy@adacore.com>
+
+ * sem_attr.adb (Analyze_Attribute/cases Pred
+ and Succ): Always enable range check on fixed-point types if
+ not suppressed for the type.
+
+2014-07-16 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * sem_util.adb (State_Has_Enabled_Property):
+ Account for an external property denoted by an others choice.
+
2014-07-16 Hristian Kirtchev <kirtchev@adacore.com>
* exp_ch4.ads, exp_ch4.adb (Find_Hook_Context): Relocated to Exp_Util.
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index 5e5d0d7..bf3c3c7 100644
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -4843,9 +4843,10 @@ package body Sem_Attr is
Resolve (E1, P_Base_Type);
Set_Etype (N, P_Base_Type);
- -- For real types, enable range check in Check_Overflow_Mode only
+ -- For floating-point types, enable range check in
+ -- Check_Float_Overflow mode only.
- if Is_Real_Type (P_Type) then
+ if Is_Floating_Point_Type (P_Type) then
if Check_Float_Overflow
and then not Range_Checks_Suppressed (P_Base_Type)
then
@@ -5750,9 +5751,10 @@ package body Sem_Attr is
Resolve (E1, P_Base_Type);
Set_Etype (N, P_Base_Type);
- -- For real types, enable range check in Check_Overflow_Mode only
+ -- For floating-point types, enable range check in
+ -- Check_Float_Overflow mode only.
- if Is_Real_Type (P_Type) then
+ if Is_Floating_Point_Type (P_Type) then
if Check_Float_Overflow
and then not Range_Checks_Suppressed (P_Base_Type)
then
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 624687e..7bc8232 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -7430,7 +7430,14 @@ package body Sem_Util is
while Present (Prop) loop
Prop_Nam := First (Choices (Prop));
- if Chars (Prop_Nam) = Property then
+ -- The property can be represented in two ways:
+ -- others => <value>
+ -- <property> => <value>
+
+ if Nkind (Prop_Nam) = N_Others_Choice
+ or else (Nkind (Prop_Nam) = N_Identifier
+ and then Chars (Prop_Nam) = Property)
+ then
return Is_True (Expr_Value (Expression (Prop)));
end if;