diff options
author | Richard Biener <rguenther@suse.de> | 2024-02-23 11:21:20 +0100 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2024-05-08 14:30:39 +0200 |
commit | b65cc09f9c78633a4f29d458a0549f36627c1259 (patch) | |
tree | f94bbcb578377567599e6dfeeebf6f8dec5487f8 /gcc | |
parent | b6822bf3e3f3ff37d64be700f139c8fce3a9bf44 (diff) | |
download | gcc-b65cc09f9c78633a4f29d458a0549f36627c1259.zip gcc-b65cc09f9c78633a4f29d458a0549f36627c1259.tar.gz gcc-b65cc09f9c78633a4f29d458a0549f36627c1259.tar.bz2 |
Fix SLP reduction initial value for pointer reductions
For pointer reductions we need to convert the initial value to
the vector component integer type.
* tree-vect-loop.cc (get_initial_defs_for_reduction): Convert
initial value to the vector component type.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/tree-vect-loop.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc index 29c03c2..704df7b 100644 --- a/gcc/tree-vect-loop.cc +++ b/gcc/tree-vect-loop.cc @@ -5618,7 +5618,14 @@ get_initial_defs_for_reduction (loop_vec_info loop_vinfo, if (i >= initial_values.length () || (j > i && neutral_op)) op = neutral_op; else - op = initial_values[i]; + { + if (!useless_type_conversion_p (TREE_TYPE (vector_type), + TREE_TYPE (initial_values[i]))) + initial_values[i] = gimple_convert (&ctor_seq, + TREE_TYPE (vector_type), + initial_values[i]); + op = initial_values[i]; + } /* Create 'vect_ = {op0,op1,...,opn}'. */ number_of_places_left_in_vector--; |