]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/53346 (Bad if conversion in cptrf2 of rnflow.f90)
authorRichard Guenther <rguenther@suse.de>
Fri, 18 May 2012 13:10:01 +0000 (13:10 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 18 May 2012 13:10:01 +0000 (13:10 +0000)
2012-05-18  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/53346
* tree-loop-distribution.c (ldist_gen): Make sure to apply
builtin transform even when only a single partition with
all reads/writes exists.

* gcc.dg/tree-ssa/ldist-18.c: New testcase.
* gcc.target/i386/incoming-10.c: Adjust.
* gcc.target/i386/incoming-11.c: Likewise.
* gcc.target/i386/pr46295.c: Likewise.

From-SVN: r187655

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/ldist-18.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/incoming-10.c
gcc/testsuite/gcc.target/i386/incoming-11.c
gcc/testsuite/gcc.target/i386/pr46295.c
gcc/tree-loop-distribution.c

index 70571cd4b5800558ad75a739c6dd33ddf579b3a3..b0d92ae1965c5d313919d7f7e66270981d5375a1 100644 (file)
@@ -1,3 +1,10 @@
+2012-05-18  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/53346
+       * tree-loop-distribution.c (ldist_gen): Make sure to apply
+       builtin transform even when only a single partition with
+       all reads/writes exists.
+
 2012-05-18  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/53390
index d5dfbd184b8e982d173681c9483b05bcf6b5ca4a..87941bd7aa58752df4f3dcfab80e19954d39ccc1 100644 (file)
@@ -1,3 +1,11 @@
+2012-05-18  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/53346
+       * gcc.dg/tree-ssa/ldist-18.c: New testcase.
+       * gcc.target/i386/incoming-10.c: Adjust.
+       * gcc.target/i386/incoming-11.c: Likewise.
+       * gcc.target/i386/pr46295.c: Likewise.
+
 2012-05-18  Richard Guenther  <rguenther@suse.de>
 
        * gcc.dg/pr53352.c: Return zero.
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ldist-18.c b/gcc/testsuite/gcc.dg/tree-ssa/ldist-18.c
new file mode 100644 (file)
index 0000000..893ab8b
--- /dev/null
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-distribute-patterns -fdump-tree-ldist-details" } */
+
+void foo (int *p, int n)
+{
+  int i;
+  for (i = 0; i < n; ++i)
+    p[i] = 0;
+}
+
+/* { dg-final { scan-tree-dump "generated memset zero" "ldist" } } */
+/* { dg-final { cleanup-tree-dump "ldist" } } */
index 1fb9ef4f0f933190aee0b8cbd34e247b36deb300..612fa720888d4320177dc49293f4efdc535ac8f4 100644 (file)
@@ -12,7 +12,7 @@ void f()
 {
        int i;
        struct s s;
-       for (i = 0; i < sizeof(s.x) / sizeof(*s.x); i++) s.x[i] = 0;
+       for (i = 0; i < sizeof(s.x) / sizeof(*s.x); i++) s.x[i] = 1;
        g(&s);
 }
 
index a7b7db53aa8a996a68cb94f512ee8f9f08775adc..a830c96f7d1560e1722e8aad369871ed50738634 100644 (file)
@@ -10,9 +10,9 @@ int q[100];
 void f()
 {
        int i;
-       for (i = 0; i < 100; i++) p[i] = 0;
+       for (i = 0; i < 100; i++) p[i] = 1;
        g();
-       for (i = 0; i < 100; i++) q[i] = 0;
+       for (i = 0; i < 100; i++) q[i] = 1;
 }
 
 /* { dg-final { scan-assembler "andl\[\\t \]*\\$-16,\[\\t \]*%esp" } } */
index b7fccb7fb34d2e296b6cc52b5e208030d96e86b7..4ac7c101abb7e51d659a0546dc880f5025da4875 100644 (file)
@@ -9,7 +9,7 @@ void Parse_Vector ()
    EXPRESS Express;
    int Terms;
    for (Terms = 0; Terms < 5; Terms++)
-     Express[Terms] = 0.0;
+     Express[Terms] = 1.0;
    Parse_Rel_Factor(Express,&Terms);
 }
 
index 0d21763c72e2fd17017fc838517c34bd16fa4aed..d7506e69b0423b52ce42d8a2b812a8e00abe2b99 100644 (file)
@@ -1131,8 +1131,11 @@ ldist_gen (struct loop *loop, struct graph *rdg,
   BITMAP_FREE (processed);
   nbp = VEC_length (bitmap, partitions);
 
-  if (nbp <= 1
-      || partition_contains_all_rw (rdg, partitions))
+  if (nbp == 0
+      || (nbp == 1
+         && !can_generate_builtin (rdg, VEC_index (bitmap, partitions, 0)))
+      || (nbp > 1
+         && partition_contains_all_rw (rdg, partitions)))
     goto ldist_done;
 
   if (dump_file && (dump_flags & TDF_DETAILS))