This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Another AIX Bootstrap failure


> Honza,
> 
> FYI, your bootstrap on gcc111 is hung in the exact same place as I
> have observed: all of the stage2 gen* programs spinning.

Yes (will kill it now), I was tracking down what change it is.
It is actually the inliner hunk that is independent of rest of changes
(and one that should be obviously safe, as famous last words):

Index: ipa-inline-analysis.c
===================================================================
--- ipa-inline-analysis.c	(revision 211488)
+++ ipa-inline-analysis.c	(working copy)
@@ -3877,7 +3877,7 @@ do_estimate_growth (struct cgraph_node *
       /* COMDAT functions are very often not shared across multiple units
          since they come from various template instantiations.
          Take this into account.  */
-      else if (DECL_COMDAT (node->decl)
+      else if (node->externally_visible && node->get_comdat_group ()
 	       && cgraph_can_remove_if_no_direct_calls_p (node))
 	d.growth -= (info->size
 		     * (100 - PARAM_VALUE (PARAM_COMDAT_SHARING_PROBABILITY))
@@ -3928,7 +3928,7 @@ growth_likely_positive (struct cgraph_no
       && (ret = node_growth_cache[node->uid]))
     return ret > 0;
   if (!cgraph_will_be_removed_from_program_if_no_direct_calls (node)
-      && (!DECL_COMDAT (node->decl)
+      && (!node->externally_visible || !node->get_comdat_group ()
 	  || !cgraph_can_remove_if_no_direct_calls_p (node)))
     return true;
   max_callers = inline_summary (node)->size * 4 / edge_growth + 2;

This hunk promotes more inlining of COMDAT functions in anticipation that
if they get inlined in each module independently, they will be optimized out
and that in C++ high percentage of comdat functions is actually used by
one unit only.

The change disables this heuristic tweek for targets without comdat support,
like AIX is. Here we do not want to compute probability of section sharing, 
becuase there are no comdat sections (and if there is other mechanism, we should
let middle-end know). The main motviation was however COMDAT locals on ELF
(introduced by cdtor decloning) where we want to handle them as statics
rather than COMDATs.

No mater of what these functions return, the final program should be correct-
they only affect inlining decisions, not correctness of the inliner.  We ought
to debug this.  Do you have any clue what goes wrong?

If you don't mind, I would like to commit back the rest of changes (reset_section)
cleanups after testing on AIX + testing the aforementioned ARM testcase. 

I will also make more AIX firendly version of this patch. But please, lets debug
the problem, so we don't have random wrong code issues here. 
Honza


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]