From: Richard Biener Date: Mon, 21 Oct 2019 13:43:19 +0000 (+0000) Subject: re PR tree-optimization/92162 (ICE in vect_create_epilog_for_reduction, at tree-vect... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=53b15ca96116544a7a3ca8bc5f4e1649b74f3d45;p=gcc.git re PR tree-optimization/92162 (ICE in vect_create_epilog_for_reduction, at tree-vect-loop.c:4252) 2019-10-21 Richard Biener 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4139f7f0d6f..8c20cb8c33c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2019-10-21 Richard Biener + + 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 * tree-vectorizer.h (_slp_tree::ops): New member. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d958e642ee0..0259236e416 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-10-21 Richard Biener + + PR tree-optimization/92162 + * gcc.dg/pr92162.c: New testcase. + 2019-10-21 Richard Biener PR tree-optimization/92161 diff --git a/gcc/testsuite/gcc.dg/pr92162.c b/gcc/testsuite/gcc.dg/pr92162.c new file mode 100644 index 00000000000..ed82595a752 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr92162.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-Ofast" } */ + +short int s8; + +void __attribute__ ((simd)) +gn (void) +{ + s8 = 0; +} diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index 9efb797cb77..a4c9f2f4138 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -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: the reduction phi corresponds to NEW_PHI_TREE and the new values 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; - 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, ccompare, indx_before_incr, new_phi_tree); else diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 4c5d33ce952..7f6100e0ec6 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -9818,7 +9818,7 @@ vectorizable_condition (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi, return false; reduc_info = info_for_reduction (stmt_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 || reduc_index != -1); }