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]Partially fix PR61529, bound basic block frequency


Hi all,

This is a simple patch to fix ICE in comment 2 of PR61529: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61529

Bound checking code is added to make sure the frequency is within legal range.

As far as I have observed, r215830 patch fixes the glibc building ICE. And this patch should fix the ICE while building the sample code in comment 2 using aarch64-none-elf toolchain. Until now, all the ICEs reported in this bug ticket should be fixed.

x86_64-unknown-linux-gnu bootstrap and regression test have been done, no new issue.
aarch64-none-elf toolchain has been test on the model. No new regression.

Is this Okay for trunk?

gcc/ChangeLog:

2014-10-29  Renlin Li  <Renlin.Li@arm.com>
     PR middle-end/61529
    * tree-ssa-threadupdate.c (compute_path_counts): Bound path_in_freq.
commit c44195cb52ec8ac6386b2b7afe467b680422fb2e
Author: Renlin Li <renlin.li@arm.com>
Date:   Tue Oct 28 16:30:42 2014 +0000

    fix pr61529
    
    Change-Id: Ie5e58510f21a4d7a609306006270c3168ab48d06

diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c
index d2cf4de..e3077a1 100644
--- a/gcc/tree-ssa-threadupdate.c
+++ b/gcc/tree-ssa-threadupdate.c
@@ -730,6 +730,10 @@ compute_path_counts (struct redirection_data *rd,
             nonpath_count += ein->count;
         }
     }
+
+  if (path_in_freq > BB_FREQ_MAX)
+    path_in_freq = BB_FREQ_MAX;
+
   BITMAP_FREE (in_edge_srcs);
 
   /* Now compute the fraction of the total count coming into the first

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