]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-optimization/115493 - complete previous fix
authorRichard Biener <rguenther@suse.de>
Wed, 26 Jun 2024 17:11:04 +0000 (19:11 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 27 Jun 2024 05:52:51 +0000 (07:52 +0200)
The following fixes the 2nd occurance of new_temp missed with the
previous fix.

PR tree-optimization/115493
* tree-vect-loop.cc (vect_create_epilog_for_reduction): Use
first scalar result.

gcc/tree-vect-loop.cc

index 347dac97e497e6abba70c8fbd282439cdd9fa49b..6f32867f85a3b78d315e764de0a6e53ad5940d56 100644 (file)
@@ -6849,7 +6849,7 @@ vect_create_epilog_for_reduction (loop_vec_info loop_vinfo,
          tree initial_def = reduc_info->reduc_initial_values[0];
          tree tmp = make_ssa_name (new_scalar_dest);
          epilog_stmt = gimple_build_assign (tmp, COND_EXPR, zcompare,
-                                            initial_def, new_temp);
+                                            initial_def, scalar_results[0]);
          gsi_insert_before (&exit_gsi, epilog_stmt, GSI_SAME_STMT);
          scalar_results[0] = tmp;
        }