diff options
author | Jan Hubicka <jh@suse.cz> | 2020-03-20 22:06:24 +0100 |
---|---|---|
committer | Jan Hubicka <jh@suse.cz> | 2020-03-20 22:06:24 +0100 |
commit | 72b3bc895f023bf451357659cfe96c966945bdf9 (patch) | |
tree | b50df34185a414a85416a84b69ca390fa091d954 /gcc/symtab.c | |
parent | a89349e664ff420f33612d47e486954de5848e49 (diff) | |
download | gcc-72b3bc895f023bf451357659cfe96c966945bdf9.zip gcc-72b3bc895f023bf451357659cfe96c966945bdf9.tar.gz gcc-72b3bc895f023bf451357659cfe96c966945bdf9.tar.bz2 |
Fix verifier ICE on wrong comdat local flag [PR93347]
gcc/ChangeLog:
2020-03-20 Jan Hubicka <hubicka@ucw.cz>
PR ipa/93347
* cgraph.c (symbol_table::create_edge): Update calls_comdat_local flag.
(cgraph_edge::redirect_callee): Move here; likewise.
(cgraph_node::remove_callees): Update calls_comdat_local flag.
(cgraph_node::verify_node): Verify that calls_comdat_local flag match
reality.
(cgraph_node::check_calls_comdat_local_p): New member function.
* cgraph.h (cgraph_node::check_calls_comdat_local_p): Declare.
(cgraph_edge::redirect_callee): Move offline.
* ipa-fnsummary.c (compute_fn_summary): Do not compute
calls_comdat_local flag here.
* ipa-inline-transform.c (inline_call): Fix updating of
calls_comdat_local flag.
* ipa-split.c (split_function): Use true instead of 1 to set the flag.
* symtab.c (symtab_node::add_to_same_comdat_group): Update
calls_comdat_local flag.
gcc/testsuite/ChangeLog:
2020-03-20 Jan Hubicka <hubicka@ucw.cz>
* g++.dg/torture/pr93347.C: New test.
Diffstat (limited to 'gcc/symtab.c')
-rw-r--r-- | gcc/symtab.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/symtab.c b/gcc/symtab.c index a879c09..3022acf 100644 --- a/gcc/symtab.c +++ b/gcc/symtab.c @@ -473,6 +473,17 @@ symtab_node::add_to_same_comdat_group (symtab_node *old_node) ; n->same_comdat_group = this; } + + cgraph_node *n; + if (comdat_local_p () + && (n = dyn_cast <cgraph_node *> (this)) != NULL) + { + for (cgraph_edge *e = n->callers; e; e = e->next_caller) + if (e->caller->inlined_to) + e->caller->inlined_to->calls_comdat_local = true; + else + e->caller->calls_comdat_local = true; + } } /* Dissolve the same_comdat_group list in which NODE resides. */ |