summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2014-02-24 15:09:40 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2014-02-24 15:09:40 +0000
commit630b6d55e2c3e15945a7ea39d14a9672d2e3f08c (patch)
treed45dd7dade3c3d765f7a03a223fc0c16d070f786
parent2da355155a16445440cdd9ffedd55dd9c5771eb8 (diff)
downloadgcc-630b6d55e2c3e15945a7ea39d14a9672d2e3f08c.tar.gz
2014-02-24 Yannick Moy <moy@adacore.com>
* freeze.adb (Freeze_Entity): Do not issue warning for pre/post being ignored on imported subprogram in GNATprove mode. 2014-02-24 Robert Dewar <dewar@adacore.com> * exp_ch5.adb, sem_ch5.adb, sem_type.adb, sem_res.adb, sem_attr.adb, stand.ads, sem_eval.adb: Minor reformatting. 2014-02-24 Yannick Moy <moy@adacore.com> * sem_prag.adb: Minor rewording in error message. 2014-02-24 Johannes Kanig <kanig@adacore.com> * exp_util.adb (Expand_Subtype_From_Expr): Do not expand subtypes in GNATprove_mode, gnat2why doesn't need nor use these types. 2014-02-24 Gary Dismukes <dismukes@adacore.com> * exp_ch4.adb (Expand_N_Op_Expon): On the AAMP target, in the case of signed integer exponentiation that uses a run-time routine, always select the Exp_* versions, since overflow checking is automatically done by AAMP arithmetic instructions. 2014-02-24 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch13.adb (Analyze_Aspect_Specifications): When the related context is a package instace, insert pragma Abstract_State after all internally-generated renamings related to the instance "header". 2014-02-24 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Analyze_Declarations): Analyze Contract of abstract subprograms. * sem_disp.adb (Check_Dispatching_Context): A non-dispatching call to an abstract subprogram is legal if it appears in a pre/postcondition of another abstract operation. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208070 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/ChangeLog42
-rw-r--r--gcc/ada/exp_ch4.adb12
-rw-r--r--gcc/ada/exp_ch5.adb102
-rw-r--r--gcc/ada/exp_util.adb14
-rw-r--r--gcc/ada/freeze.adb10
-rw-r--r--gcc/ada/sem_attr.adb2
-rw-r--r--gcc/ada/sem_ch13.adb57
-rw-r--r--gcc/ada/sem_ch3.adb5
-rw-r--r--gcc/ada/sem_ch5.adb18
-rw-r--r--gcc/ada/sem_disp.adb10
-rw-r--r--gcc/ada/sem_eval.adb6
-rw-r--r--gcc/ada/sem_prag.adb3
-rw-r--r--gcc/ada/sem_res.adb1
-rw-r--r--gcc/ada/sem_type.adb2
-rw-r--r--gcc/ada/stand.ads5
15 files changed, 203 insertions, 86 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 3a936730bea..76cae9f02f4 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,45 @@
+2014-02-24 Yannick Moy <moy@adacore.com>
+
+ * freeze.adb (Freeze_Entity): Do not issue warning
+ for pre/post being ignored on imported subprogram in GNATprove
+ mode.
+
+2014-02-24 Robert Dewar <dewar@adacore.com>
+
+ * exp_ch5.adb, sem_ch5.adb, sem_type.adb, sem_res.adb, sem_attr.adb,
+ stand.ads, sem_eval.adb: Minor reformatting.
+
+2014-02-24 Yannick Moy <moy@adacore.com>
+
+ * sem_prag.adb: Minor rewording in error message.
+
+2014-02-24 Johannes Kanig <kanig@adacore.com>
+
+ * exp_util.adb (Expand_Subtype_From_Expr): Do not expand subtypes in
+ GNATprove_mode, gnat2why doesn't need nor use these types.
+
+2014-02-24 Gary Dismukes <dismukes@adacore.com>
+
+ * exp_ch4.adb (Expand_N_Op_Expon): On the AAMP
+ target, in the case of signed integer exponentiation that uses a
+ run-time routine, always select the Exp_* versions, since overflow
+ checking is automatically done by AAMP arithmetic instructions.
+
+2014-02-24 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * sem_ch13.adb (Analyze_Aspect_Specifications):
+ When the related context is a package instace, insert pragma
+ Abstract_State after all internally-generated renamings related
+ to the instance "header".
+
+2014-02-24 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch3.adb (Analyze_Declarations): Analyze Contract of abstract
+ subprograms.
+ * sem_disp.adb (Check_Dispatching_Context): A non-dispatching
+ call to an abstract subprogram is legal if it appears in a
+ pre/postcondition of another abstract operation.
+
2014-02-24 Sergey Rybin <rybin@adacore.com frybin>
* gnat_ugn.texi: Misc updates.
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index 36c12acd206..b11506ff9a6 100644
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -7611,7 +7611,11 @@ package body Exp_Ch4 is
then
Etyp := Standard_Long_Long_Integer;
- if Ovflo then
+ -- Overflow checking is the only choice on the AAMP target, where
+ -- arithmetic instructions check overflow automatically, so only
+ -- one version of the exponentiation unit is needed.
+
+ if Ovflo or else AAMP_On_Target then
Rent := RE_Exp_Long_Long_Integer;
else
Rent := RE_Exn_Long_Long_Integer;
@@ -7620,7 +7624,11 @@ package body Exp_Ch4 is
elsif Is_Signed_Integer_Type (Rtyp) then
Etyp := Standard_Integer;
- if Ovflo then
+ -- Overflow checking is the only choice on the AAMP target, where
+ -- arithmetic instructions check overflow automatically, so only
+ -- one version of the exponentiation unit is needed.
+
+ if Ovflo or else AAMP_On_Target then
Rent := RE_Exp_Integer;
else
Rent := RE_Exn_Integer;
diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb
index df1f3f2d384..5398cd2c437 100644
--- a/gcc/ada/exp_ch5.adb
+++ b/gcc/ada/exp_ch5.adb
@@ -153,39 +153,38 @@ package body Exp_Ch5 is
is
Loc : constant Source_Ptr := Sloc (N);
Stats : constant List_Id := Statements (N);
-
- Typ : constant Entity_Id := Base_Type (Etype (Container));
- First_Op : constant Entity_Id :=
+ Typ : constant Entity_Id := Base_Type (Etype (Container));
+ First_Op : constant Entity_Id :=
Get_Iterable_Type_Primitive (Typ, Name_First);
- Next_Op : constant Entity_Id :=
+ Next_Op : constant Entity_Id :=
Get_Iterable_Type_Primitive (Typ, Name_Next);
+
Has_Element_Op : constant Entity_Id :=
Get_Iterable_Type_Primitive (Typ, Name_Has_Element);
begin
-- Declaration for Cursor
Init :=
- Make_Object_Declaration (Loc,
- Defining_Identifier => Cursor,
- Object_Definition => New_Occurrence_Of (Etype (First_Op), Loc),
- Expression =>
- Make_Function_Call (Loc,
- Name => New_Occurrence_Of (First_Op, Loc),
- Parameter_Associations =>
- New_List (New_Occurrence_Of (Container, Loc))));
+ Make_Object_Declaration (Loc,
+ Defining_Identifier => Cursor,
+ Object_Definition => New_Occurrence_Of (Etype (First_Op), Loc),
+ Expression =>
+ Make_Function_Call (Loc,
+ Name => New_Occurrence_Of (First_Op, Loc),
+ Parameter_Associations => New_List (
+ New_Occurrence_Of (Container, Loc))));
-- Statement that advances cursor in loop
Advance :=
Make_Assignment_Statement (Loc,
- Name => New_Occurrence_Of (Cursor, Loc),
+ Name => New_Occurrence_Of (Cursor, Loc),
Expression =>
Make_Function_Call (Loc,
- Name => New_Occurrence_Of (Next_Op, Loc),
- Parameter_Associations =>
- New_List
- (New_Occurrence_Of (Container, Loc),
- New_Occurrence_Of (Cursor, Loc))));
+ Name => New_Occurrence_Of (Next_Op, Loc),
+ Parameter_Associations => New_List (
+ New_Occurrence_Of (Container, Loc),
+ New_Occurrence_Of (Cursor, Loc))));
-- Iterator is rewritten as a while_loop
@@ -195,14 +194,12 @@ package body Exp_Ch5 is
Make_Iteration_Scheme (Loc,
Condition =>
Make_Function_Call (Loc,
- Name =>
- New_Occurrence_Of (Has_Element_Op, Loc),
- Parameter_Associations =>
- New_List
- (New_Occurrence_Of (Container, Loc),
- New_Occurrence_Of (Cursor, Loc)))),
- Statements => Stats,
- End_Label => Empty);
+ Name => New_Occurrence_Of (Has_Element_Op, Loc),
+ Parameter_Associations => New_List (
+ New_Occurrence_Of (Container, Loc),
+ New_Occurrence_Of (Cursor, Loc)))),
+ Statements => Stats,
+ End_Label => Empty);
end Build_Formal_Container_Iteration;
------------------------------
@@ -2748,9 +2745,9 @@ package body Exp_Ch5 is
Container : constant Node_Id := Entity (Name (I_Spec));
Stats : constant List_Id := Statements (N);
- Advance : Node_Id;
- Init : Node_Id;
- New_Loop : Node_Id;
+ Advance : Node_Id;
+ Init : Node_Id;
+ New_Loop : Node_Id;
begin
-- The expansion resembles the one for Ada containers, but the
@@ -2790,13 +2787,12 @@ package body Exp_Ch5 is
Cursor : constant Entity_Id :=
Make_Defining_Identifier (Loc,
- Chars => New_External_Name (Chars (Element), 'C'));
+ Chars => New_External_Name (Chars (Element), 'C'));
Elmt_Decl : Node_Id;
Elmt_Ref : Node_Id;
- Element_Op : constant Entity_Id :=
- Get_Iterable_Type_Primitive
- (Container_Typ, Name_Element);
+ Element_Op : constant Entity_Id :=
+ Get_Iterable_Type_Primitive (Container_Typ, Name_Element);
Advance : Node_Id;
Init : Node_Id;
@@ -2822,9 +2818,10 @@ package body Exp_Ch5 is
-- Declaration for Element.
- Elmt_Decl := Make_Object_Declaration (Loc,
- Defining_Identifier => Element,
- Object_Definition => New_Occurrence_Of (Etype (Element_Op), Loc));
+ Elmt_Decl :=
+ Make_Object_Declaration (Loc,
+ Defining_Identifier => Element,
+ Object_Definition => New_Occurrence_Of (Etype (Element_Op), Loc));
-- The element is only modified in expanded code, so it appears as
-- unassigned to the warning machinery. We must suppress this spurious
@@ -2832,27 +2829,27 @@ package body Exp_Ch5 is
Set_Warnings_Off (Element);
- Elmt_Ref := Make_Assignment_Statement (Loc,
- Name => New_Occurrence_Of (Element, Loc),
- Expression =>
- Make_Function_Call (Loc,
- Name => New_Occurrence_Of (Element_Op, Loc),
- Parameter_Associations =>
- New_List
- (New_Occurrence_Of (Container, Loc),
- New_Occurrence_Of (Cursor, Loc))));
+ Elmt_Ref :=
+ Make_Assignment_Statement (Loc,
+ Name => New_Occurrence_Of (Element, Loc),
+ Expression =>
+ Make_Function_Call (Loc,
+ Name => New_Occurrence_Of (Element_Op, Loc),
+ Parameter_Associations => New_List (
+ New_Occurrence_Of (Container, Loc),
+ New_Occurrence_Of (Cursor, Loc))));
Prepend (Elmt_Ref, Stats);
Append_To (Stats, Advance);
- -- The loop is rewritten as a block, to hold the declaration for the
- -- element.
+ -- The loop is rewritten as a block, to hold the element declaration
- New_Loop := Make_Block_Statement (Loc,
- Declarations => New_List (Elmt_Decl),
- Handled_Statement_Sequence =>
- Make_Handled_Sequence_Of_Statements (Loc,
- Statements => New_List (New_Loop)));
+ New_Loop :=
+ Make_Block_Statement (Loc,
+ Declarations => New_List (Elmt_Decl),
+ Handled_Statement_Sequence =>
+ Make_Handled_Sequence_Of_Statements (Loc,
+ Statements => New_List (New_Loop)));
Rewrite (N, New_Loop);
Analyze (New_Loop);
@@ -3180,6 +3177,7 @@ package body Exp_Ch5 is
else
Expand_Formal_Container_Loop (N);
end if;
+
return;
end if;
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index ddbc98ffdf6..1ce77c6cd71 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -2074,19 +2074,15 @@ package body Exp_Util is
-- may be constants that depend on the bounds of a string literal, both
-- standard string types and more generally arrays of characters.
- -- In GNATprove mode, we also need the more precise subtype to be set
+ -- In GNATprove mode, these extra subtypes are not needed
- if not (Expander_Active or GNATprove_Mode)
- and then (No (Etype (Exp)) or else not Is_String_Type (Etype (Exp)))
- then
+ if GNATprove_Mode then
return;
end if;
- -- In GNATprove mode, Unc_Type might not be complete when analyzing
- -- a generic unit. As generic units are not analyzed directly in
- -- GNATprove, return here rather than failing later.
-
- if GNATprove_Mode and then No (Underlying_Type (Unc_Type)) then
+ if not Expander_Active
+ and then (No (Etype (Exp)) or else not Is_String_Type (Etype (Exp)))
+ then
return;
end if;
diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb
index d6da132cb46..f4baae01bf5 100644
--- a/gcc/ada/freeze.adb
+++ b/gcc/ada/freeze.adb
@@ -3868,9 +3868,12 @@ package body Freeze is
end if;
end;
- -- Pre/post conditions are implemented through a subprogram in
- -- the corresponding body, and therefore are not checked on an
- -- imported subprogram for which the body is not available.
+ -- Pre/post conditions are implemented through a subprogram
+ -- in the corresponding body, and therefore are not checked on
+ -- an imported subprogram for which the body is not available.
+ -- This warning is not issued in GNATprove mode, as these
+ -- contracts are handled in formal verification, so the
+ -- warning would be misleading in that case.
-- Could consider generating a wrapper to take care of this???
@@ -3878,6 +3881,7 @@ package body Freeze is
and then Is_Imported (E)
and then Present (Contract (E))
and then Present (Pre_Post_Conditions (Contract (E)))
+ and then not GNATprove_Mode
then
Error_Msg_NE
("pre/post conditions on imported subprogram are not "
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index 9146dc68e25..f45fe2acba8 100644
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -6319,7 +6319,7 @@ package body Sem_Attr is
elsif Comp_Type /= Base_Type (Etype (Comp)) then
Error_Msg_N
("components in choice list must have same type",
- Assoc);
+ Assoc);
end if;
end if;
end if;
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index c8f9579d3d0..57abf9a4707 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -2009,6 +2009,7 @@ package body Sem_Ch13 is
when Aspect_Abstract_State => Abstract_State : declare
Context : Node_Id := N;
+ Decl : Node_Id;
Decls : List_Id;
begin
@@ -2023,8 +2024,6 @@ package body Sem_Ch13 is
if Nkind_In (Context, N_Generic_Package_Declaration,
N_Package_Declaration)
then
- Decls := Visible_Declarations (Specification (Context));
-
Make_Aitem_Pragma
(Pragma_Argument_Associations => New_List (
Make_Pragma_Argument_Association (Loc,
@@ -2032,12 +2031,56 @@ package body Sem_Ch13 is
Pragma_Name => Name_Abstract_State);
Decorate_Aspect_And_Pragma (Aspect, Aitem);
- if No (Decls) then
- Decls := New_List;
- Set_Visible_Declarations (Context, Decls);
- end if;
+ Decls := Visible_Declarations (Specification (Context));
- Prepend_To (Decls, Aitem);
+ -- In general pragma Abstract_State must be at the top
+ -- of the existing visible declarations to emulate its
+ -- source counterpart. The only exception to this is a
+ -- generic instance in which case the pragma must be
+ -- inserted after the association renamings.
+
+ if Present (Decls) then
+
+ -- The visible declarations of a generic instance have
+ -- the following structure:
+
+ -- <renamings of generic formals>
+ -- <renamings of internally-generated spec and body>
+ -- <first source declaration>
+
+ -- The pragma must be inserted before the first source
+ -- declaration.
+
+ if Is_Generic_Instance (Defining_Entity (Context)) then
+
+ -- Skip the instance "header"
+
+ Decl := First (Decls);
+ while Present (Decl)
+ and then not Comes_From_Source (Decl)
+ loop
+ Decl := Next (Decl);
+ end loop;
+
+ if Present (Decl) then
+ Insert_Before (Decl, Aitem);
+ else
+ Append_To (Decls, Aitem);
+ end if;
+
+ -- The related package is not a generic instance, the
+ -- corresponding pragma must be the first declaration.
+
+ else
+ Prepend_To (Decls, Aitem);
+ end if;
+
+ -- Otherwise the pragma forms a new declarative list
+
+ else
+ Set_Visible_Declarations
+ (Specification (Context), New_List (Aitem));
+ end if;
else
Error_Msg_NE
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index fc5c4f2140a..2c7f7e07669 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -2381,7 +2381,10 @@ package body Sem_Ch3 is
elsif Nkind (Decl) = N_Subprogram_Body then
Analyze_Subprogram_Body_Contract (Defining_Entity (Decl));
- elsif Nkind (Decl) = N_Subprogram_Declaration then
+ elsif Nkind_In (Decl,
+ N_Subprogram_Declaration,
+ N_Abstract_Subprogram_Declaration)
+ then
Analyze_Subprogram_Contract (Defining_Entity (Decl));
end if;
diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb
index e03525e560a..031ec24e6e0 100644
--- a/gcc/ada/sem_ch5.adb
+++ b/gcc/ada/sem_ch5.adb
@@ -1856,10 +1856,12 @@ package body Sem_Ch5 is
else
Set_Ekind (Def_Id, E_Loop_Parameter);
+ -- OF present
+
if Of_Present (N) then
if Has_Aspect (Typ, Aspect_Iterable) then
if No (Get_Iterable_Type_Primitive (Typ, Name_Element)) then
- Error_Msg_N ("Missing Element primitive for iteration", N);
+ Error_Msg_N ("missing Element primitive for iteration", N);
end if;
-- For a predefined container, The type of the loop variable is
@@ -1868,11 +1870,13 @@ package body Sem_Ch5 is
else
declare
Element : constant Entity_Id :=
- Find_Value_Of_Aspect (Typ, Aspect_Iterator_Element);
+ Find_Value_Of_Aspect (Typ, Aspect_Iterator_Element);
+
begin
if No (Element) then
Error_Msg_NE ("cannot iterate over&", N, Typ);
return;
+
else
Set_Etype (Def_Id, Entity (Element));
@@ -1880,11 +1884,11 @@ package body Sem_Ch5 is
-- matches element type of container.
if Present (Subt)
- and then Bas /= Base_Type (Etype (Def_Id))
+ and then Bas /= Base_Type (Etype (Def_Id))
then
Error_Msg_N
("subtype indication does not match element type",
- Subt);
+ Subt);
end if;
-- If the container has a variable indexing aspect, the
@@ -1897,6 +1901,8 @@ package body Sem_Ch5 is
end;
end if;
+ -- OF not present
+
else
-- For an iteration of the form IN, the name must denote an
-- iterator, typically the result of a call to Iterate. Give a
@@ -1936,7 +1942,8 @@ package body Sem_Ch5 is
if Has_Aspect (Typ, Aspect_Iterable) then
Set_Etype (Def_Id,
Get_Cursor_Type
- (Parent (Find_Value_Of_Aspect (Typ, Aspect_Iterable)), Typ));
+ (Parent (Find_Value_Of_Aspect (Typ, Aspect_Iterable)),
+ Typ));
Ent := Etype (Def_Id);
else
@@ -1955,6 +1962,7 @@ package body Sem_Ch5 is
-- A loop parameter cannot be volatile. This check is peformed only when
-- SPARK_Mode is on as it is not a standard Ada legality check.
+
-- Not clear whether this applies to element iterators, where the
-- cursor is not an explicit entity ???
diff --git a/gcc/ada/sem_disp.adb b/gcc/ada/sem_disp.adb
index 53aefc9ecbf..b7647829c95 100644
--- a/gcc/ada/sem_disp.adb
+++ b/gcc/ada/sem_disp.adb
@@ -544,11 +544,17 @@ package body Sem_Disp is
-- the current declarative part. The expression will be properly
-- rewritten/reanalyzed when the postcondition procedure is built.
+ -- Similarly, if this is a pre/postcondition for an abstract
+ -- subprogram, it may call another abstract function which is
+ -- a primitive of an abstract type. The call is non-dispatching
+ -- but will be legal in overridings of the operation.
+
elsif In_Spec_Expression
and then Is_Subprogram (Current_Scope)
and then
- Nkind (Parent (Current_Scope)) = N_Procedure_Specification
- and then Null_Present (Parent (Current_Scope))
+ ((Nkind (Parent (Current_Scope)) = N_Procedure_Specification
+ and then Null_Present (Parent (Current_Scope)))
+ or else Is_Abstract_Subprogram (Current_Scope))
then
null;
diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb
index e8c85f9a50d..bd1398aee51 100644
--- a/gcc/ada/sem_eval.adb
+++ b/gcc/ada/sem_eval.adb
@@ -4803,7 +4803,8 @@ package body Sem_Eval is
-- If either subtype is nonstatic then they're not compatible
elsif not Is_Static_Subtype (T1)
- or else not Is_Static_Subtype (T2)
+ or else
+ not Is_Static_Subtype (T2)
then
return False;
@@ -4899,7 +4900,8 @@ package body Sem_Eval is
-- (and Esizes can be set when Frontend_Layout_On_Target is True).
elsif not Formal_Derived_Matching
- and then Known_Static_Esize (T1) and then Known_Static_Esize (T2)
+ and then Known_Static_Esize (T1)
+ and then Known_Static_Esize (T2)
and then Esize (T1) /= Esize (T2)
then
return False;
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 113678301a0..28e917264ce 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -4631,7 +4631,8 @@ package body Sem_Prag is
procedure Grouping_Error (Prag : Node_Id) is
begin
Error_Msg_Sloc := Sloc (Prag);
- Error_Pragma ("pragma% must appear immediately after pragma#");
+ Error_Pragma
+ ("pragma% should appear immediately after pragma#");
end Grouping_Error;
-- Start of processing for Check_Loop_Pragma_Grouping
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index 99801627711..93edfe2df22 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -7399,6 +7399,7 @@ package body Sem_Res is
-- A useful optimization: check whether the dereference denotes an
-- element of a container, and if so rewrite it as a call to the
-- corresponding Element function.
+
-- Disabled for now, on advice of ARG. A more restricted form of the
-- predicate might be acceptable ???
diff --git a/gcc/ada/sem_type.adb b/gcc/ada/sem_type.adb
index 446c9f4203e..22d10e6f551 100644
--- a/gcc/ada/sem_type.adb
+++ b/gcc/ada/sem_type.adb
@@ -1128,7 +1128,7 @@ package body Sem_Type is
elsif BT2 = Any_Type then
return True;
- -- A Raise_Expressions is legal in any expression context.
+ -- A Raise_Expressions is legal in any expression context
elsif BT2 = Raise_Type then
return True;
diff --git a/gcc/ada/stand.ads b/gcc/ada/stand.ads
index 1d9c33dff68..325286e36c2 100644
--- a/gcc/ada/stand.ads
+++ b/gcc/ada/stand.ads
@@ -423,6 +423,11 @@ package Stand is
-- The type Raise_Type denotes the type of a Raise_Expression. It is
-- compatible with all other types, and must eventually resolve to a
-- concrete type that is imposed by the context.
+ --
+ -- Historical note: we used to use Any_Type for this purpose, but the
+ -- confusion of meanings (Any_Type normally indicates an error) caused
+ -- difficulties. In particular some needed expansions were skipped since
+ -- the nodes in question looked like they had an error.
Universal_Integer : Entity_Id;
-- Entity for universal integer type. The bounds of this type correspond