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

--- Comment #10 from Martin Jambor <jamborm at gcc dot gnu.org> ---
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));

Reply via email to