diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-10-05 14:33:42 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-10-05 14:33:42 +0000 |
commit | 5ce38deba63dd6f31d5d0f6172577972ea7e6206 (patch) | |
tree | 63d33d37f9d31cee9648383a7f181f1d6bffa4ea /gcc/ada | |
parent | 9ea61fdd44ba2ed39acf4aade8064b425451b4e5 (diff) | |
download | ppe42-gcc-5ce38deba63dd6f31d5d0f6172577972ea7e6206.tar.gz ppe42-gcc-5ce38deba63dd6f31d5d0f6172577972ea7e6206.zip |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192130 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/ChangeLog | 17 | ||||
-rw-r--r-- | gcc/ada/exp_util.adb | 21 | ||||
-rw-r--r-- | gcc/ada/sem_ch7.adb | 4 | ||||
-rw-r--r-- | gcc/ada/sem_prag.adb | 7 |
4 files changed, 45 insertions, 4 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index ea4667fb2ce..1a9ff91cf3f 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,20 @@ +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 diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index 82b054adfce..cc3213d03da 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -2166,6 +2166,7 @@ package body Exp_Util is (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; @@ -2204,6 +2205,7 @@ package body Exp_Util is 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; @@ -2213,7 +2215,7 @@ package body Exp_Util is -- 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 @@ -2224,6 +2226,23 @@ package body Exp_Util is 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; diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb index 103aa5b2bdd..a25e3283338 100644 --- a/gcc/ada/sem_ch7.adb +++ b/gcc/ada/sem_ch7.adb @@ -1390,11 +1390,13 @@ package body Sem_Ch7 is 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; diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 1739673bf06..2c9d518f670 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -12130,6 +12130,11 @@ package body Sem_Prag is 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; @@ -12145,8 +12150,6 @@ package body Sem_Prag is Arg1); end if; - Check_Duplicate_Pragma (Ent); - Prag := Make_Linker_Section_Pragma (Ent, Sloc (N), ".persistent.bss"); |