This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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 ())


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]