Commit 24f0ba72 authored by charlet's avatar charlet
Browse files

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.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183420 138bc75d-0d04-0410-961f-82ee72b054a4
parent 362e5ece
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
......
......@@ -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.
......
......@@ -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))
......
......@@ -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 (
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment