re PR bootstrap/55051 (profiledbootstrap failed)
authorJan Hubicka <jh@suse.cz>
Wed, 14 Nov 2012 23:03:22 +0000 (00:03 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Wed, 14 Nov 2012 23:03:22 +0000 (23:03 +0000)
PR bootstrap/55051
* ipa-inline.c (edge_badness): Improve dumping; fix overflow.

From-SVN: r193512

gcc/ChangeLog
gcc/ipa-inline.c

index f520ddcc7c35666897096dca38742789b44148be..109ad262df782126ec6146862900eff32d35eb8d 100644 (file)
@@ -1,3 +1,8 @@
+2012-11-14  Jan Hubicka  <jh@suse.cz>
+
+       PR bootstrap/55051
+       * ipa-inline.c (edge_badness): Improve dumping; fix overflow.
+
 2012-11-14  Matthias Klose  <doko@ubuntu.com>
 
        * config/sparc/t-linux64: Add multiarch names in MULTILIB_OSDIRNAMES.
index 9f792ff7aa913129868ef3ead52a2e2602e31105..dd25ae339080355776f0a5b436f10891f5a5dbb3 100644 (file)
@@ -850,9 +850,11 @@ edge_badness (struct cgraph_edge *edge, bool dump)
 
   if (dump)
     {
-      fprintf (dump_file, "    Badness calculation for %s -> %s\n",
+      fprintf (dump_file, "    Badness calculation for %s/%i -> %s/%i\n",
               xstrdup (cgraph_node_name (edge->caller)),
-              xstrdup (cgraph_node_name (callee)));
+              edge->caller->uid,
+              xstrdup (cgraph_node_name (callee)),
+              edge->callee->uid);
       fprintf (dump_file, "      size growth %i, time %i ",
               growth,
               edge_time);
@@ -917,7 +919,7 @@ edge_badness (struct cgraph_edge *edge, bool dump)
     {
       badness = (relative_time_benefit (callee_info, edge, edge_time)
                 * (INT_MIN / 16 / RELATIVE_TIME_BENEFIT_RANGE));
-      badness /= (growth * MAX (1, callee_info->growth));
+      badness /= (MIN (65536/2, growth) * MIN (65536/2, MAX (1, callee_info->growth)));
       gcc_checking_assert (badness <=0 && badness >= INT_MIN / 16);
       if ((hints & (INLINE_HINT_indirect_call
                    | INLINE_HINT_loop_iterations