]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-vect-transform.c (get_initial_def_for_induction): Replace GET_MODE_NUNITS with...
authorDorit Nuzman <dorit@il.ibm.com>
Sun, 18 Mar 2007 04:37:32 +0000 (04:37 +0000)
committerDorit Nuzman <dorit@gcc.gnu.org>
Sun, 18 Mar 2007 04:37:32 +0000 (04:37 +0000)
        * tree-vect-transform.c (get_initial_def_for_induction): Replace
        GET_MODE_NUNITS with TYPE_VECTOR_SUBPARTS.
        (get_initial_def_for_reduction): Likewise.

From-SVN: r123034

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/no-tree-dom-vect-bug.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect.exp
gcc/tree-vect-transform.c

index 181e4735eb38aa63192b9bf1dfebe1247d42897b..fa5122280aa34866308f3da43124d67c03db4225 100644 (file)
@@ -1,3 +1,9 @@
+2007-03-18  Dorit Nuzman  <dorit@il.ibm.com>
+
+       * tree-vect-transform.c (get_initial_def_for_induction): Replace
+       GET_MODE_NUNITS with TYPE_VECTOR_SUBPARTS.
+       (get_initial_def_for_reduction): Likewise.
+
 2007-03-16  Daniel Berlin  <dberlin@dberlin.org>
 
        Fix PR tree-optimization/29922
index 51282fab131dae44205da4b418ebf8a0071582f6..2a61218812a40dbcfc4a3218aca47d2c737fdc85 100644 (file)
@@ -1,3 +1,8 @@
+2007-03-18  Dorit Nuzman  <dorit@il.ibm.com>
+
+       * gcc.dg/vect/no-tree-dom-vect-bug.c: New test.
+       * gcc.dg/vect/vect.exp: Compile tests with -fno-tree-dominator-opts.
 2007-03-17  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
 
        PR fortran/31120
diff --git a/gcc/testsuite/gcc.dg/vect/no-tree-dom-vect-bug.c b/gcc/testsuite/gcc.dg/vect/no-tree-dom-vect-bug.c
new file mode 100644 (file)
index 0000000..3df9afe
--- /dev/null
@@ -0,0 +1,30 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+long stack_vars_sorted[32];
+
+int
+main1 (long n)
+{
+  long si;
+
+  for (si = 0; si < n; ++si)
+    stack_vars_sorted[si] = si;
+}
+
+int main ()
+{
+  long si;
+
+  check_vect ();
+  main1 (32);
+
+  for (si = 0; si < 32; ++si)
+    if (stack_vars_sorted[si] != si)
+      abort ();
+
+  return 0;
+}
+/* { dg-final { cleanup-tree-dump "vect" } } */
index 547dbd4346440f6bcd15b3aad986abfe958504f0..158c4187104663c5a5a70b104025314414489d10 100644 (file)
@@ -162,6 +162,12 @@ lappend DEFAULT_VECTCFLAGS "-fno-tree-scev-cprop"
 dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-tree-scev-cprop-*.\[cS\]]]  \
        "" $DEFAULT_VECTCFLAGS
 
+# -fno-tree-dominator-opts
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
+lappend DEFAULT_VECTCFLAGS "-fno-tree-dominator-opts"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-tree-dom-*.\[cS\]]]  \
+       "" $DEFAULT_VECTCFLAGS
+
 # With -Os
 lappend DEFAULT_VECTCFLAGS "-Os"
 dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/Os-vect-*.\[cS\]]]  \
index bddea1e5dc26cc7d6556c38684f96d275ff90798..456138361d43f8b5e78334523c414cd4fa3834c1 100644 (file)
@@ -531,7 +531,7 @@ get_initial_def_for_induction (tree stmt, tree iv_phi)
   struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
   tree scalar_type = TREE_TYPE (iv_phi);
   tree vectype = get_vectype_for_scalar_type (scalar_type);
-  int nunits = GET_MODE_NUNITS (TYPE_MODE (vectype));
+  int nunits =  TYPE_VECTOR_SUBPARTS (vectype);
   edge pe = loop_preheader_edge (loop);
   basic_block new_bb;
   block_stmt_iterator bsi;
@@ -1001,7 +1001,7 @@ get_initial_def_for_reduction (tree stmt, tree init_val, tree *scalar_def)
 {
   stmt_vec_info stmt_vinfo = vinfo_for_stmt (stmt);
   tree vectype = STMT_VINFO_VECTYPE (stmt_vinfo);
-  int nunits = GET_MODE_NUNITS (TYPE_MODE (vectype));
+  int nunits =  TYPE_VECTOR_SUBPARTS (vectype);
   int nelements;
   enum tree_code code = TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1));
   tree type = TREE_TYPE (init_val);