+2012-10-05 Robert Dewar <dewar@adacore.com>
+
+ * sem_ch7.adb: Minor reformatting.
+
+2012-10-05 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_prag.adb (Analyze_Pragma, case Persistent_BSS): check for
+ a duplicate pragma before Rep_Item_Too_Late to prevent spurious
+ messages about duplicate pragmas.
+
+2012-10-05 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_util.adb (Find_Init_Call): If the successor of the
+ object declaration is a block, check whether it contains the
+ initialization call, because it may have been created by actuals
+ that use the secondary stack.
+
2012-10-05 Thomas Quinot <quinot@adacore.com>
* sem_dim.adb, errout.adb, errout.ads (Analyze_Dimension_Call): Add
(Var : Entity_Id;
Rep_Clause : Node_Id) return Node_Id
is
+ Par : constant Node_Id := Parent (Var);
Typ : constant Entity_Id := Etype (Var);
Init_Proc : Entity_Id;
begin
if not Has_Non_Null_Base_Init_Proc (Typ) then
+
-- No init proc for the type, so obviously no call to be found
return Empty;
-- First scan the list containing the declaration of Var
- Init_Call := Find_Init_Call_In_List (From => Next (Parent (Var)));
+ Init_Call := Find_Init_Call_In_List (From => Next (Par));
-- If not found, also look on Var's freeze actions list, if any, since
-- the init call may have been moved there (case of an address clause
Find_Init_Call_In_List (First (Actions (Freeze_Node (Var))));
end if;
+ -- If the initialization call has actuals that use the secondary stack,
+ -- the call may have been wrapped into a temporary block, in which case
+ -- the block itself has to be removed.
+
+ if No (Init_Call) and then Nkind (Next (Par)) = N_Block_Statement then
+ declare
+ Blk : constant Node_Id := Next (Par);
+ begin
+ if Present
+ (Find_Init_Call_In_List
+ (First (Statements (Handled_Statement_Sequence (Blk)))))
+ then
+ Init_Call := Blk;
+ end if;
+ end;
+ end if;
+
return Init_Call;
end Find_Init_Call;
then
declare
ASN : Node_Id;
+
begin
ASN := First (Aspect_Specifications (Parent (E)));
while Present (ASN) loop
if Chars (Identifier (ASN)) = Name_Invariant
- or else Chars (Identifier (ASN)) = Name_Type_Invariant
+ or else
+ Chars (Identifier (ASN)) = Name_Type_Invariant
then
Build_Invariant_Procedure (E, N);
exit;
Ent := Entity (Get_Pragma_Arg (Arg1));
Decl := Parent (Ent);
+ -- Check for duplication before inserting in list of
+ -- representation items.
+
+ Check_Duplicate_Pragma (Ent);
+
if Rep_Item_Too_Late (Ent, N) then
return;
end if;
Arg1);
end if;
- Check_Duplicate_Pragma (Ent);
-
Prag :=
Make_Linker_Section_Pragma
(Ent, Sloc (N), ".persistent.bss");