]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/21272 (SSA_NAME def follows use with -ftree-vectorize)
authorDevang Patel <dpatel@apple.com>
Fri, 29 Apr 2005 16:10:12 +0000 (09:10 -0700)
committerDevang Patel <dpatel@gcc.gnu.org>
Fri, 29 Apr 2005 16:10:12 +0000 (09:10 -0700)
        PR tree-optimization/21272
        * tree-if-conv.c (find_phi_replacement_condition): Fix think-o.

        * gcc.dg/vect/vect-ifcvt-10.c: New.

From-SVN: r98998

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/vect-ifcvt-10.c [new file with mode: 0644]
gcc/tree-if-conv.c

index f52143430efff8599704ce533d54f169df165f3c..f06eb6cef30787e474f9d7189aad7a71a2f5d448 100644 (file)
@@ -1,3 +1,8 @@
+2005-04-29  Devang Patel  <dpatel@apple.com>
+
+       PR tree-optimization/21272
+       * tree-if-conv.c (find_phi_replacement_condition): Fix think-o.
+       
 2005-04-29  Kazu Hirata  <kazu@cs.umass.edu>
 
        * tree-flow-inline.h: Fix a comment typo.
index fda642096468864f0189398ea3bde3a5b0372dfc..81708422136a34f137b8b34abaac1d73644dc4bf 100644 (file)
@@ -1,3 +1,8 @@
+2005-04-29  Devang Patel  <dpatel@apple.com>
+
+       PR tree-optimization/21272
+       * gcc.dg/vect/vect-ifcvt-10.c: New test.
+       
 2005-04-29  Jakub Jelinek  <jakub@redhat.com>
 
        PR fortran/13082
diff --git a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-10.c b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-10.c
new file mode 100644 (file)
index 0000000..0fbb97f
--- /dev/null
@@ -0,0 +1,11 @@
+/* PR 21272 */
+/* { dg-do compile } */
+double
+foo (int j, double *v, double x)
+{
+  int i;
+  for (i = 0; i < j; i++)
+    if (v[i] < x)
+      x = v[i];
+  return x;
+}
index 4eb5a26e6c9b2e1a178d6235fc66c57ca7eddba9..ed3f2f7125610c6754594070273d550a5f437875 100644 (file)
@@ -701,7 +701,7 @@ find_phi_replacement_condition (struct loop *loop,
       basic_block tmp_bb;
       tmp_bb = first_bb;
       first_bb = second_bb;
-      second_bb = first_bb;
+      second_bb = tmp_bb;
     }
 
   /* Check if FIRST_BB is loop header or not.  */