re PR tree-optimization/33854 (ICE in vectorizable_conversion, at tree-vect-transform...
authorIra Rosen <irar@il.ibm.com>
Mon, 22 Oct 2007 12:05:36 +0000 (12:05 +0000)
committerIra Rosen <irar@gcc.gnu.org>
Mon, 22 Oct 2007 12:05:36 +0000 (12:05 +0000)
PR tree-optimization/33854
* tree-vect-analyze.c (vect_determine_vectorization_factor): Add
FLOAT_EXPR to the list of promotion operations.

From-SVN: r129549

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/O1-pr33854.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect.exp
gcc/tree-vect-analyze.c

index 620d7877ad6fb436c0cd3e00f0e340654a6e545c..caf5cfdc1ab7083d92f052084b85bc26bda62b68 100644 (file)
@@ -1,3 +1,9 @@
+2007-10-22  Ira Rosen  <irar@il.ibm.com>
+
+       PR tree-optimization/33854
+       * tree-vect-analyze.c (vect_determine_vectorization_factor): Add
+       FLOAT_EXPR to the list of promotion operations. 
+
 2007-10-22  Rask Ingemann Lambertsen  <rask@sygehus.dk>
 
        PR target/29473
index 4e80fc53a8efe1c83875f5704e67838cd17350e9..7374719e204427c7a0cd2e42820200f36ee984ca 100644 (file)
@@ -1,3 +1,9 @@
+2007-10-22  Ira Rosen  <irar@il.ibm.com>
+
+       PR tree-optimization/33854
+       * gcc.dg/vect/O1-pr33854.c: New testcase.
+       * gcc.dg/vect/vect.exp: Run tests starting with "O1-" with -O1.
+
 2007-10-21  David Edelsohn  <edelsohn@gnu.org>
 
        * gcc.dg/unwind-1.c: Disable on AIX.
diff --git a/gcc/testsuite/gcc.dg/vect/O1-pr33854.c b/gcc/testsuite/gcc.dg/vect/O1-pr33854.c
new file mode 100644 (file)
index 0000000..346da6b
--- /dev/null
@@ -0,0 +1,22 @@
+/* Testcase by Martin Michlmayr <tbm@cyrius.com> */
+/* { dg-do compile } */
+
+extern void *malloc (long unsigned int __size);
+typedef struct VMatrix_ VMatrix;
+struct VMatrix_
+{
+  int dim;
+  int t2;
+};
+void uniform_correlation_matrix (VMatrix * v)
+{
+  double *xbar = ((void *) 0);
+  int m = v->dim;
+  int i;
+  xbar = malloc (m * sizeof *xbar);
+  for (i = 0; i < m; i++)
+    xbar[i] /= m;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
index 87a2a183ed945e8d20ea03e465ff741350b8cdbc..e58f5809d095e30253d16a928af4a132f46eb020 100644 (file)
@@ -23,7 +23,7 @@ load_lib gcc-dg.exp
 set DEFAULT_VECTCFLAGS ""
 
 # These flags are used for all targets.
-lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize"
+lappend DEFAULT_VECTCFLAGS "-ftree-vectorize"
 
 # If the target system supports vector instructions, the default action
 # for a test is 'run', otherwise it's 'compile'.  Save current default.
@@ -98,6 +98,13 @@ if [istarget "powerpc*-*-*"] {
 # Initialize `dg'.
 dg-init
 
+global O1_VECTCFLAGS
+set O1_VECTCFLAGS $DEFAULT_VECTCFLAGS
+lappend O1_VECTCFLAGS "-O1"
+lappend O1_VECTCFLAGS "-fdump-tree-vect-details"
+
+lappend DEFAULT_VECTCFLAGS "-O2"
+
 # Tests that should be run without generating dump info
 dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/nodump-*.\[cS\]]]  \
        "" $DEFAULT_VECTCFLAGS
@@ -230,6 +237,11 @@ lappend DEFAULT_VECTCFLAGS "-O3"
 dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/O3-vect-*.\[cS\]]]  \
         "" $DEFAULT_VECTCFLAGS
 
+# With -O1
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/O1-*.\[cS\]]]  \
+        "" $O1_VECTCFLAGS
+
+
 # Clean up.
 set dg-do-what-default ${save-dg-do-what-default}
 
index 7825aab6e09262ccacddac98d8dfd86b32f1bcd8..04257afabc49f12b716ab6c6beacaab5fcb06cf3 100644 (file)
@@ -242,7 +242,8 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
              operation = GIMPLE_STMT_OPERAND (stmt, 1);
              if (TREE_CODE (operation) == NOP_EXPR
                  || TREE_CODE (operation) == CONVERT_EXPR
-                 || TREE_CODE (operation) == WIDEN_MULT_EXPR)
+                 || TREE_CODE (operation) == WIDEN_MULT_EXPR
+                 || TREE_CODE (operation) == FLOAT_EXPR)
                {
                  tree rhs_type = TREE_TYPE (TREE_OPERAND (operation, 0));
                  if (TREE_INT_CST_LOW (TYPE_SIZE_UNIT (rhs_type)) <