commit fead29d30b2985a1ba338759054f99d71d81f3c0 Author: Renlin Li Date: Tue Oct 28 16:30:42 2014 +0000 fix pr61529 diff --git a/gcc/testsuite/gcc.dg/pr61529.c b/gcc/testsuite/gcc.dg/pr61529.c new file mode 100644 index 0000000..9ae2e06 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr61529.c @@ -0,0 +1,26 @@ +/* PR middle-end/61529 */ +/* { dg-do compile } */ +/* { dg-options "-O3" } */ + +unsigned int a, b, c; + +int +main () +{ + unsigned int d; + 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 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