summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-02-03 16:57:20 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-02-03 16:57:20 +0000
commit57e20c4ab4619b93eb94d20d06464ae8c6eacd41 (patch)
tree408b784036755534b78b84759445181515b9be75
parentb817769e5ea6a4e838071881e785967c8c00037e (diff)
downloadgcc-57e20c4ab4619b93eb94d20d06464ae8c6eacd41.tar.gz
* ipa-inline-analysis.c (simple_edge_hints): Fix check for
cross-module inlining. * cgraph.h (cgraph_node): Add flag merged. * ipa-icf.c (sem_function::merge): Maintain it. * lto-symtab.c (lto_cgraph_replace_node): Maintain merged flag. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220372 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/cgraph.h2
-rw-r--r--gcc/ipa-icf.c12
-rw-r--r--gcc/ipa-inline-analysis.c9
-rw-r--r--gcc/lto/ChangeLog4
-rw-r--r--gcc/lto/lto-symtab.c2
6 files changed, 33 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9552d334c5c..b5dcf0cf51b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2015-02-03 Jan Hubicka <hubicka@ucw.cz>
+
+ * ipa-inline-analysis.c (simple_edge_hints): Fix check for
+ cross-module inlining.
+ * cgraph.h (cgraph_node): Add flag merged.
+ * ipa-icf.c (sem_function::merge): Maintain it.
+
2015-02-03 Richard Sandiford <richard.sandiford@arm.com>
* config/arm/arm.c (thumb2_reorg): Test UNARY_P and BINARY_P
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index 40e6c6c767c..0fdb459ab00 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -1296,6 +1296,8 @@ public:
other operation that could make previously non-trapping memory
accesses trapping. */
unsigned nonfreeing_fn : 1;
+ /* True if there was multiple COMDAT bodies merged by lto-symtab. */
+ unsigned merged : 1;
};
/* A cgraph node set is a collection of cgraph nodes. A cgraph node
diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c
index 9b2d117b973..cf5e5d92968 100644
--- a/gcc/ipa-icf.c
+++ b/gcc/ipa-icf.c
@@ -711,6 +711,10 @@ sem_function::merge (sem_item *alias_item)
}
alias->icf_merged = true;
+ if (local_original->lto_file_data
+ && alias->lto_file_data
+ && local_original->lto_file_data != alias->lto_file_data)
+ local_original->merged = true;
/* The alias function is removed if symbol address
does not matter. */
@@ -725,6 +729,10 @@ sem_function::merge (sem_item *alias_item)
else if (create_alias)
{
alias->icf_merged = true;
+ if (local_original->lto_file_data
+ && alias->lto_file_data
+ && local_original->lto_file_data != alias->lto_file_data)
+ local_original->merged = true;
/* Remove the function's body. */
ipa_merge_profiles (original, alias);
@@ -762,6 +770,10 @@ sem_function::merge (sem_item *alias_item)
}
alias->icf_merged = true;
+ if (local_original->lto_file_data
+ && alias->lto_file_data
+ && local_original->lto_file_data != alias->lto_file_data)
+ local_original->merged = true;
ipa_merge_profiles (local_original, alias, true);
alias->create_wrapper (local_original);
diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c
index ffa559c0c5f..a628a9e987d 100644
--- a/gcc/ipa-inline-analysis.c
+++ b/gcc/ipa-inline-analysis.c
@@ -3702,13 +3702,16 @@ simple_edge_hints (struct cgraph_edge *edge)
int hints = 0;
struct cgraph_node *to = (edge->caller->global.inlined_to
? edge->caller->global.inlined_to : edge->caller);
+ struct cgraph_node *callee = edge->callee->ultimate_alias_target ();
if (inline_summaries->get (to)->scc_no
- && inline_summaries->get (to)->scc_no == inline_summaries->get (edge->callee)->scc_no
+ && inline_summaries->get (to)->scc_no
+ == inline_summaries->get (callee)->scc_no
&& !edge->recursive_p ())
hints |= INLINE_HINT_same_scc;
- if (to->lto_file_data && edge->callee->lto_file_data
- && to->lto_file_data != edge->callee->lto_file_data)
+ if (callee->lto_file_data && edge->caller->lto_file_data
+ && edge->caller->lto_file_data != callee->lto_file_data
+ && !callee->merged)
hints |= INLINE_HINT_cross_module;
return hints;
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index c77e6ccae40..87f1988ac0b 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,7 @@
+2015-02-03 Jan Hubicka <hubicka@ucw.cz>
+
+ * lto-symtab.c (lto_cgraph_replace_node): Maintain merged flag.
+
2015-01-30 Joseph Myers <joseph@codesourcery.com>
* lto-object.c, lto-symtab.c, lto.c: All callers of fatal_error
diff --git a/gcc/lto/lto-symtab.c b/gcc/lto/lto-symtab.c
index 39c9257edc0..c00fd87483a 100644
--- a/gcc/lto/lto-symtab.c
+++ b/gcc/lto/lto-symtab.c
@@ -88,6 +88,8 @@ lto_cgraph_replace_node (struct cgraph_node *node,
gcc_assert (!prevailing_node->global.inlined_to);
prevailing_node->mark_address_taken ();
}
+ if (node->definition && prevailing_node->definition)
+ prevailing_node->merged = true;
/* Redirect all incoming edges. */
compatible_p