Commit 53b15ca9 by Richard Biener Committed by Richard Biener

re PR tree-optimization/92162 (ICE in vect_create_epilog_for_reduction, at tree-vect-loop.c:4252)

2019-10-21  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/92162
	* tree-vect-loop.c (vect_create_epilog_for_reduction): Lookup
	STMT_VINFO_REDUC_IDX in reduc_info.
	* tree-vect-stmts.c (vectorizable_condition): Likewise.

	* gcc.dg/pr92162.c: New testcase.

From-SVN: r277261
parent aa7710cb
2019-10-21 Richard Biener <rguenther@suse.de> 2019-10-21 Richard Biener <rguenther@suse.de>
PR tree-optimization/92162
* tree-vect-loop.c (vect_create_epilog_for_reduction): Lookup
STMT_VINFO_REDUC_IDX in reduc_info.
* tree-vect-stmts.c (vectorizable_condition): Likewise.
2019-10-21 Richard Biener <rguenther@suse.de>
* tree-vectorizer.h (_slp_tree::ops): New member. * tree-vectorizer.h (_slp_tree::ops): New member.
(SLP_TREE_SCALAR_OPS): New. (SLP_TREE_SCALAR_OPS): New.
(vect_get_slp_defs): Adjust prototype. (vect_get_slp_defs): Adjust prototype.
2019-10-21 Richard Biener <rguenther@suse.de> 2019-10-21 Richard Biener <rguenther@suse.de>
PR tree-optimization/92162
* gcc.dg/pr92162.c: New testcase.
2019-10-21 Richard Biener <rguenther@suse.de>
PR tree-optimization/92161 PR tree-optimization/92161
* gfortran.dg/pr92161.f: New testcase. * gfortran.dg/pr92161.f: New testcase.
......
/* { dg-do compile } */
/* { dg-options "-Ofast" } */
short int s8;
void __attribute__ ((simd))
gn (void)
{
s8 = 0;
}
...@@ -4259,9 +4259,9 @@ vect_create_epilog_for_reduction (stmt_vec_info stmt_info, ...@@ -4259,9 +4259,9 @@ vect_create_epilog_for_reduction (stmt_vec_info stmt_info,
(CCOMPARE). The then and else values mirror the main VEC_COND_EXPR: (CCOMPARE). The then and else values mirror the main VEC_COND_EXPR:
the reduction phi corresponds to NEW_PHI_TREE and the new values the reduction phi corresponds to NEW_PHI_TREE and the new values
correspond to INDEX_BEFORE_INCR. */ correspond to INDEX_BEFORE_INCR. */
gcc_assert (STMT_VINFO_REDUC_IDX (stmt_info) >= 1); gcc_assert (STMT_VINFO_REDUC_IDX (reduc_info) >= 1);
tree index_cond_expr; tree index_cond_expr;
if (STMT_VINFO_REDUC_IDX (stmt_info) == 2) if (STMT_VINFO_REDUC_IDX (reduc_info) == 2)
index_cond_expr = build3 (VEC_COND_EXPR, cr_index_vector_type, index_cond_expr = build3 (VEC_COND_EXPR, cr_index_vector_type,
ccompare, indx_before_incr, new_phi_tree); ccompare, indx_before_incr, new_phi_tree);
else else
......
...@@ -9818,7 +9818,7 @@ vectorizable_condition (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi, ...@@ -9818,7 +9818,7 @@ vectorizable_condition (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi,
return false; return false;
reduc_info = info_for_reduction (stmt_info); reduc_info = info_for_reduction (stmt_info);
reduction_type = STMT_VINFO_REDUC_TYPE (reduc_info); reduction_type = STMT_VINFO_REDUC_TYPE (reduc_info);
reduc_index = STMT_VINFO_REDUC_IDX (stmt_info); reduc_index = STMT_VINFO_REDUC_IDX (reduc_info);
gcc_assert (reduction_type != EXTRACT_LAST_REDUCTION gcc_assert (reduction_type != EXTRACT_LAST_REDUCTION
|| reduc_index != -1); || reduc_index != -1);
} }
......
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