[PATCH] Fix PR42327: use build_int_cst.

Sebastian Pop sebpop@gmail.com
Tue Dec 7 00:51:00 GMT 2010


Hi,

Instead of using integer_minus_one_node, we now call build_int_cst
with the same type as the chrec.  With this, the assert from
build_polynomial_chrec doesn't fail.  I'm testing this on amd64-linux.
Ok for trunk?

Thanks,
Sebastian

2010-12-06  Sebastian Pop  <sebastian.pop@amd.com>

	PR tree-optimization/42327
	* tree-data-ref.c (omega_setup_subscript): Call build_int_cst
	instead of using integer_minus_one_node.
---
 gcc/ChangeLog       |    6 ++++++
 gcc/tree-data-ref.c |    4 +++-
 2 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 338e324..25beff8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2010-12-06  Sebastian Pop  <sebastian.pop@amd.com>
+
+	PR tree-optimization/42327
+	* tree-data-ref.c (omega_setup_subscript): Call build_int_cst
+	instead of using integer_minus_one_node.
+
 2010-12-03  Jason Merrill  <jason@redhat.com>
 
 	PR debug/46123
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c
index 094d168..4dfcd5c 100644
--- a/gcc/tree-data-ref.c
+++ b/gcc/tree-data-ref.c
@@ -3482,6 +3482,7 @@ omega_setup_subscript (tree access_fun_a, tree access_fun_b,
   tree fun_a = chrec_convert (type, access_fun_a, NULL);
   tree fun_b = chrec_convert (type, access_fun_b, NULL);
   tree difference = chrec_fold_minus (type, fun_a, fun_b);
+  tree minus_one;
 
   /* When the fun_a - fun_b is not constant, the dependence is not
      captured by the classic distance vector representation.  */
@@ -3496,7 +3497,8 @@ omega_setup_subscript (tree access_fun_a, tree access_fun_b,
       return true;
     }
 
-  fun_b = chrec_fold_multiply (type, fun_b, integer_minus_one_node);
+  minus_one = build_int_cst (type, -1);
+  fun_b = chrec_fold_multiply (type, fun_b, minus_one);
 
   eq = omega_add_zero_eq (pb, omega_black);
   if (!init_omega_eq_with_af (pb, eq, DDR_NB_LOOPS (ddr), fun_a, ddr)
-- 
1.7.1



More information about the Gcc-patches mailing list