diff options
author | Richard Biener <rguenther@suse.de> | 2018-11-09 12:29:51 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2018-11-09 12:29:51 +0000 |
commit | 89939ff85a7c2ed0c1eb33e51d241f2a6dda0695 (patch) | |
tree | 69a07fb15744d86dde1bcaf44a3b76c118d250df /gcc/tree-vect-loop.c | |
parent | 3965b35f341cc99a10876518f707740a9e912a01 (diff) | |
download | gcc-89939ff85a7c2ed0c1eb33e51d241f2a6dda0695.zip gcc-89939ff85a7c2ed0c1eb33e51d241f2a6dda0695.tar.gz gcc-89939ff85a7c2ed0c1eb33e51d241f2a6dda0695.tar.bz2 |
re PR c/87953 (asan: stack-buffer-overflow in vectorizable_reduction)
2018-11-09 Richard Biener <rguenther@suse.de>
PR tree-optimization/87953
* tree-vect-loop.c (vectorizable_reduction): For analysis
always pass ops[0] to vectorizable_condition.
From-SVN: r265964
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r-- | gcc/tree-vect-loop.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index 7338ca5..0dc84f1 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -6485,9 +6485,10 @@ vectorizable_reduction (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi, if (code == COND_EXPR) { /* Only call during the analysis stage, otherwise we'll lose - STMT_VINFO_TYPE. */ + STMT_VINFO_TYPE. We'll pass ops[0] as reduc_op, it's only + used as a flag during analysis. */ if (!vec_stmt && !vectorizable_condition (stmt_info, gsi, NULL, - ops[reduc_index], 0, NULL, + ops[0], 0, NULL, cost_vec)) { if (dump_enabled_p ()) |