diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e074334841d..1307e736386 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-05-29 Bill Schmidt + + 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 * 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 dcd31809ab6..9a53bf7c339 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 4dc91bcec9d..4aedfc94fb7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-05-29 Bill Schmidt + + PR tree-optimization/57441 + * gcc.c-torture/compile/pr57441.c: New. + 2013-05-29 Dehao Chen 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 00000000000..e357c100518 --- /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; +}