aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuliano Belinassi <giuliano.belinassi@usp.br>2020-07-16 17:05:28 -0300
committerGiuliano Belinassi <giuliano.belinassi@usp.br>2020-07-16 17:05:28 -0300
commitef9d764a47f797420db9413de670d2e1e140afbc (patch)
treeea8032be6423ff2f3e484dcf23974474f8d4592c
parentb917f6bf4192a0e910de6752ad0e95fbba309e2f (diff)
downloadgcc-ef9d764a47f797420db9413de670d2e1e140afbc.zip
gcc-ef9d764a47f797420db9413de670d2e1e140afbc.tar.gz
gcc-ef9d764a47f797420db9413de670d2e1e140afbc.tar.bz2
Fix bootstrap when promote_statics is disabled
Previously, a bug caused by not merging inlined functions to the same partition to its caller made the partitioner to incorrectly add a static function to the wrong partition. This commit fixes this by simple merging these function to the same partition. gcc/ChangeLog: 2020-07-16 Giuliano Belinassi <giuliano.belinassi@usp.br> * ipa-sra.c (gate): Enable when split_outputs. * lto-partition.c (merge_static_calls): Also merge inlined functions.
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/ipa-sra.c3
-rw-r--r--gcc/lto-partition.c11
3 files changed, 11 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9019521..80e57b0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2020-07-16 Giuliano Belinassi <giuliano.belinassi@usp.br>
+
+ * ipa-sra.c (gate): Enable when split_outputs.
+ * lto-partition.c (merge_static_calls): Also merge inlined functions.
+
2020-07-14 Giuliano Belinassi <giuliano.belinassi@usp.br>
* symtab.c (find_by_order): New function.
diff --git a/gcc/ipa-sra.c b/gcc/ipa-sra.c
index 8ee027d..7c922e4 100644
--- a/gcc/ipa-sra.c
+++ b/gcc/ipa-sra.c
@@ -4089,8 +4089,7 @@ public:
{
/* TODO: We should remove the optimize check after we ensure we never run
IPA passes when not optimizing. */
- /* FIXME: Fix this optimization when split_outputs is enabled. */
- return (flag_ipa_sra && optimize && !split_outputs);
+ return (flag_ipa_sra && optimize);
}
virtual unsigned int execute (function *) { return ipa_sra_analysis (); }
diff --git a/gcc/lto-partition.c b/gcc/lto-partition.c
index c3b4ef6..a52fe8d 100644
--- a/gcc/lto-partition.c
+++ b/gcc/lto-partition.c
@@ -995,12 +995,11 @@ merge_static_calls (symtab_node *node, int set)
{
for (cgraph_edge *e = cnode->callers; e; e = e->next_caller)
{
- if (e->inline_failed)
- {
- ds->unite (node->aux2, e->caller->aux2);
- merge_static_calls (e->caller, set);
- ret = true;
- }
+ /* FIXME: In theory, inlined functions should be a criteria to not
+ merge partitions. */
+ ds->unite (node->aux2, e->caller->aux2);
+ merge_static_calls (e->caller, set);
+ ret = true;
}
}