Commit 4bf4e169 by Sebastian Pop Committed by Sebastian Pop

re PR middle-end/40281 (-fprefetch-loop-arrays: ICE: in initialize_matrix_A, at…

re PR middle-end/40281 (-fprefetch-loop-arrays: ICE: in initialize_matrix_A, at tree-data-ref.c:1887)

2009-11-18  Sebastian Pop  <sebastian.pop@amd.com>

	PR middle-end/40281
	* testsuite/gcc.dg/graphite/pr40281.c: New.

	* tree-scalar-evolution.c (instantiate_scev_poly): Base and stride
	evolutions should not variate in inner loops.

From-SVN: r154641
parent 12aec731
2009-11-18 Sebastian Pop <sebastian.pop@amd.com> 2009-11-18 Sebastian Pop <sebastian.pop@amd.com>
PR middle-end/40281
* testsuite/gcc.dg/graphite/pr40281.c: New.
* tree-scalar-evolution.c (instantiate_scev_poly): Base and stride
evolutions should not variate in inner loops.
2009-11-18 Sebastian Pop <sebastian.pop@amd.com>
PR middle-end/42050 PR middle-end/42050
* testsuite/gfortran.dg/graphite/pr42050.f90: New. * testsuite/gfortran.dg/graphite/pr42050.f90: New.
......
...@@ -2226,9 +2226,21 @@ instantiate_scev_poly (basic_block instantiate_below, ...@@ -2226,9 +2226,21 @@ instantiate_scev_poly (basic_block instantiate_below,
if (CHREC_LEFT (chrec) != op0 if (CHREC_LEFT (chrec) != op0
|| CHREC_RIGHT (chrec) != op1) || CHREC_RIGHT (chrec) != op1)
{ {
unsigned var = CHREC_VARIABLE (chrec);
/* When the instantiated stride or base has an evolution in an
innermost loop, return chrec_dont_know, as this is not a
valid SCEV representation. In the reduced testcase for
PR40281 we would have {0, +, {1, +, 1}_2}_1 that has no
meaning. */
if ((tree_is_chrec (op0) && CHREC_VARIABLE (op0) > var)
|| (tree_is_chrec (op1) && CHREC_VARIABLE (op1) > var))
return chrec_dont_know;
op1 = chrec_convert_rhs (chrec_type (op0), op1, NULL); op1 = chrec_convert_rhs (chrec_type (op0), op1, NULL);
chrec = build_polynomial_chrec (CHREC_VARIABLE (chrec), op0, op1); chrec = build_polynomial_chrec (var, op0, op1);
} }
return chrec; return chrec;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment