From 174f8765a8a7198d4d3b05b476ed9ffa40c86cda Mon Sep 17 00:00:00 2001 From: Ira Rosen Date: Mon, 22 Oct 2007 12:05:36 +0000 Subject: [PATCH] re PR tree-optimization/33854 (ICE in vectorizable_conversion, at tree-vect-transform.c:3374) 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 | 6 ++++++ gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/gcc.dg/vect/O1-pr33854.c | 22 ++++++++++++++++++++++ gcc/testsuite/gcc.dg/vect/vect.exp | 14 +++++++++++++- gcc/tree-vect-analyze.c | 3 ++- 5 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/vect/O1-pr33854.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 620d7877ad6..caf5cfdc1ab 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2007-10-22 Ira Rosen + + 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 PR target/29473 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4e80fc53a8e..7374719e204 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2007-10-22 Ira Rosen + + 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 * 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 00000000000..346da6b60bd --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/O1-pr33854.c @@ -0,0 +1,22 @@ +/* Testcase by Martin Michlmayr */ +/* { 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 87a2a183ed9..e58f5809d09 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 7825aab6e09..04257afabc4 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)) < -- 2.30.2