Hi,
cgraph_decide_recursive_inlining may decide to divide by 0 when profile is read
but it is small enough, so even count of 0 is considered as possibly hot.  This
particularly happens when profile was not really read after all.

The problem is fixed on mainline differently. This patch just obviously plugs
the symptom.

Bootstrapped/regtested x86_64-linux, comitted.

Index: ChangeLog
===================================================================
--- ChangeLog   (revision 174182)
+++ ChangeLog   (working copy)
@@ -1,3 +1,9 @@
+2011-05-18  Jan Hubicka  <j...@suse.cz>
+
+       PR tree-optimization/44897 
+       * ipa-inline.c (cgraph_decide_recursive_inlining): Do not divide
+       by zero for insane profiles.
+
 2011-05-24  Eric Botcazou  <ebotca...@adacore.com>
 
        * config/sparc/sparc.c (sparc_option_override): If not set by the user,
Index: ipa-inline.c
===================================================================
--- ipa-inline.c        (revision 173893)
+++ ipa-inline.c        (working copy)
@@ -895,7 +895,7 @@ cgraph_decide_recursive_inlining (struct
          continue;
        }
 
-      if (max_count)
+      if (max_count && node->count)
        {
           if (!cgraph_maybe_hot_edge_p (curr))
            {

Reply via email to