diff options
author | irar <irar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-23 10:42:34 +0000 |
---|---|---|
committer | irar <irar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-23 10:42:34 +0000 |
commit | 59b02a73aec33af8d535887fe61adede4bf11aad (patch) | |
tree | 0c0c6b8de3e63a75580ba19a61a28e2b88532885 /gcc/tree-vect-analyze.c | |
parent | da1cc9ee76a8da7ba2d577ea3111dc1f0abf5cef (diff) | |
download | gcc-59b02a73aec33af8d535887fe61adede4bf11aad.tar.gz |
PR tree-optimization/37174
* tree-vect-analyze.c (vect_get_and_check_slp_defs): Check that the
def stmt is a part of the loop before accessing its stmt_vec_info.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139508 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vect-analyze.c')
-rw-r--r-- | gcc/tree-vect-analyze.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/tree-vect-analyze.c b/gcc/tree-vect-analyze.c index fcb9cbd5a24..0f2efd85ed5 100644 --- a/gcc/tree-vect-analyze.c +++ b/gcc/tree-vect-analyze.c @@ -2508,6 +2508,7 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, slp_tree slp_node, stmt_vec_info stmt_info = vinfo_for_stmt (VEC_index (gimple, SLP_TREE_SCALAR_STMTS (slp_node), 0)); enum gimple_rhs_class rhs_class; + struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo); rhs_class = get_gimple_rhs_class (gimple_assign_rhs_code (stmt)); number_of_oprnds = gimple_num_ops (stmt) - 1; /* RHS only */ @@ -2531,7 +2532,9 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, slp_tree slp_node, /* Check if DEF_STMT is a part of a pattern and get the def stmt from the pattern. Check that all the stmts of the node are in the pattern. */ - if (def_stmt && vinfo_for_stmt (def_stmt) + if (def_stmt && gimple_bb (def_stmt) + && flow_bb_inside_loop_p (loop, gimple_bb (def_stmt)) + && vinfo_for_stmt (def_stmt) && STMT_VINFO_IN_PATTERN_P (vinfo_for_stmt (def_stmt))) { if (!*first_stmt_dt0) |