This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix PR ipa/58862 (overflow in edge_badness computation)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]