diff options
author | Dorit Nuzman <dorit@il.ibm.com> | 2007-03-18 04:37:32 +0000 |
---|---|---|
committer | Dorit Nuzman <dorit@gcc.gnu.org> | 2007-03-18 04:37:32 +0000 |
commit | f58e97341c3204fb2ab0fc6a03778e5923a9d94c (patch) | |
tree | 76ae0deab6b7d30ce6eae7e59959836737c46570 | |
parent | 59111135a832fdf0f24555e234b98452a0522073 (diff) | |
download | gcc-f58e97341c3204fb2ab0fc6a03778e5923a9d94c.zip gcc-f58e97341c3204fb2ab0fc6a03778e5923a9d94c.tar.gz gcc-f58e97341c3204fb2ab0fc6a03778e5923a9d94c.tar.bz2 |
tree-vect-transform.c (get_initial_def_for_induction): Replace GET_MODE_NUNITS with TYPE_VECTOR_SUBPARTS.
* 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
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/no-tree-dom-vect-bug.c | 30 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/vect.exp | 6 | ||||
-rw-r--r-- | gcc/tree-vect-transform.c | 4 |
5 files changed, 49 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 181e473..fa51222 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 51282fa..2a61218 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 0000000..3df9afe --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/no-tree-dom-vect-bug.c @@ -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" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect.exp b/gcc/testsuite/gcc.dg/vect/vect.exp index 547dbd4..158c418 100644 --- a/gcc/testsuite/gcc.dg/vect/vect.exp +++ b/gcc/testsuite/gcc.dg/vect/vect.exp @@ -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\]]] \ diff --git a/gcc/tree-vect-transform.c b/gcc/tree-vect-transform.c index bddea1e..4561383 100644 --- a/gcc/tree-vect-transform.c +++ b/gcc/tree-vect-transform.c @@ -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); |