From dd34c087ffe7a798835fb95c7eb3dd68afd08f08 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 11 Nov 2011 20:56:13 +0100 Subject: re PR tree-optimization/51058 (ICE: gimple check: expected gimple_assign(error_mark), have gimple_call() in gimple_assign_rhs_code, at gimple.h:1992) PR tree-optimization/51058 * tree-vect-slp.c (vect_remove_slp_scalar_calls): New function. (vect_schedule_slp): Call it. * tree-vect-stmts.c (vectorizable_call): If slp_node != NULL, don't replace scalar calls with setting of their lhs to zero here. * gcc.dg/vect/fast-math-vect-call-1.c: Add f4 test. * gfortran.dg/vect/pr51058-2.f90: New test. From-SVN: r181298 --- gcc/tree-vect-stmts.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gcc/tree-vect-stmts.c') diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index abccd92..93e8198 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -1886,6 +1886,9 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, it defines is mapped to the new definition. So just replace rhs of the statement with something harmless. */ + if (slp_node) + return true; + type = TREE_TYPE (scalar_dest); if (is_pattern_stmt_p (stmt_info)) lhs = gimple_call_lhs (STMT_VINFO_RELATED_STMT (stmt_info)); @@ -1893,8 +1896,7 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, lhs = gimple_call_lhs (stmt); new_stmt = gimple_build_assign (lhs, build_zero_cst (type)); set_vinfo_for_stmt (new_stmt, stmt_info); - if (!slp_node) - set_vinfo_for_stmt (stmt, NULL); + set_vinfo_for_stmt (stmt, NULL); STMT_VINFO_STMT (stmt_info) = new_stmt; gsi_replace (gsi, new_stmt, false); SSA_NAME_DEF_STMT (gimple_assign_lhs (new_stmt)) = new_stmt; -- cgit v1.1