aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-slp.c
diff options
context:
space:
mode:
authorIra Rosen <ira.rosen@linaro.org>2011-09-22 07:21:07 +0000
committerIra Rosen <irar@gcc.gnu.org>2011-09-22 07:21:07 +0000
commit29ed4920e8f131a9c315be88ab1a9dcd9c5ccc59 (patch)
treeacf4c7ff9710dd5dd58db601b2596de7f7e45c83 /gcc/tree-vect-slp.c
parentf0d070991398a5619b043ab830814b6df0d5898a (diff)
downloadgcc-29ed4920e8f131a9c315be88ab1a9dcd9c5ccc59.zip
gcc-29ed4920e8f131a9c315be88ab1a9dcd9c5ccc59.tar.gz
gcc-29ed4920e8f131a9c315be88ab1a9dcd9c5ccc59.tar.bz2
re PR middle-end/50451 (internal compiler error at tree-vect-loop.c:3557)
PR tree-optimization/50451 * tree-vect-slp.c (vect_get_constant_vectors): Don't fail for constant operands in reduction. (vect_get_slp_defs): Don't create vector operand for NULL scalar operand. From-SVN: r179079
Diffstat (limited to 'gcc/tree-vect-slp.c')
-rw-r--r--gcc/tree-vect-slp.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 669b2bb..9171ba9 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -1905,14 +1905,9 @@ vect_get_constant_vectors (tree op, slp_tree slp_node,
gimple def_stmt;
struct loop *loop;
- if (STMT_VINFO_DEF_TYPE (stmt_vinfo) == vect_reduction_def)
+ if (STMT_VINFO_DEF_TYPE (stmt_vinfo) == vect_reduction_def
+ && reduc_index != -1)
{
- if (reduc_index == -1)
- {
- VEC_free (tree, heap, *vec_oprnds);
- return;
- }
-
op_num = reduc_index - 1;
op = gimple_op (stmt, reduc_index);
/* For additional copies (see the explanation of NUMBER_OF_COPIES below)
@@ -2164,7 +2159,7 @@ vect_get_slp_defs (tree op0, tree op1, slp_tree slp_node,
return;
code = gimple_assign_rhs_code (first_stmt);
- if (get_gimple_rhs_class (code) != GIMPLE_BINARY_RHS || !vec_oprnds1)
+ if (get_gimple_rhs_class (code) != GIMPLE_BINARY_RHS || !vec_oprnds1 || !op1)
return;
/* The number of vector defs is determined by the number of vector statements