diff options
-rw-r--r-- | gcc/ada/ChangeLog | 21 | ||||
-rw-r--r-- | gcc/ada/sem_ch12.adb | 13 | ||||
-rw-r--r-- | gcc/ada/sem_ch3.adb | 10 | ||||
-rw-r--r-- | gcc/ada/sem_prag.adb | 13 |
4 files changed, 57 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 79c5b98..83947b7 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,24 @@ +2012-01-23 Robert Dewar <dewar@adacore.com> + + * sem_ch3.adb (Analyze_Object_Declaration): Properly + handle Current_Value for volatile variables (also propagate + Treat_As_Volatile from type to object). + +2012-01-23 Hristian Kirtchev <kirtchev@adacore.com> + + * sem_ch12.adb (Install_Body): Detect the case + where the enclosing context is a package with a stub body that + has already been replaced by the actual body. In such cases, + the freeze node for the enclosing context must be inserted after + the real body. + +2012-01-23 Ed Schonberg <schonberg@adacore.com> + + * sem_prag.adb (Analyze_Pragma, case Debug): Freeze the called + subprogram before expanding the pragma into an if-statement with + a block, to ensure that when the subprogram is null its body is + properly generated before expansion. + 2012-01-23 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch12.adb (Analyze_Associations): Alphabetize local variables and diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index 3624385..4976294 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -8106,6 +8106,19 @@ package body Sem_Ch12 is (Corresponding_Stub (Parent (Parent (N))), Freeze_Node (Enclosing)); + -- The enclosing context is a package with a stub body + -- which has already been replaced by the real body. + -- Insert the freeze node after the actual body. + + elsif Ekind (Enclosing) = E_Package + and then Present (Body_Entity (Enclosing)) + and then Was_Originally_Stub + (Parent (Body_Entity (Enclosing))) + then + Insert_Freeze_Node_For_Instance + (Parent (Body_Entity (Enclosing)), + Freeze_Node (Enclosing)); + -- The parent instance has been frozen before the body of -- the enclosing package, insert the freeze node after -- the body. diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 9e31930..7ad0d24 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -2993,6 +2993,8 @@ package body Sem_Ch3 is end if; end if; + -- Object is marked pure if it is in a pure scope + Set_Is_Pure (Id, Is_Pure (Current_Scope)); -- If deferred constant, make sure context is appropriate. We detect @@ -3547,6 +3549,14 @@ package body Sem_Ch3 is Set_Etype (Id, Act_T); + -- Object is marked to be treated as volatile if type is volatile and + -- we clear the Current_Value setting that may have been set above. + + if Treat_As_Volatile (Etype (Id)) then + Set_Treat_As_Volatile (Id); + Set_Current_Value (Id, Empty); + end if; + -- Deal with controlled types if Has_Controlled_Component (Etype (Id)) diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 59640de..00b27d3 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -7988,6 +7988,19 @@ package body Sem_Prag is -- use of the secondary stack does not generate execution overhead -- for suppressed conditions. + -- Normally the analysis that follows will freeze the subprogram + -- being called. However, if the call is to a null procedure, + -- we want to freeze it before creating the block, because the + -- analysis that follows may be done with expansion disabled, and + -- and the body will not be generated, leading to spurious errors. + + if Nkind (Call) = N_Procedure_Call_Statement + and then Is_Entity_Name (Name (Call)) + then + Analyze (Name (Call)); + Freeze_Before (N, Entity (Name (Call))); + end if; + Rewrite (N, Make_Implicit_If_Statement (N, Condition => Cond, Then_Statements => New_List ( |