This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR84229 part 1: Avoid cloning of functions that calls va_arg_pack
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 21 Feb 2018 20:13:08 +0100
- Subject: Re: PR84229 part 1: Avoid cloning of functions that calls va_arg_pack
- Authentication-results: sourceware.org; auth=none
- References: <20180221190928.GA23794@kam.mff.cuni.cz>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Feb 21, 2018 at 08:09:28PM +0100, Jan Hubicka wrote:
> --- ipa-cp.c (revision 257844)
> +++ ipa-cp.c (working copy)
> @@ -630,6 +630,24 @@ determine_versionability (struct cgraph_
> reason = "calls comdat-local function";
> }
>
> + /* Functions calling BUILT_IN_VA_ARG_PACK and BUILT_IN_VA_ARG_PACK_LEN
> + works only when inlined. Cloning them may still lead to better code
s/works/work/
> + becuase ipa-cp will not give up on cloning further. If the function is
s/becuase/because/
> + external this however leads to wrong code becuase we may end up producing
s/becuase/because/
> + offline copy of the function. */
> + if (DECL_EXTERNAL (node->decl))
> + for (cgraph_edge *edge = node->callees; !reason && edge;
> + edge = edge->next_callee)
> + if (DECL_BUILT_IN (edge->callee->decl)
> + && DECL_BUILT_IN_CLASS (edge->callee->decl) == BUILT_IN_NORMAL)
> + {
> + if (DECL_FUNCTION_CODE (edge->callee->decl) == BUILT_IN_VA_ARG_PACK)
> + reason = "external function which calls va_arg_pack";
> + if (DECL_FUNCTION_CODE (edge->callee->decl)
> + == BUILT_IN_VA_ARG_PACK_LEN)
> + reason = "external function which calls va_arg_pack_len";
> + }
> +
> if (reason && dump_file && !node->alias && !node->thunk.thunk_p)
> fprintf (dump_file, "Function %s is not versionable, reason: %s.\n",
> node->dump_name (), reason);
Do you have a testcase for this, or is it LTO with too large input?
Jakub