From a7ce6ec39314e69d2789bf4175983fb687225006 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Mon, 20 Feb 2012 15:15:52 +0000 Subject: re PR tree-optimization/52298 (ICE: verify_ssa failed: definition in block follows use) 2012-02-20 Richard Guenther PR tree-optimization/52298 * tree-vect-stmts.c (vectorizable_store): Properly use STMT_VINFO_DR_STEP instead of DR_STEP when vectorizing outer loops. (vectorizable_load): Likewise. * tree-vect-data-refs.c (vect_analyze_data_ref_access): Access DR_STEP after ensuring it is not NULL. * gcc.dg/torture/pr52298.c: New testcase. * gcc.dg/vect/pr52298.c: Likewise. From-SVN: r184396 --- gcc/tree-vect-stmts.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'gcc/tree-vect-stmts.c') diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 20f10f3..f0b3dae 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -3753,7 +3753,9 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, if (!STMT_VINFO_DATA_REF (stmt_info)) return false; - if (tree_int_cst_compare (DR_STEP (dr), size_zero_node) < 0) + if (tree_int_cst_compare (loop && nested_in_vect_loop_p (loop, stmt) + ? STMT_VINFO_DR_STEP (stmt_info) : DR_STEP (dr), + size_zero_node) < 0) { if (vect_print_dump_info (REPORT_DETAILS)) fprintf (vect_dump, "negative step for store."); @@ -4266,7 +4268,10 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, if (!STMT_VINFO_DATA_REF (stmt_info)) return false; - negative = tree_int_cst_compare (DR_STEP (dr), size_zero_node) < 0; + negative = tree_int_cst_compare (loop && nested_in_vect_loop_p (loop, stmt) + ? STMT_VINFO_DR_STEP (stmt_info) + : DR_STEP (dr), + size_zero_node) < 0; if (negative && ncopies > 1) { if (vect_print_dump_info (REPORT_DETAILS)) @@ -4654,7 +4659,7 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, nested within an outer-loop that is being vectorized. */ if (loop && nested_in_vect_loop_p (loop, stmt) - && (TREE_INT_CST_LOW (DR_STEP (dr)) + && (TREE_INT_CST_LOW (STMT_VINFO_DR_STEP (stmt_info)) % GET_MODE_SIZE (TYPE_MODE (vectype)) != 0)) { gcc_assert (alignment_support_scheme != dr_explicit_realign_optimized); -- cgit v1.1