OSDN Git Service

Fix PR42327: use build_int_cst.
authorspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 7 Dec 2010 15:27:50 +0000 (15:27 +0000)
committerspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 7 Dec 2010 15:27:50 +0000 (15:27 +0000)
2010-12-07  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.dg/tree-ssa/pr42327.c: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167548 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/pr42327.c [new file with mode: 0644]
gcc/tree-data-ref.c

index 2156529..a684364 100644 (file)
@@ -1,3 +1,9 @@
+2010-12-07  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-07  Nathan Froyd  <froydnj@codesourcery.com>
 
        PR c++/45330
@@ -27,7 +33,7 @@
        * targhook.h: Declare it.
        * doc/tm.texi.in: New hook TARGET_PREFERRED_RENAME_CLASS.
        * doc/tm.texi: Regenerate.
-       
+
 2010-12-07  Jakub Jelinek  <jakub@redhat.com>
 
        PR debug/46799
        * c-family/c-format.c: Same change.
        * c-family/stub-objc.c: Same change.
        * c-decl.c: Include c-family/c-objc.h.
-       * c-parser.c: Same change.      
+       * c-parser.c: Same change.
        * c-typeck.c: Same change.
        * c-config-lang.in (gtfiles): Added c-family/c-objc.h.
        * Makefile.in (c-decl.o): Depend on c-family/c-objc.h.
        (c-family/stub-objc.o): Same change.
        (c-family/c-common.o): Same change.
        (PLUGIN_HEADERS): Added c-family/c-objc.h.
-       
+
 2010-12-05  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
        * config.gcc [hppa[12]*-*-hpux10*, hppa[12]*-*-hpux11*]:  Ignore
index 318477e..520be3f 100644 (file)
@@ -1,3 +1,8 @@
+2010-12-06  Sebastian Pop  <sebastian.pop@amd.com>
+
+       PR tree-optimization/42327
+       * gcc.dg/tree-ssa/pr42327.c: New.
+
 2010-12-07  Nathan Froyd  <froydnj@codesourcery.com>
 
        PR c++/45330
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr42327.c b/gcc/testsuite/gcc.dg/tree-ssa/pr42327.c
new file mode 100644 (file)
index 0000000..c0d3811
--- /dev/null
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fcheck-data-deps" } */
+
+void foo(char *str)
+{
+   while (*str != 0) *str++ = 0;
+}
index 094d168..4dfcd5c 100644 (file)
@@ -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)