From: Arnaud Charlet Date: Tue, 20 Oct 2015 12:32:21 +0000 (+0200) Subject: [multiple changes] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=744c73a51853327efa19b0abe14b208511d071f1;p=gcc.git [multiple changes] 2015-10-20 Ed Schonberg * 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 * 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 * exp_ch4.adb: Minor reformatting. From-SVN: r229072 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 93dae231192..1c51c9feb63 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,22 @@ +2015-10-20 Ed Schonberg + + * 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 + + * 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 + + * exp_ch4.adb: Minor reformatting. + 2015-10-20 Bob Duff * s-mudido-affinity.adb (Create): Correct subranges of slices of CPU diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index 0e789f2734e..9d4dff8d1ff 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -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); diff --git a/gcc/ada/sem_ch11.adb b/gcc/ada/sem_ch11.adb index 86285ee018b..0b9f8ef829d 100644 --- a/gcc/ada/sem_ch11.adb +++ b/gcc/ada/sem_ch11.adb @@ -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; diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 75c1f3bd8a0..d3003643f64 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -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