diff mbox series

[Ada] Do not unconditionally inline expression functions with -gnatd.8

Message ID 20211005082703.GA2693964@adacore.com
State New
Headers show
Series [Ada] Do not unconditionally inline expression functions with -gnatd.8 | expand

Commit Message

Pierre-Marie de Rodat Oct. 5, 2021, 8:27 a.m. UTC
This is necessary when expression functions are really too large.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* gcc-interface/trans.c (Subprogram_Body_to_gnu): Do not set the
	DECL_DISREGARD_INLINE_LIMITS flag if -gnatd.8 is specified.
diff mbox series

Patch

diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -3893,7 +3893,7 @@  Subprogram_Body_to_gnu (Node_Id gnat_node)
 
   /* If the body comes from an expression function, arrange it to be inlined
      in almost all cases.  */
-  if (Was_Expression_Function (gnat_node))
+  if (Was_Expression_Function (gnat_node) && !Debug_Flag_Dot_8)
     DECL_DISREGARD_INLINE_LIMITS (gnu_subprog_decl) = 1;
 
   /* Try to create a bona-fide thunk and hand it over to the middle-end.  */