diff options
author | Richard Biener <rguenther@suse.de> | 2017-10-20 13:43:47 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2017-10-20 13:43:47 +0000 |
commit | 51e28fffbec42be94bd281b0234a38774bdf6c21 (patch) | |
tree | 9feffb715cb9f02b75df4a6078b253ad11794539 /gcc/tree-vect-loop.c | |
parent | 5c5f0b65eebe36489d5c44a3d138c2844049d4c0 (diff) | |
download | gcc-51e28fffbec42be94bd281b0234a38774bdf6c21.zip gcc-51e28fffbec42be94bd281b0234a38774bdf6c21.tar.gz gcc-51e28fffbec42be94bd281b0234a38774bdf6c21.tar.bz2 |
re PR tree-optimization/82473 (ICE in vect_get_vec_def_for_stmt_copy, at tree-vect-stmts.c:1524)
2017-10-20 Richard Biener <rguenther@suse.de>
PR tree-optimization/82473
* tree-vect-loop.c (vectorizable_reduction): Properly get at
the largest input type.
* gcc.dg/torture/pr82473.c: New testcase.
From-SVN: r253937
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r-- | gcc/tree-vect-loop.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index 7a0f9d5..7fb09c4 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -5836,9 +5836,12 @@ vectorizable_reduction (gimple *stmt, gimple_stmt_iterator *gsi, reduc_index = i; continue; } - else + else if (tem) { - if (!vectype_in) + /* To properly compute ncopies we are interested in the widest + input type in case we're looking at a widening accumulation. */ + if (!vectype_in + || TYPE_VECTOR_SUBPARTS (vectype_in) > TYPE_VECTOR_SUBPARTS (tem)) vectype_in = tem; } |