diff options
author | Jan Hubicka <jh@suse.cz> | 2021-03-31 20:10:31 +0200 |
---|---|---|
committer | Jan Hubicka <jh@suse.cz> | 2021-03-31 20:10:31 +0200 |
commit | 23ce9945d5efa77c96161443f68e03664705ada3 (patch) | |
tree | c5ad360fd11d1f43cb1ef87edbeacf2df1b79ccb /gcc | |
parent | 31199d95de1304e200554bbf98b2d8a6a7298bec (diff) | |
download | gcc-23ce9945d5efa77c96161443f68e03664705ada3.zip gcc-23ce9945d5efa77c96161443f68e03664705ada3.tar.gz gcc-23ce9945d5efa77c96161443f68e03664705ada3.tar.bz2 |
Fix overvactive check in cgraph_node::release_body
gcc/ChangeLog:
PR lto/99447
* cgraph.c (cgraph_node::release_body): Fix overactive check.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cgraph.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c index b77c676..d7c78d5 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -1860,7 +1860,15 @@ cgraph_node::release_body (bool keep_arguments) lto_free_function_in_decl_state_for_node (this); lto_file_data = NULL; } - gcc_assert (!clones); + if (flag_checking && clones) + { + /* It is invalid to release body before materializing clones except + for thunks that don't really need a body. Verify also that we do + not leak pointers to the call statements. */ + for (cgraph_node *node = clones; node; + node = node->next_sibling_clone) + gcc_assert (node->thunk && !node->callees->call_stmt); + } remove_callees (); remove_all_references (); } |