+2019-02-26 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR ada/81956
+ Backport from mainline
+ 2017-09-06 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_ch6.adb (Expand_Call_Helper): Do not optimize calls to
+ null procedures when GNAT coverage is used, so that their (empty)
+ bodies are properly covered.
+
+ 2017-09-06 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_ch6.adb (Expand_Call_Helper): Replace call to null
+ procedure by a single null statement, after evaluating the
+ actuals that require it.
+
2019-02-23 Eric Botcazou <ebotcazou@adacore.com>
PR ada/89349
Unchecked_Convert_To
(RTE (RE_Address), Relocate_Node (First_Actual (Call_Node))));
return;
+
+ -- A call to a null procedure is replaced by a null statement, but we
+ -- are not allowed to ignore possible side effects of the call, so we
+ -- make sure that actuals are evaluated.
+ -- We also suppress this optimization for GNATCoverage.
+
+ elsif Is_Null_Procedure (Subp)
+ and then not Opt.Suppress_Control_Flow_Optimizations
+ then
+ Actual := First_Actual (Call_Node);
+ while Present (Actual) loop
+ Remove_Side_Effects (Actual);
+ Next_Actual (Actual);
+ end loop;
+
+ Rewrite (Call_Node, Make_Null_Statement (Loc));
+ return;
end if;
-- Handle inlining. No action needed if the subprogram is not inlined