public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* FDO usability trivial patch to fix div by zero error with insane profile
@ 2011-04-15 20:21 Xinliang David Li
  2011-04-15 20:21 ` Diego Novillo
  0 siblings, 1 reply; 5+ messages in thread
From: Xinliang David Li @ 2011-04-15 20:21 UTC (permalink / raw)
  To: GCC Patches; +Cc: Diego Novillo

[-- Attachment #1: Type: text/plain, Size: 304 bytes --]

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  <davidxl@google.com>

	* ipa-inline.c (cgraph_decide_recursive_inlining): Fix
	div by zero error with insane profile.

[-- Attachment #2: div0.p --]
[-- Type: text/x-pascal, Size: 495 bytes --]

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,

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-04-17 15:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-15 20:21 FDO usability trivial patch to fix div by zero error with insane profile Xinliang David Li
2011-04-15 20:21 ` Diego Novillo
2011-04-15 20:33   ` Xinliang David Li
2011-04-15 21:20     ` Diego Novillo
2011-04-17 16:35   ` Jan Hubicka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).