diff options
author | Bill Schmidt <wschmidt@linux.vnet.ibm.com> | 2013-05-29 16:00:54 +0000 |
---|---|---|
committer | William Schmidt <wschmidt@gcc.gnu.org> | 2013-05-29 16:00:54 +0000 |
commit | 4b847da9ca10712f26b8d7c3e94fcde438964673 (patch) | |
tree | 05dfc0467862e73843060fd723ee1e2a21c97948 | |
parent | 0154ea95a161cc21b0d24367e983f281fc244633 (diff) | |
download | gcc-4b847da9ca10712f26b8d7c3e94fcde438964673.zip gcc-4b847da9ca10712f26b8d7c3e94fcde438964673.tar.gz gcc-4b847da9ca10712f26b8d7c3e94fcde438964673.tar.bz2 |
re PR tree-optimization/57441 (ICE in gimple-ssa-strength-reduction.c:3447 at -O3)
2013-05-29 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR tree-optimization/57441
* gimple-ssa-strength-reduction.c (analyze_candidates_and_replace):
Don't limit size of incr_vec to number of candidates.
2013-05-29 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR tree-optimization/57441
* gcc.c-torture/compile/pr57441.c: New.
From-SVN: r199414
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/gimple-ssa-strength-reduction.c | 8 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr57441.c | 26 |
4 files changed, 39 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e074334..1307e73 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-05-29 Bill Schmidt <wschmidt@linux.vnet.ibm.com> + + PR tree-optimization/57441 + * gimple-ssa-strength-reduction.c (analyze_candidates_and_replace): + Don't limit size of incr_vec to number of candidates. + 2013-05-29 Steve Ellcey <sellcey@imgtec.com> * config/mips/mti-linux.h (SYSROOT_SUFFIX_SPEC): Add micromips diff --git a/gcc/gimple-ssa-strength-reduction.c b/gcc/gimple-ssa-strength-reduction.c index dcd3180..9a53bf7 100644 --- a/gcc/gimple-ssa-strength-reduction.c +++ b/gcc/gimple-ssa-strength-reduction.c @@ -3361,7 +3361,6 @@ analyze_candidates_and_replace (void) less expensive to calculate than the replaced statements. */ else { - int length; enum machine_mode mode; bool speed; @@ -3372,14 +3371,11 @@ analyze_candidates_and_replace (void) /* If all candidates have already been replaced under other interpretations, nothing remains to be done. */ - length = count_candidates (c); - if (!length) + if (!count_candidates (c)) continue; - if (length > MAX_INCR_VEC_LEN) - length = MAX_INCR_VEC_LEN; /* Construct an array of increments for this candidate chain. */ - incr_vec = XNEWVEC (incr_info, length); + incr_vec = XNEWVEC (incr_info, MAX_INCR_VEC_LEN); incr_vec_len = 0; record_increments (c); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4dc91bc..4aedfc9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-05-29 Bill Schmidt <wschmidt@linux.vnet.ibm.com> + + PR tree-optimization/57441 + * gcc.c-torture/compile/pr57441.c: New. + 2013-05-29 Dehao Chen <dehao@google.com> PR testsuite/57413 diff --git a/gcc/testsuite/gcc.c-torture/compile/pr57441.c b/gcc/testsuite/gcc.c-torture/compile/pr57441.c new file mode 100644 index 0000000..e357c10 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr57441.c @@ -0,0 +1,26 @@ +/* PR tree-optimization/57441 */ + +int a, c, d, *e; +unsigned char b; + +char +baz (char p1) +{ + return p1 * a; +} + +void func_65 (); +func_1 () +{ + func_65 (); + func_65 (); +} + +void +func_65 () +{ + d = baz (b--); + if (*e) + b--; + c = 0; +} |