This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR ipa/58862 (overflow in edge_badness computation)
- From: Teresa Johnson <tejohnson at google dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: Uros Bizjak <ubizjak at gmail dot com>, David Li <davidxl at google dot com>, Jan Hubicka <hubicka at ucw dot cz>
- Date: Wed, 13 Nov 2013 06:48:40 -0800
- Subject: [PATCH] Fix PR ipa/58862 (overflow in edge_badness computation)
- Authentication-results: sourceware.org; auth=none
The following fixes PR ipa/58862, which caused failures in lto
profiledbootstrap and in several spec cpu2006 profile-use builds.
Bootstrapped and tested on x86-64-unknown-linux-gnu. Also ensured that
it fixed the lto profiledbootstrap and cpu2006 failures. Ok for trunk?
Thanks,
Teresa
2013-11-13 Teresa Johnson <tejohnson@google.com>
PR ipa/58862
* ipa-inline.c (edge_badness): Fix overflow.
Index: ipa-inline.c
===================================================================
--- ipa-inline.c (revision 204703)
+++ ipa-inline.c (working copy)
@@ -909,7 +909,7 @@ edge_badness (struct cgraph_edge *edge, bool dump)
/* Capping edge->count to max_count. edge->count can be larger than
max_count if an inline adds new edges which increase max_count
after max_count is computed. */
- int edge_count = edge->count > max_count ? max_count : edge->count;
+ gcov_type edge_count = edge->count > max_count ? max_count : edge->count;
sreal_init (&relbenefit_real, relbenefit, 0);
sreal_init (&growth_real, growth, 0);
--
Teresa Johnson | Software Engineer | tejohnson@google.com | 408-460-2413