Commit 1f380314 by Sebastian Pop Committed by Sebastian Pop

Fix PR43306: correct evolution_function_right_is_integer_cst.

2010-03-09  Sebastian Pop  <sebastian.pop@amd.com>

	PR middle-end/43306
	* tree-chrec.c (evolution_function_right_is_integer_cst): CHREC_RIGHT
	should be an INTEGER_CST.  Also handle CASE_CONVERT.
	* gcc.dg/graphite/pr43306.c: New.

From-SVN: r157434
parent b6bb0094
2010-03-09 Sebastian Pop <sebastian.pop@amd.com>
PR middle-end/43306
* tree-chrec.c (evolution_function_right_is_integer_cst): CHREC_RIGHT
should be an INTEGER_CST. Also handle CASE_CONVERT.
* gcc.dg/graphite/pr43306.c: New.
2010-03-09 Sebastian Pop <sebastian.pop@amd.com>
* graphite.c (graphite_initialize): To bound the number of bbs per
function, use PARAM_GRAPHITE_MAX_BBS_PER_FUNCTION.
* params.def (PARAM_GRAPHITE_MAX_BBS_PER_FUNCTION): Declared.
......
/* { dg-options "-O1 -fstrict-overflow -fgraphite-identity" } */
void foo(int x[])
{
int i, j;
for (i = 0; i < 2; i++)
for (j = 0; j < 2; j++)
x[i] = x[i*j];
}
......@@ -1529,14 +1529,12 @@ evolution_function_right_is_integer_cst (const_tree chrec)
return true;
case POLYNOMIAL_CHREC:
if (!evolution_function_right_is_integer_cst (CHREC_RIGHT (chrec)))
return false;
if (TREE_CODE (CHREC_LEFT (chrec)) == POLYNOMIAL_CHREC
&& !evolution_function_right_is_integer_cst (CHREC_LEFT (chrec)))
return false;
return TREE_CODE (CHREC_RIGHT (chrec)) == INTEGER_CST
&& (TREE_CODE (CHREC_LEFT (chrec)) != POLYNOMIAL_CHREC
|| evolution_function_right_is_integer_cst (CHREC_LEFT (chrec)));
return true;
CASE_CONVERT:
return evolution_function_right_is_integer_cst (TREE_OPERAND (chrec, 0));
default:
return false;
......
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