https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69053
--- Comment #3 from alalaw01 at gcc dot gnu.org --- Well, this fixes it, but I'm not sure it fixes it in the right place... diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index ee32166..bd66aa5 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -4178,7 +4178,9 @@ get_initial_def_for_reduction (gimple *stmt, tree init_val break; } } - init_def = build_vector_from_val (vectype, init_value); + init_def = build_vector_from_val (vectype, + fold_convert (TREE_TYPE (vectype), + init_value)); break; default: