https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88587
--- Comment #9 from Martin Liška <marxin at gcc dot gnu.org> ---
> I think the canonical way of re-computing DECL_MODE would be to re-layout
> decls since that also updates RTL if that was already set. There's
> relayout_decl for this which is for example called from omp-simd-clone.c
> and the vectorizer.
That's fine, however it eventually calls
SET_DECL_MODE (decl, TYPE_MODE (type));
which calls vector_type_mode (const_tree t)
and
if (VECTOR_MODE_P (mode)
&& (!targetm.vector_mode_supported_p (mode)
|| !have_regs_of_mode[mode]))
{
scalar_int_mode innermode;
/* For integers, try mapping it to a same-sized scalar mode. */
if (is_int_mode (TREE_TYPE (t)->type_common.mode, &innermode))
{
poly_int64 size = (TYPE_VECTOR_SUBPARTS (t)
* GET_MODE_BITSIZE (innermode));
scalar_int_mode mode;
if (int_mode_for_size (size, 0).exists (&mode)
&& have_regs_of_mode[mode]) <--- HERE
return mode;
}
return BLKmode;
}
HERE we return false. Do you know how current_function influences
int_mode_for_size and (or) have_regs_of_mode?