From ef9d764a47f797420db9413de670d2e1e140afbc Mon Sep 17 00:00:00 2001 From: Giuliano Belinassi Date: Thu, 16 Jul 2020 17:05:28 -0300 Subject: 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 * ipa-sra.c (gate): Enable when split_outputs. * lto-partition.c (merge_static_calls): Also merge inlined functions. --- gcc/ChangeLog | 5 +++++ gcc/ipa-sra.c | 3 +-- gcc/lto-partition.c | 11 +++++------ 3 files changed, 11 insertions(+), 8 deletions(-) (limited to 'gcc') 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 + + * ipa-sra.c (gate): Enable when split_outputs. + * lto-partition.c (merge_static_calls): Also merge inlined functions. + 2020-07-14 Giuliano Belinassi * 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; } } -- cgit v1.1