This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ipa/82027] [7/8 Regression] wrong code with -O3 -flto
- From: "jamborm at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 21 Dec 2017 13:06:31 +0000
- Subject: [Bug ipa/82027] [7/8 Regression] wrong code with -O3 -flto
- Auto-submitted: auto-generated
- References: <bug-82027-4@http.gcc.gnu.org/bugzilla/>
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));