aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2024-06-17 16:01:15 +0200
committerRichard Biener <rguenther@suse.de>2024-06-18 07:46:13 +0200
commit19258ca1b85bc15e3a49054eff209f4f0d1c5bee (patch)
treeb1bfe617ad9a28d24284c7d0133f859adc2e385e /gcc
parent4b75ed33fa5fd604897e7a30e79bd28d46598373 (diff)
downloadgcc-19258ca1b85bc15e3a49054eff209f4f0d1c5bee.zip
gcc-19258ca1b85bc15e3a49054eff209f4f0d1c5bee.tar.gz
gcc-19258ca1b85bc15e3a49054eff209f4f0d1c5bee.tar.bz2
tree-optimization/115493 - fix wrong code with SLP induction cond reduction
The following fixes a bad final value being used when doing single-lane SLP integer induction cond reduction vectorization. PR tree-optimization/115493 * tree-vect-loop.cc (vect_create_epilog_for_reduction): Use the first scalar result.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/tree-vect-loop.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
index d9a2ad6..7c79e9d 100644
--- a/gcc/tree-vect-loop.cc
+++ b/gcc/tree-vect-loop.cc
@@ -6843,8 +6843,8 @@ vect_create_epilog_for_reduction (loop_vec_info loop_vinfo,
with the original initial value, unless induc_val is
the same as initial_def already. */
tree zcompare = make_ssa_name (boolean_type_node);
- epilog_stmt = gimple_build_assign (zcompare, EQ_EXPR, new_temp,
- induc_val);
+ epilog_stmt = gimple_build_assign (zcompare, EQ_EXPR,
+ scalar_results[0], induc_val);
gsi_insert_before (&exit_gsi, epilog_stmt, GSI_SAME_STMT);
tree initial_def = reduc_info->reduc_initial_values[0];
tree tmp = make_ssa_name (new_scalar_dest);