aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-02-19 16:04:08 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2014-02-19 16:04:08 +0100
commit53f697ee80c6c9bbc0bb575d4dfcb622f3a376cb (patch)
tree15a6ce2cb1fed3ab3ec566769ede4d89b5e65f7e /gcc/ada
parent47fb6ca83f9443beb6d113c93436748d42da08da (diff)
downloadgcc-53f697ee80c6c9bbc0bb575d4dfcb622f3a376cb.zip
gcc-53f697ee80c6c9bbc0bb575d4dfcb622f3a376cb.tar.gz
gcc-53f697ee80c6c9bbc0bb575d4dfcb622f3a376cb.tar.bz2
[multiple changes]
2014-02-19 Ed Schonberg <schonberg@adacore.com> * sem_ch5.adb: Inhibit iterator rewriting in ASIS mode. 2014-02-19 Arnaud Charlet <charlet@adacore.com> * sem_ch13.adb (Analyze_Aspect_Specifications): Do not generate an error on out of range priorities if Relaxed_RM_Semantics. * sem_prag.adb (Analyze_Pragma): Ditto. 2014-02-19 Bob Duff <duff@adacore.com> * sem_attr.adb (Resolve_Attribute): Detect the case of F'Access where F denotes the renaming of an enumeration literal, and issue a specialized error message. From-SVN: r207906
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog16
-rw-r--r--gcc/ada/sem_attr.adb29
-rw-r--r--gcc/ada/sem_ch13.adb5
-rw-r--r--gcc/ada/sem_ch5.adb3
-rw-r--r--gcc/ada/sem_prag.adb18
5 files changed, 53 insertions, 18 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 09ad3ea..1fb722d 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,19 @@
+2014-02-19 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch5.adb: Inhibit iterator rewriting in ASIS mode.
+
+2014-02-19 Arnaud Charlet <charlet@adacore.com>
+
+ * sem_ch13.adb (Analyze_Aspect_Specifications): Do not generate
+ an error on out of range priorities if Relaxed_RM_Semantics.
+ * sem_prag.adb (Analyze_Pragma): Ditto.
+
+2014-02-19 Bob Duff <duff@adacore.com>
+
+ * sem_attr.adb (Resolve_Attribute): Detect the case of F'Access
+ where F denotes the renaming of an enumeration literal, and
+ issue a specialized error message.
+
2014-02-19 Matthew Heaney <heaney@adacore.com>
* a-chtgop.ads (Checked_Index): New operation.
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index 3e39d3a..7e1a15e 100644
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -9692,16 +9692,27 @@ package body Sem_Attr is
Error_Msg_F ("prefix of % attribute cannot be abstract", P);
Set_Etype (N, Any_Type);
- elsif Convention (Entity (P)) = Convention_Intrinsic then
- if Ekind (Entity (P)) = E_Enumeration_Literal then
- Error_Msg_F
- ("prefix of % attribute cannot be enumeration literal",
- P);
- else
- Error_Msg_F
- ("prefix of % attribute cannot be intrinsic", P);
- end if;
+ elsif Ekind (Entity (P)) = E_Enumeration_Literal then
+ Error_Msg_F
+ ("prefix of % attribute cannot be enumeration literal",
+ P);
+ Set_Etype (N, Any_Type);
+ -- An attempt to take 'Access of a function that renames an
+ -- enumeration literal. Issue a specialized error message.
+
+ elsif Ekind (Entity (P)) = E_Function
+ and then Present (Alias (Entity (P)))
+ and then Ekind (Alias (Entity (P))) = E_Enumeration_Literal
+ then
+ Error_Msg_F
+ ("prefix of % attribute cannot be function renaming " &
+ "an enumeration literal", P);
+ Set_Etype (N, Any_Type);
+
+ elsif Convention (Entity (P)) = Convention_Intrinsic then
+ Error_Msg_F
+ ("prefix of % attribute cannot be intrinsic", P);
Set_Etype (N, Any_Type);
end if;
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index 7e2600f..31f3396 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -1897,7 +1897,10 @@ package body Sem_Ch13 is
Set_Main_Priority
(Main_Unit, UI_To_Int (Expr_Value (Expr)));
- else
+ -- Ignore pragma if Relaxed_RM_Semantics to support
+ -- other targets/non GNAT compilers.
+
+ elsif not Relaxed_RM_Semantics then
Error_Msg_N
("main subprogram priority is out of range",
Expr);
diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb
index c66b416..bba4477 100644
--- a/gcc/ada/sem_ch5.adb
+++ b/gcc/ada/sem_ch5.adb
@@ -1727,8 +1727,11 @@ package body Sem_Ch5 is
-- Do not perform this expansion in SPARK mode, since the formal
-- verification directly deals with the source form of the iterator.
+ -- Ditto for ASIS, where the temporary amy hide the transformation
+ -- of a selected component into a prefixed function call.
and then not GNATprove_Mode
+ and then not ASIS_Mode
then
declare
Id : constant Entity_Id := Make_Temporary (Loc, 'R', Iter_Name);
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 42cb142..8e86d61 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -17871,26 +17871,28 @@ package body Sem_Prag is
elsif Raises_Constraint_Error (Arg) then
null;
- -- Otherwise check in range
+ -- Otherwise check in range except if Relaxed_RM_Semantics
+ -- where we ignore the value if out of range.
else
declare
Val : constant Uint := Expr_Value (Arg);
-
begin
- if Val < 0
- or else Val > Expr_Value (Expression
- (Parent (RTE (RE_Max_Priority))))
+ if not Relaxed_RM_Semantics
+ and then
+ (Val < 0
+ or else Val > Expr_Value (Expression
+ (Parent (RTE (RE_Max_Priority)))))
then
Error_Pragma_Arg
("main subprogram priority is out of range", Arg1);
+ else
+ Set_Main_Priority
+ (Current_Sem_Unit, UI_To_Int (Expr_Value (Arg)));
end if;
end;
end if;
- Set_Main_Priority
- (Current_Sem_Unit, UI_To_Int (Expr_Value (Arg)));
-
-- Load an arbitrary entity from System.Tasking.Stages or
-- System.Tasking.Restricted.Stages (depending on the
-- supported profile) to make sure that one of these packages