aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2024-07-25 12:46:30 +0200
committerRichard Biener <rguenth@gcc.gnu.org>2024-07-25 13:44:52 +0200
commit3f578dbac726d47b043b82606c47e5676c5d6a14 (patch)
treee62ce4a214bfb5cc540e7066d4a073a36bd033e6
parent56ff5f83dda52f73e736a748e43640396d26257b (diff)
downloadgcc-3f578dbac726d47b043b82606c47e5676c5d6a14.zip
gcc-3f578dbac726d47b043b82606c47e5676c5d6a14.tar.gz
gcc-3f578dbac726d47b043b82606c47e5676c5d6a14.tar.bz2
tree-optimization/116081 - typedef vs. non-typedef in vectorization
The following fixes the code generation difference when using a typedef for the scalar type. The issue is using a pointer equality test for an INTEGER_CST which fails when the types are different variants. PR tree-optimization/116081 * tree-vect-loop.cc (get_initial_defs_for_reduction): Use operand_equal_p for comparing the element with the neutral op.
-rw-r--r--gcc/tree-vect-loop.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
index d7d628e..856ce49 100644
--- a/gcc/tree-vect-loop.cc
+++ b/gcc/tree-vect-loop.cc
@@ -5652,7 +5652,7 @@ get_initial_defs_for_reduction (loop_vec_info loop_vinfo,
init = gimple_build_vector_from_val (&ctor_seq, vector_type,
neutral_op);
int k = nunits;
- while (k > 0 && elts[k - 1] == neutral_op)
+ while (k > 0 && operand_equal_p (elts[k - 1], neutral_op))
k -= 1;
while (k > 0)
{