diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2017-12-14 17:13:03 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2017-12-14 17:13:03 +0000 |
commit | 9de2192154a3d5ec055b535aa143a927fcc2c2ee (patch) | |
tree | 7fc95bfc6d53bef0dd47c3785657c8096a0bcb78 | |
parent | 9df60a5d915668f6b25fae0b76996e6bfd79e38c (diff) | |
download | gcc-9de2192154a3d5ec055b535aa143a927fcc2c2ee.zip gcc-9de2192154a3d5ec055b535aa143a927fcc2c2ee.tar.gz gcc-9de2192154a3d5ec055b535aa143a927fcc2c2ee.tar.bz2 |
trans.c (Call_to_gnu): Set DECL_DISREGARD_INLINE_LIMITS to 0 on the callee if the call is recursive.
* gcc-interface/trans.c (Call_to_gnu): Set DECL_DISREGARD_INLINE_LIMITS
to 0 on the callee if the call is recursive.
From-SVN: r255648
-rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/trans.c | 14 |
2 files changed, 15 insertions, 4 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index c87f4a2..350ac1f 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,10 @@ 2017-12-14 Eric Botcazou <ebotcazou@adacore.com> + * gcc-interface/trans.c (Call_to_gnu): Set DECL_DISREGARD_INLINE_LIMITS + to 0 on the callee if the call is recursive. + +2017-12-14 Eric Botcazou <ebotcazou@adacore.com> + * gcc-interface/decl.c (gnat_to_gnu_field): Do not set the alignment of the enclosing record type if it is not already set. diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index cae156f..55638a1 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -4306,10 +4306,16 @@ Call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target, return call_expr; } - /* For a call to a nested function, check the inlining status. */ - if (TREE_CODE (gnu_subprog) == FUNCTION_DECL - && decl_function_context (gnu_subprog)) - check_inlining_for_nested_subprog (gnu_subprog); + if (TREE_CODE (gnu_subprog) == FUNCTION_DECL) + { + /* For a call to a nested function, check the inlining status. */ + if (decl_function_context (gnu_subprog)) + check_inlining_for_nested_subprog (gnu_subprog); + + /* For a recursive call, avoid explosion due to recursive inlining. */ + if (gnu_subprog == current_function_decl) + DECL_DISREGARD_INLINE_LIMITS (gnu_subprog) = 0; + } /* The only way we can be making a call via an access type is if Name is an explicit dereference. In that case, get the list of formal args from the |