summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjiwang <jiwang@138bc75d-0d04-0410-961f-82ee72b054a4>2014-11-10 17:53:21 +0000
committerjiwang <jiwang@138bc75d-0d04-0410-961f-82ee72b054a4>2014-11-10 17:53:21 +0000
commit664dd751bcadcd02581217faa6848d35270f36f3 (patch)
treee13c3ceaa56a47f629109a9a6d9f8fcd7fa67357
parent06b040bd1cbf3004fc4290ed1bc16141f2459e32 (diff)
downloadgcc-664dd751bcadcd02581217faa6848d35270f36f3.tar.gz
[PATCH] Partially fix PR61529, bound basic block frequency
2014-11-10 Renlin Li <Renlin.Li@arm.com> PR middle-end/61529 gcc/ * tree-ssa-threadupdate.c (compute_path_counts): Bound path_in_freq. gcc/testsuite/ * gcc.dg/pr61529.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217303 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/pr61529.c27
-rw-r--r--gcc/tree-ssa-threadupdate.c5
4 files changed, 42 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4b70b620869..f29986b6682 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2014-11-10 Renlin Li <renlin.li@arm.com>
+
+ PR middle-end/61529
+ * tree-ssa-threadupdate.c (compute_path_counts): Bound path_in_freq.
+
2014-11-10 Thomas Preud'homme <thomas.preudhomme@arm.com>
* expmed.c (expand_shift_1): Expand 8 bit rotate of 16 bit value to
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3af1a43c8f2..ece3d52259b 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2014-11-10 Renlin Li <renlin.li@arm.com>
+
+ PR middle-end/61529
+ * gcc.dg/pr61529.c: New.
+
2014-11-10 Bernd Schmidt <bernds@codesourcery.com>
* lib/target-supports.exp (check_effective_target_return_address):
diff --git a/gcc/testsuite/gcc.dg/pr61529.c b/gcc/testsuite/gcc.dg/pr61529.c
new file mode 100644
index 00000000000..392239e7158
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr61529.c
@@ -0,0 +1,27 @@
+/* PR middle-end/61529 */
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+unsigned int a = 0, b = 0;
+unsigned int c;
+
+int
+main ()
+{
+ unsigned int d = 0;
+ int e[5];
+
+ for (; b < 1; b++)
+ d = 0;
+ for (; d < 1; d++)
+ a = 0;
+ for (; a < 1; a++)
+ ;
+
+ for (c = 0; c < 5; c++)
+ e[c] = 1;
+ if (e[0])
+ c = 0;
+
+ return 0;
+}
diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c
index 5d838c3c25f..151ed839547 100644
--- a/gcc/tree-ssa-threadupdate.c
+++ b/gcc/tree-ssa-threadupdate.c
@@ -734,6 +734,11 @@ compute_path_counts (struct redirection_data *rd,
nonpath_count += ein->count;
}
}
+
+ /* This is needed due to insane incoming frequencies. */
+ 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