summaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-02 15:46:46 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-02 15:46:46 +0000
commitfae41702a37f645810d8d9eac9475d2bfbe7fdea (patch)
tree4bf25db32c0a793b3c50814ec81909468ef7fe23 /gcc/tree-vect-loop.c
parent03725f7fdcda3f73ce9254c252015723705fc387 (diff)
downloadgcc-fae41702a37f645810d8d9eac9475d2bfbe7fdea.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166194 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r--gcc/tree-vect-loop.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index c213673e20b..57ca5a8c4c4 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