+2014-01-20 Bob Duff <duff@adacore.com>
+
+ * exp_intr.adb (Expand_Unc_Deallocation): Remove warning on abort
+ followed by free.
+
+2014-01-20 Ed Schonberg <schonberg@adacore.com>
+
+ * checks.adb (Apply_Address_Clause_Check): If there is an
+ alignment check on the expression in an address clause, and there
+ is no local exception propagation, add an additional explanatory
+ message to clarify the cause of previous warning.
+
2014-01-20 Robert Dewar <dewar@adacore.com>
* exp_ch7.adb: Minor reformatting.
Right_Opnd => Make_Integer_Literal (Loc, Uint_0)),
Reason => PE_Misaligned_Address_Value));
Analyze (First (Actions (N)), Suppress => All_Checks);
+
+ -- If the address clause generates an alignment check and we are
+ -- in ZPF or some restricted run-time, add a warning to explain
+ -- the propagation warning that is generated by the check.
+
+ if Nkind (First (Actions (N))) = N_Raise_Program_Error
+ and then not Warnings_Off (E)
+ and then Restriction_Active (No_Exception_Propagation)
+ then
+ Error_Msg_N ("address value may be incompatible with " &
+ "alignment of object?", N);
+ end if;
return;
end if;
with Checks; use Checks;
with Einfo; use Einfo;
with Elists; use Elists;
-with Errout; use Errout;
with Exp_Atag; use Exp_Atag;
with Exp_Ch4; use Exp_Ch4;
with Exp_Ch7; use Exp_Ch7;
-- For a task type, call Free_Task before freeing the ATCB
if Is_Task_Type (Desig_T) then
- declare
- Stat : Node_Id := Prev (N);
- Nam1 : Node_Id;
- Nam2 : Node_Id;
-
- begin
- -- An Abort followed by a Free will not do what the user expects,
- -- because the abort is not immediate. This is worth a warning.
-
- while Present (Stat)
- and then not Comes_From_Source (Original_Node (Stat))
- loop
- Prev (Stat);
- end loop;
-
- if Present (Stat)
- and then Nkind (Original_Node (Stat)) = N_Abort_Statement
- then
- Stat := Original_Node (Stat);
- Nam1 := First (Names (Stat));
- Nam2 := Original_Node (First (Parameter_Associations (N)));
-
- if Nkind (Nam1) = N_Explicit_Dereference
- and then Is_Entity_Name (Prefix (Nam1))
- and then Is_Entity_Name (Nam2)
- and then Entity (Prefix (Nam1)) = Entity (Nam2)
- then
- Error_Msg_N ("abort may take time to complete??", N);
- Error_Msg_N ("\deallocation might have no effect??", N);
- Error_Msg_N ("\safer to wait for termination??", N);
- end if;
- end if;
- end;
+ -- We used to detect the case of Abort followed by a Free here,
+ -- because the Free wouldn't actually free if it happens before the
+ -- aborted task actually terminates. The warning is removed, because
+ -- Free now works properly (the task will be freed once it
+ -- terminates).
Append_To
(Stmts, Cleanup_Task (N, Duplicate_Subexpr_No_Checks (Arg)));