From: Richard Sandiford Date: Tue, 10 Dec 2019 12:20:12 +0000 (+0000) Subject: Add missing conversion in vect_create_epilog_for_reduction X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b78500ecb86ef800509270d2d2f161e4eb9aadd0;p=gcc.git Add missing conversion in vect_create_epilog_for_reduction The direct_slp_reduc code in vect_create_epilog_for_reduction was still assuming that all types involved in a reduction are the same (up to types_compatible_p), whereas we now support differences in sign. This was causing an ICE in gcc.dg/vect/pr92324-4.c for SVE. 2019-12-10 Richard Sandiford gcc/ * tree-vect-loop.c (vect_create_epilog_for_reduction): When handling direct_slp_reduc, allow the PHI arguments to have a different type from the vector elements. From-SVN: r279164 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0ca3e15f4c9..ffc2d26d6fb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-12-10 Richard Sandiford + + * tree-vect-loop.c (vect_create_epilog_for_reduction): When + handling direct_slp_reduc, allow the PHI arguments to have + a different type from the vector elements. + 2019-12-10 Richard Sandiford * tree-vect-stmts.c (vectorizable_condition): Record the loop diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index 50f1a227d4e..353a5ff06e1 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -5054,6 +5054,8 @@ vect_create_epilog_for_reduction (stmt_vec_info stmt_info, tree scalar_value = PHI_ARG_DEF_FROM_EDGE (orig_phis[i]->stmt, loop_preheader_edge (loop)); + scalar_value = gimple_convert (&seq, TREE_TYPE (vectype), + scalar_value); vector_identity = gimple_build_vector_from_val (&seq, vectype, scalar_value); }