aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gcc.dg/vect/O1-pr33854.c22
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect.exp14
-rw-r--r--gcc/tree-vect-analyze.c3
5 files changed, 49 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 620d787..caf5cfd 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 4e80fc5..7374719 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 0000000..346da6b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/O1-pr33854.c
@@ -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" } } */
+
diff --git a/gcc/testsuite/gcc.dg/vect/vect.exp b/gcc/testsuite/gcc.dg/vect/vect.exp
index 87a2a18..e58f580 100644
--- a/gcc/testsuite/gcc.dg/vect/vect.exp
+++ b/gcc/testsuite/gcc.dg/vect/vect.exp
@@ -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}
diff --git a/gcc/tree-vect-analyze.c b/gcc/tree-vect-analyze.c
index 7825aab..04257af 100644
--- a/gcc/tree-vect-analyze.c
+++ b/gcc/tree-vect-analyze.c
@@ -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)) <