Commit 78cac738 by Javier Miranda Committed by Pierre-Marie de Rodat

exp_util.adb (Remove_Side_Effects): No action done for functions returning…

exp_util.adb (Remove_Side_Effects): No action done for functions returning class-wide types since it requires...

2018-01-11  Javier Miranda  <miranda@adacore.com>

gcc/ada/

	* exp_util.adb (Remove_Side_Effects): No action done for functions
	returning class-wide types since it requires generating code using
	'reference and the CCG target has no secondary stack.
	* gnat1drv.adb: Disable building static dispatch tables when generating
	C code.

From-SVN: r256503
parent 210fef2d
2018-01-11 Javier Miranda <miranda@adacore.com>
* exp_util.adb (Remove_Side_Effects): No action done for functions
returning class-wide types since it requires generating code using
'reference and the CCG target has no secondary stack.
* gnat1drv.adb: Disable building static dispatch tables when generating
C code.
2018-01-11 Piotr Trojanek <trojanek@adacore.com>
* libgnat/a-direio.ads, libgnat/a-sequio.ads, libgnat/a-ststio.ads,
......
......@@ -11174,6 +11174,16 @@ package body Exp_Util is
and then Side_Effect_Free (Exp, Name_Req, Variable_Ref)
then
return;
-- Generating C code we cannot remove side effect of function returning
-- class-wide types since there is no secondary stack (required to use
-- 'reference).
elsif Modify_Tree_For_C
and then Nkind (Exp) = N_Function_Call
and then Is_Class_Wide_Type (Etype (Exp))
then
return;
end if;
-- The remaining processing is done with all checks suppressed
......
......@@ -166,6 +166,7 @@ procedure Gnat1drv is
if Generate_C_Code then
Modify_Tree_For_C := True;
Unnest_Subprogram_Mode := True;
Building_Static_Dispatch_Tables := False;
Minimize_Expression_With_Actions := True;
Expand_Nonbinary_Modular_Ops := True;
......
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