[multiple changes]

2015-10-20  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch11.adb (Analyze_Handled_Statements): If the scope is a
	postcondition subprogram, do not check for useless assignments
	because there are no source references in such a body, and the
	call will lose deferred references from the enclosing subprogram.

2015-10-20  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch13.adb: nalyze_Attribute_Definition_Clause, case
	'Address):  If either object is controlled the overlay is
	erroneous, but analysis must be completed so that back-end sees
	address clause and completes code generation.  Improve text
	of warning.

2015-10-20  Thomas Quinot  <quinot@adacore.com>

	* exp_ch4.adb: Minor reformatting.

From-SVN: r229072
This commit is contained in:
Arnaud Charlet 2015-10-20 14:32:21 +02:00
parent 9fe696a3b3
commit 744c73a518
4 changed files with 32 additions and 6 deletions

View File

@ -1,3 +1,22 @@
2015-10-20 Ed Schonberg <schonberg@adacore.com>
* sem_ch11.adb (Analyze_Handled_Statements): If the scope is a
postcondition subprogram, do not check for useless assignments
because there are no source references in such a body, and the
call will lose deferred references from the enclosing subprogram.
2015-10-20 Ed Schonberg <schonberg@adacore.com>
* sem_ch13.adb: nalyze_Attribute_Definition_Clause, case
'Address): If either object is controlled the overlay is
erroneous, but analysis must be completed so that back-end sees
address clause and completes code generation. Improve text
of warning.
2015-10-20 Thomas Quinot <quinot@adacore.com>
* exp_ch4.adb: Minor reformatting.
2015-10-20 Bob Duff <duff@adacore.com>
* s-mudido-affinity.adb (Create): Correct subranges of slices of CPU

View File

@ -1536,7 +1536,7 @@ package body Exp_Ch4 is
if RTE_Available (Comp) then
-- Expand to a call only if the runtime function is available,
-- otherwise fallback to inline code.
-- otherwise fall back to inline code.
Remove_Side_Effects (Op1, Name_Req => True);
Remove_Side_Effects (Op2, Name_Req => True);

View File

@ -46,6 +46,7 @@ with Sem_Res; use Sem_Res;
with Sem_Util; use Sem_Util;
with Sem_Warn; use Sem_Warn;
with Sinfo; use Sinfo;
with Snames; use Snames;
with Stand; use Stand;
package body Sem_Ch11 is
@ -417,9 +418,13 @@ package body Sem_Ch11 is
-- If the current scope is a subprogram, then this is the right place to
-- check for hanging useless assignments from the statement sequence of
-- the subprogram body.
-- the subprogram body. Skip this in the body of a postcondition,
-- since in that case there are no source references, and we need to
-- preserve deferred references from the enclosing scope.
if Is_Subprogram (Current_Scope) then
if Is_Subprogram (Current_Scope)
and then Chars (Current_Scope) /= Name_uPostconditions
then
Warn_On_Useless_Assignments (Current_Scope);
end if;

View File

@ -4711,20 +4711,22 @@ package body Sem_Ch13 is
Find_Overlaid_Entity (N, O_Ent, Off);
-- Overlaying controlled objects is erroneous
-- Overlaying controlled objects is erroneous.
-- Emit warning but continue analysis because program is
-- itself legal, and back-end must see address clause.
if Present (O_Ent)
and then (Has_Controlled_Component (Etype (O_Ent))
or else Is_Controlled (Etype (O_Ent)))
and then not Inside_A_Generic
then
Error_Msg_N
("??cannot overlay with controlled object", Expr);
("??cannot use overlays with controlled objects", Expr);
Error_Msg_N
("\??Program_Error will be raised at run time", Expr);
Insert_Action (Declaration_Node (U_Ent),
Make_Raise_Program_Error (Loc,
Reason => PE_Overlaid_Controlled_Object));
return;
elsif Present (O_Ent)
and then Ekind (U_Ent) = E_Constant