This is a trivial patch to deal with bad profile data (from
multi-threaded programs) that leads to divide by zero error.
Ok for trunk?
Thanks,
David
2011-04-15 Xinliang David Li <[email protected]>
* ipa-inline.c (cgraph_decide_recursive_inlining): Fix
div by zero error with insane profile.
Index: ipa-inline.c
===================================================================
--- ipa-inline.c (revision 172510)
+++ ipa-inline.c (working copy)
@@ -779,7 +779,7 @@ cgraph_decide_recursive_inlining (struct
fprintf (dump_file, " Not inlining cold call\n");
continue;
}
- if (curr->count * 100 / node->count < probability)
+ if (node->count == 0 || curr->count * 100 / node->count < probability)
{
if (dump_file)
fprintf (dump_file,