Commit f5d3c7e1 by Ira Rosen Committed by Ira Rosen

re PR middle-end/37174 (ICE: in vinfo_for_stmt, at tree-vectorizer.h:546)

	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.

From-SVN: r139508
parent ae96d86a
2008-08-23 Ira Rosen <irar@il.ibm.com>
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.
2008-08-22 Anatoly Sokolov <aesok@post.ru> 2008-08-22 Anatoly Sokolov <aesok@post.ru>
PR target/11259 PR target/11259
......
2008-08-23 Ira Rosen <irar@il.ibm.com>
PR tree-optimization/37174
* g++.dg/vect/pr37174.cc: New test.
2008-08-22 Richard Guenther <rguenther@suse.de> 2008-08-22 Richard Guenther <rguenther@suse.de>
PR tree-optimization/37078 PR tree-optimization/37078
......
/* { dg-do compile } */
int* getFoo();
struct Bar {
Bar();
int* foo1;
int* foo2;
int* table[4][4][4];
};
Bar::Bar() {
foo1 = getFoo();
foo2 = getFoo();
for (int a = 0; a < 4; ++a) {
for (int b = 0; b < 4; ++b) {
for (int c = 0; c < 4; ++c) {
table[a][b][c] = foo1;
}
}
}
}
/* { dg-final { cleanup-tree-dump "vect" } } */
...@@ -2508,6 +2508,7 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, slp_tree slp_node, ...@@ -2508,6 +2508,7 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, slp_tree slp_node,
stmt_vec_info stmt_info = stmt_vec_info stmt_info =
vinfo_for_stmt (VEC_index (gimple, SLP_TREE_SCALAR_STMTS (slp_node), 0)); vinfo_for_stmt (VEC_index (gimple, SLP_TREE_SCALAR_STMTS (slp_node), 0));
enum gimple_rhs_class rhs_class; 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)); rhs_class = get_gimple_rhs_class (gimple_assign_rhs_code (stmt));
number_of_oprnds = gimple_num_ops (stmt) - 1; /* RHS only */ 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, ...@@ -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 /* 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 the pattern. Check that all the stmts of the node are in the
pattern. */ 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))) && STMT_VINFO_IN_PATTERN_P (vinfo_for_stmt (def_stmt)))
{ {
if (!*first_stmt_dt0) if (!*first_stmt_dt0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment