summaryrefslogtreecommitdiff
path: root/gcc/tree-vect-slp.c
diff options
context:
space:
mode:
authorIra Rosen <ira.rosen@linaro.org>2011-09-18 11:36:15 +0000
committerIra Rosen <irar@gcc.gnu.org>2011-09-18 11:36:15 +0000
commit0e93a64e876d6989680690030a3f428909aeb326 (patch)
tree43bcba88f08bf56542988b0a854a82caa5a57df0 /gcc/tree-vect-slp.c
parentdeaf836ccfe15c19c38dc85c2e6718980b5f0803 (diff)
downloadgcc-0e93a64e876d6989680690030a3f428909aeb326.tar.gz
re PR tree-optimization/50414 (gfortran -Ofast SIGSEGV in store_constructor)
PR tree-optimization/50414 * tree-vect-slp.c (vect_get_constant_vectors): Handle MAX_EXPR and MIN_EXPR. From-SVN: r178941
Diffstat (limited to 'gcc/tree-vect-slp.c')
-rw-r--r--gcc/tree-vect-slp.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 60bc475c75a..669b2bb203c 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -1902,6 +1902,8 @@ vect_get_constant_vectors (tree op, slp_tree slp_node,
bool constant_p, is_store;
tree neutral_op = NULL;
enum tree_code code = gimple_assign_rhs_code (stmt);
+ gimple def_stmt;
+ struct loop *loop;
if (STMT_VINFO_DEF_TYPE (stmt_vinfo) == vect_reduction_def)
{
@@ -1943,8 +1945,16 @@ vect_get_constant_vectors (tree op, slp_tree slp_node,
neutral_op = build_int_cst (TREE_TYPE (op), -1);
break;
+ case MAX_EXPR:
+ case MIN_EXPR:
+ def_stmt = SSA_NAME_DEF_STMT (op);
+ loop = (gimple_bb (stmt))->loop_father;
+ neutral_op = PHI_ARG_DEF_FROM_EDGE (def_stmt,
+ loop_preheader_edge (loop));
+ break;
+
default:
- neutral_op = NULL;
+ neutral_op = NULL;
}
}
@@ -1997,8 +2007,8 @@ vect_get_constant_vectors (tree op, slp_tree slp_node,
if (reduc_index != -1)
{
- struct loop *loop = (gimple_bb (stmt))->loop_father;
- gimple def_stmt = SSA_NAME_DEF_STMT (op);
+ loop = (gimple_bb (stmt))->loop_father;
+ def_stmt = SSA_NAME_DEF_STMT (op);
gcc_assert (loop);