From 2935d9941464d64964a1885f5fcabcb0aa5290e5 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Tue, 12 Jan 2016 08:36:24 +0000 Subject: re PR tree-optimization/69168 (ICE in vect_analyze_loop_2, at tree-vect-loop.c:2182) 2016-01-12 Richard Biener PR tree-optimization/69168 * tree-vect-loop.c (vect_analyze_loop_2): Reset both main and pattern stmt SLP type. * tree-vect-slp.c (vect_detect_hybrid_slp_stmts): Patterns may end up unused so cope with that case. * gcc.dg/torture/pr69168.c: New testcase. From-SVN: r232261 --- gcc/tree-vect-slp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gcc/tree-vect-slp.c') diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index d185838..7ad7c12 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -2016,10 +2016,10 @@ vect_detect_hybrid_slp_stmts (slp_tree node, unsigned i, slp_vect_type stype) { /* Check if a pure SLP stmt has uses in non-SLP stmts. */ gcc_checking_assert (PURE_SLP_STMT (stmt_vinfo)); - /* We always get the pattern stmt here, but for immediate - uses we have to use the LHS of the original stmt. */ - gcc_checking_assert (!STMT_VINFO_IN_PATTERN_P (stmt_vinfo)); - if (STMT_VINFO_RELATED_STMT (stmt_vinfo)) + /* If we get a pattern stmt here we have to use the LHS of the + original stmt for immediate uses. */ + if (! STMT_VINFO_IN_PATTERN_P (stmt_vinfo) + && STMT_VINFO_RELATED_STMT (stmt_vinfo)) stmt = STMT_VINFO_RELATED_STMT (stmt_vinfo); if (TREE_CODE (gimple_op (stmt, 0)) == SSA_NAME) FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, gimple_op (stmt, 0)) -- cgit v1.1