aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa.c
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2019-11-25 11:13:08 +0100
committerMartin Jambor <jamborm@gcc.gnu.org>2019-11-25 11:13:08 +0100
commitd0b1b67aabc2b88b58a7485f79d16f9a6d4dd11c (patch)
tree7c3f46c77d2d21811420a8a0cdaf253c8089c76b /gcc/ipa.c
parented649cda944c2ff0b77f0203bf83f106e930c5e8 (diff)
downloadgcc-d0b1b67aabc2b88b58a7485f79d16f9a6d4dd11c.zip
gcc-d0b1b67aabc2b88b58a7485f79d16f9a6d4dd11c.tar.gz
gcc-d0b1b67aabc2b88b58a7485f79d16f9a6d4dd11c.tar.bz2
ipa: Prevent materialization of clones with removed bodies (PR 92109)
2019-11-25 Martin Jambor <mjambor@suse.cz> PR ipa/92109 * cgraph.h (cgraph_node::remove_from_clone_tree): Declare. * cgraphclones.c (cgraph_node::remove_from_clone_tree): New method. (cgraph_materialize_clone): Move removel from clone tree to the the new method and use it instead. * ipa.c (symbol_table::remove_unreachable_nodes): When removing bodies of clones, also remove it from the clone tree. From-SVN: r278670
Diffstat (limited to 'gcc/ipa.c')
-rw-r--r--gcc/ipa.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/ipa.c b/gcc/ipa.c
index 0c92980..2404024 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -520,9 +520,14 @@ symbol_table::remove_unreachable_nodes (FILE *file)
reliably. */
if (node->alias || node->thunk.thunk_p)
;
- else if (!body_needed_for_clonning.contains (node->decl)
- && !node->alias && !node->thunk.thunk_p)
- node->release_body ();
+ else if (!body_needed_for_clonning.contains (node->decl))
+ {
+ /* Make the node a non-clone so that we do not attempt to
+ materialize it later. */
+ if (node->clone_of)
+ node->remove_from_clone_tree ();
+ node->release_body ();
+ }
else if (!node->clone_of)
gcc_assert (in_lto_p || DECL_RESULT (node->decl));
if (node->definition && !node->alias && !node->thunk.thunk_p)