https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119852

--- Comment #1 from Jan Hubicka <hubicka at ucw dot cz> ---
> the generated file contains entries:
> 
> Callgraph
> clone;for_each_rtx_1.isra.0;1;/home/mjambor/gcc/trunk/src/gcc/testsuite/gcc.dg/ipa/pr58106.c;28;1;for_each_rtx_1.isra.0;1;/home/mjambor/gcc/trunk/src/gcc/testsuite/gcc.dg/ipa/pr58106.c;28;1;(null)
> Callgraph
> clone;for_each_rtx_1.constprop.0.isra.0;1;/home/mjambor/gcc/trunk/src/gcc/testsuite/gcc.dg/ipa/pr58106.c;28;1;for_each_rtx_1.constprop.0.isra.0;1;/home/mjambor/gcc/trunk/src/gcc/testsuite/gcc.dg/ipa/pr58106.c;28;1;(null)
> 
> These are apparently results of the following snippet from function
> recursive_inlining in ipa-inline.c:
> 
>   /* We need original clone to copy around.  */
>   master_clone = node->create_clone (node->decl, node->count,
>     false, vNULL, true, NULL, NULL);

Indeed, this is a temporary clone created so we can inline it into
function itself.

It seems useless to dump info on clones that was never output to final
code (i.e. later found dead or fully inlined?)
> 
> I guess in this case we should simply not output any record of the
> clone used for copying stuff.  However there is one more invocation of
> create_clone with both parameters new_inlined_to and suffix set to
> NULL which could lead to the same result in function input_node in
> lto-cgraph.cc:
> 
>   clone_ref = streamer_read_hwi (ib);
>   bool has_thunk_info;
> 
>   fn_decl = lto_input_fn_decl_ref (ib, file_data);
> 
>   if (clone_ref != LCC_NOT_FOUND)
>     {
>       node = dyn_cast<cgraph_node *> (nodes[clone_ref])->create_clone 
> (fn_decl,
>         profile_count::uninitialized (), false,
>         vNULL, false, NULL, NULL);
>     }

This is used when we stream in clones at ltrans time.  Here I think we
already output the info and are safe....
> 
> Because of -fdump-ipa-clones, I'd also argue that the suffix parameter
> of create_clone should not default to NULL too.

Making it explicit NULL is OK.

Reply via email to