This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR87953
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 9 Nov 2018 13:29:02 +0100 (CET)
- Subject: [PATCH] Fix PR87953
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.
Richard.
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.
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 22bed26609b..dad6524ee2b 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -6525,9 +6525,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 ())