re PR tree-optimization/77937 (ICE: in replace_one_candidate, at gimple-ssa-strength-reduction.c:3370)

2016-10-13  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR tree-optimization/77937
	* gimple-ssa-strength-reduction.c (analyze_increments): Set cost
	to infinite when we have a pointer with an increment of -1.

From-SVN: r241125
This commit is contained in:
Bill Schmidt 2016-10-13 15:34:22 +00:00 committed by William Schmidt
parent 58f7dab40d
commit 2d4035dcd7
2 changed files with 11 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2016-10-13 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR tree-optimization/77937
* gimple-ssa-strength-reduction.c (analyze_increments): Set cost
to infinite when we have a pointer with an increment of -1.
2016-10-13 Thomas Preud'homme <thomas.preudhomme@arm.com> 2016-10-13 Thomas Preud'homme <thomas.preudhomme@arm.com>
* coretypes.h: Move MEMMODEL_* macros and enum memmodel definition * coretypes.h: Move MEMMODEL_* macros and enum memmodel definition

View File

@ -2819,6 +2819,11 @@ analyze_increments (slsr_cand_t first_dep, machine_mode mode, bool speed)
&& !POINTER_TYPE_P (first_dep->cand_type))) && !POINTER_TYPE_P (first_dep->cand_type)))
incr_vec[i].cost = COST_NEUTRAL; incr_vec[i].cost = COST_NEUTRAL;
/* FIXME: We don't handle pointers with a -1 increment yet.
They are usually unprofitable anyway. */
else if (incr == -1 && POINTER_TYPE_P (first_dep->cand_type))
incr_vec[i].cost = COST_INFINITE;
/* FORNOW: If we need to add an initializer, give up if a cast from /* FORNOW: If we need to add an initializer, give up if a cast from
the candidate's type to its stride's type can lose precision. the candidate's type to its stride's type can lose precision.
This could eventually be handled better by expressly retaining the This could eventually be handled better by expressly retaining the