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
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.
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.
--- /dev/null
+/* { 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;
+ }
+}
+
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))
{
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;
}
}
- 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