diff options
author | Ulrich Weigand <ulrich.weigand@linaro.org> | 2012-04-10 10:56:11 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@gcc.gnu.org> | 2012-04-10 10:56:11 +0000 |
commit | c0d942d2117b785d768c5f2ab2813e4781e29e43 (patch) | |
tree | 9f559ce5f418780d6e5c5935bdbfec342c5aa91f /gcc/tree-vect-patterns.c | |
parent | 5973ae1ac297b881e712b44335a231e892e6af25 (diff) | |
download | gcc-c0d942d2117b785d768c5f2ab2813e4781e29e43.zip gcc-c0d942d2117b785d768c5f2ab2813e4781e29e43.tar.gz gcc-c0d942d2117b785d768c5f2ab2813e4781e29e43.tar.bz2 |
re PR tree-optimization/52870 (ICE during SLP pattern matching)
gcc/
PR tree-optimization/52870
* tree-vect-patterns.c (vect_recog_widen_mult_pattern): Verify that
presumed pattern statement is within the same loop or basic block.
gcc/testsuite/
PR tree-optimization/52870
* gcc.dg/vect/pr52870.c: New test.
From-SVN: r186272
Diffstat (limited to 'gcc/tree-vect-patterns.c')
-rw-r--r-- | gcc/tree-vect-patterns.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c index b871c0b..6372a36 100644 --- a/gcc/tree-vect-patterns.c +++ b/gcc/tree-vect-patterns.c @@ -564,6 +564,16 @@ vect_recog_widen_mult_pattern (VEC (gimple, heap) **stmts, VEC (tree, heap) *dummy_vec; bool op1_ok; bool promotion; + loop_vec_info loop_vinfo; + struct loop *loop = NULL; + bb_vec_info bb_vinfo; + stmt_vec_info stmt_vinfo; + + stmt_vinfo = vinfo_for_stmt (last_stmt); + loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_vinfo); + bb_vinfo = STMT_VINFO_BB_VINFO (stmt_vinfo); + if (loop_vinfo) + loop = LOOP_VINFO_LOOP (loop_vinfo); if (!is_gimple_assign (last_stmt)) return NULL; @@ -635,6 +645,11 @@ vect_recog_widen_mult_pattern (VEC (gimple, heap) **stmts, || gimple_assign_rhs_code (use_stmt) != NOP_EXPR) return NULL; + if (!gimple_bb (use_stmt) + || (loop && !flow_bb_inside_loop_p (loop, gimple_bb (use_stmt))) + || (!loop && gimple_bb (use_stmt) != BB_VINFO_BB (bb_vinfo))) + return NULL; + use_lhs = gimple_assign_lhs (use_stmt); use_type = TREE_TYPE (use_lhs); if (!INTEGRAL_TYPE_P (use_type) |