From 1ece8d4c77cb51f2ac719e7d5cdec740796c67b0 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Wed, 13 May 2015 14:38:19 +0000 Subject: [PATCH] re PR tree-optimization/66129 (FAIL: gcc.dg/vect/vect-strided-*c execution test) 2015-05-13 Richard Biener PR tree-optimization/66129 * tree-vect-slp.c (vect_build_slp_tree): Make sure all ops are commutative. (vect_schedule_slp_instance): Fix typo. From-SVN: r223164 --- gcc/ChangeLog | 7 +++++++ gcc/tree-vect-slp.c | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ada1757d34a..c7cd1ab9449 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2015-05-13 Richard Biener + + PR tree-optimization/66129 + * tree-vect-slp.c (vect_build_slp_tree): Make sure all ops are + commutative. + (vect_schedule_slp_instance): Fix typo. + 2015-05-13 David Malcolm * common.opt (fdump-internal-locations): New option. diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index c675b1cf5db..b78f7d82d35 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -1123,6 +1123,7 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, && oprnds_info[1]->first_dt == vect_internal_def && is_gimple_assign (stmt) && commutative_tree_code (gimple_assign_rhs_code (stmt)) + && !SLP_TREE_TWO_OPERATORS (*node) /* Do so only if the number of not successful permutes was nor more than a cut-ff as re-trying the recursive match on possibly each level of the tree would expose exponential @@ -3459,7 +3460,7 @@ vect_schedule_slp_instance (slp_tree node, slp_instance instance, tree *melts = XALLOCAVEC (tree, TYPE_VECTOR_SUBPARTS (vectype)); for (l = 0; l < TYPE_VECTOR_SUBPARTS (vectype); ++l) { - if (k > group_size) + if (k >= group_size) k = 0; melts[l] = build_int_cst (meltype, mask[k++] * TYPE_VECTOR_SUBPARTS (vectype) + l); -- 2.30.2