diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2021-06-03 12:39:39 +0200 |
---|---|---|
committer | Eric Botcazou <ebotcazou@adacore.com> | 2021-06-03 12:41:20 +0200 |
commit | ad085ef5fb4142df2027f81ea03992fdafc6e2f6 (patch) | |
tree | e3336dfa6e2789dde2b9838cc9a61b0888114192 /gcc/tree-inline.c | |
parent | 602463fb98740efa3570198a323eed92e2e09319 (diff) | |
download | gcc-ad085ef5fb4142df2027f81ea03992fdafc6e2f6.zip gcc-ad085ef5fb4142df2027f81ea03992fdafc6e2f6.tar.gz gcc-ad085ef5fb4142df2027f81ea03992fdafc6e2f6.tar.bz2 |
Tame fix for PR ipa/99122
The return part has a major performance impact in Ada where variable-sized
types are first-class citizens, but it turns out that it is not exercized
in the testsuite yet, so back it out for now.
gcc/
PR ipa/99122
* tree-inline.c (inline_forbidden_p): Remove test on return type.
gcc/testsuite/
* gnat.dg/inline22.adb: New test.
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r-- | gcc/tree-inline.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 5396131..05d1a25 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -4025,17 +4025,10 @@ inline_forbidden_p (tree fndecl) wi.info = (void *) fndecl; wi.pset = &visited_nodes; - /* We cannot inline a function with a VLA typed argument or result since - we have no implementation materializing a variable of such type in - the caller. */ - if (COMPLETE_TYPE_P (TREE_TYPE (TREE_TYPE (fndecl))) - && !poly_int_tree_p (TYPE_SIZE (TREE_TYPE (TREE_TYPE (fndecl))))) - { - inline_forbidden_reason - = G_("function %q+F can never be inlined because " - "it has a VLA return argument"); - return true; - } + /* We cannot inline a function with a variable-sized parameter because we + cannot materialize a temporary of such a type in the caller if need be. + Note that the return case is not symmetrical because we can guarantee + that a temporary is not needed by means of CALL_EXPR_RETURN_SLOT_OPT. */ for (tree parm = DECL_ARGUMENTS (fndecl); parm; parm = DECL_CHAIN (parm)) if (!poly_int_tree_p (DECL_SIZE (parm))) { |