summaryrefslogtreecommitdiff
path: root/gcc/ipa-icf.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-12-04 18:02:26 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-12-04 18:02:26 +0000
commit7d38b7bc167046181fc8c3ce42d4a00db04e1c1d (patch)
tree1f9f6f9c155b3d1c4819fc258a6fabfc90f13049 /gcc/ipa-icf.c
parent99e82b02af9f161d5c291da873583e7398050b6a (diff)
downloadgcc-7d38b7bc167046181fc8c3ce42d4a00db04e1c1d.tar.gz
* ipa-inline.c (can_inline_edge_p) Use merged_comdat.
* cgraphclones.c (cgraph_node::create_clone): Use merged_comdat. * cgraph.c (cgraph_node::dump): Dump merged_comdat. * ipa-icf.c (sem_function::merge): Drop merged_comdat when merging comdat and non-comdat. * cgraph.h (cgraph_node): Rename merged to merged_comdat. * ipa-inline-analysis.c (simple_edge_hints): Check both merged_comdat and icf_merged. * lto-symtab.c (lto_cgraph_replace_node): Update code computing merged_comdat. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231291 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-icf.c')
-rw-r--r--gcc/ipa-icf.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c
index 0c76672a2c6..18039ef7afd 100644
--- a/gcc/ipa-icf.c
+++ b/gcc/ipa-icf.c
@@ -1352,10 +1352,15 @@ sem_function::merge (sem_item *alias_item)
gcc_assert (alias->icf_merged || remove || redirect_callers);
original->icf_merged = true;
- /* Inform the inliner about cross-module merging. */
- if ((original->lto_file_data || alias->lto_file_data)
- && original->lto_file_data != alias->lto_file_data)
- local_original->merged = original->merged = true;
+ /* We use merged flag to track cases where COMDAT function is known to be
+ compatible its callers. If we merged in non-COMDAT, we need to give up
+ on this optimization. */
+ if (original->merged_comdat && !alias->merged_comdat)
+ {
+ if (dump_file)
+ fprintf (dump_file, "Dropping merged_comdat flag.\n\n");
+ local_original->merged_comdat = original->merged_comdat = false;
+ }
if (remove)
{