[Bug lto/82027] [7/8 Regression] wrong code with -O3 -flto

ssbssa at yahoo dot de gcc-bugzilla@gcc.gnu.org
Thu Dec 21 16:44:00 GMT 2017


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

--- Comment #11 from Domani Hannes <ssbssa at yahoo dot de> ---
(In reply to Martin Jambor from comment #10)
> OK, so I did not realize that duplicate_thunk_for_node does not set
> clone_of but former_clone of, which is of course what it must do.  I
> have checked and this is the only place where we currently set
> former_clone_of in WPA, and therefore I am testing the following fix:
> 
> diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
> index a19f8a13dfb..ed3df15b143 100644
> --- a/gcc/lto-cgraph.c
> +++ b/gcc/lto-cgraph.c
> @@ -1958,7 +1958,7 @@ input_offload_tables (bool do_force_output)
>  static int
>  output_cgraph_opt_summary_p (struct cgraph_node *node)
>  {
> -  return (node->clone_of
> +  return ((node->clone_of || node->former_clone_of)
>           && (node->clone.tree_map
>               || node->clone.args_to_skip
>               || node->clone.combined_args_to_skip));

I can confirm that this fixes the crash in my original (non-reduced)
application.


More information about the Gcc-bugs mailing list