diff options
author | Richard Guenther <rguenther@suse.de> | 2010-11-02 15:46:46 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-11-02 15:46:46 +0000 |
commit | 43427f3c581470449ed62ebaebeabe6a49c94e6f (patch) | |
tree | 4bf25db32c0a793b3c50814ec81909468ef7fe23 /gcc | |
parent | 1bbd3bdee61544ce2824befa54c9a309ecac3905 (diff) | |
download | gcc-43427f3c581470449ed62ebaebeabe6a49c94e6f.zip gcc-43427f3c581470449ed62ebaebeabe6a49c94e6f.tar.gz gcc-43427f3c581470449ed62ebaebeabe6a49c94e6f.tar.bz2 |
re PR tree-optimization/46184 (ICE: SIGSEGV in vectorizable_reduction (tree-vect-loop.c:4067) with -O -ftree-vectorize -fno-tree-copy-prop -fno-tree-dce)
2010-11-02 Richard Guenther <rguenther@suse.de>
PR tree-optimization/46184
* tree-vect-loop.c (vectorizable_reduction): Try to obtain the
input vector type from the reduction operand as well.
* gcc.dg/pr46184.c: New testcase.
From-SVN: r166194
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr46184.c | 18 | ||||
-rw-r--r-- | gcc/tree-vect-loop.c | 10 |
4 files changed, 34 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e1a18af..b5d15ce 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2010-11-02 Richard Guenther <rguenther@suse.de> + PR tree-optimization/46184 + * tree-vect-loop.c (vectorizable_reduction): Try to obtain the + input vector type from the reduction operand as well. + +2010-11-02 Richard Guenther <rguenther@suse.de> + PR tree-optimization/46177 * tree-loop-distribution.c (prop_phis): Use mark_virtual_phi_result_for_renaming. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4f4e486..d1af154 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2010-11-02 Richard Guenther <rguenther@suse.de> + PR tree-optimization/46184 + * gcc.dg/pr46184.c: New testcase. + +2010-11-02 Richard Guenther <rguenther@suse.de> + PR tree-optimization/46177 * gcc.dg/pr46177.c: New testcase. diff --git a/gcc/testsuite/gcc.dg/pr46184.c b/gcc/testsuite/gcc.dg/pr46184.c new file mode 100644 index 0000000..fafa7f4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr46184.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-O -ftree-vectorize -fno-tree-copy-prop -fno-tree-dce" } */ + +extern int A[], B[]; + +void +foo (int z) +{ + int j, i; + for (j = 0; j < 32; j++) + { + int curr_a = A[0]; + for (i = 0; i < 16; i++) + curr_a = A[i] ? curr_a : z; + B[j] = curr_a; + } +} + diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index c213673..57ca5a8 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -3908,7 +3908,7 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi, VEC (tree, heap) *vec_oprnds0 = NULL, *vec_oprnds1 = NULL, *vect_defs = NULL; VEC (gimple, heap) *phis = NULL; int vec_num; - tree def0, def1; + tree def0, def1, tem; if (nested_in_vect_loop_p (loop, stmt)) { @@ -3999,8 +3999,6 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi, reduction variable. */ for (i = 0; i < op_type-1; i++) { - tree tem; - /* The condition of COND_EXPR is checked in vectorizable_condition(). */ if (i == 0 && code == COND_EXPR) continue; @@ -4025,8 +4023,10 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi, } } - is_simple_use = vect_is_simple_use (ops[i], loop_vinfo, NULL, &def_stmt, - &def, &dt); + is_simple_use = vect_is_simple_use_1 (ops[i], loop_vinfo, NULL, &def_stmt, + &def, &dt, &tem); + if (!vectype_in) + vectype_in = tem; gcc_assert (is_simple_use); gcc_assert (dt == vect_reduction_def || dt == vect_nested_cycle |