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
+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,
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
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;