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
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.
--- /dev/null
+/* { 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];
+}
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;