https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88587
--- Comment #10 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Martin Liška from comment #9)
> > 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?
ok, happens here:
#0 ix86_conditional_register_usage () at
/home/marxin/Programming/gcc/gcc/config/i386/i386.c:4802
#1 0x0000000000ed04a0 in init_reg_sets_1 () at
/home/marxin/Programming/gcc/gcc/reginfo.c:270
#2 0x0000000000f68b61 in target_reinit () at
/home/marxin/Programming/gcc/gcc/toplev.c:2009
#3 0x0000000001a9f336 in save_target_globals () at
/home/marxin/Programming/gcc/gcc/target-globals.c:86
#4 0x0000000001373dbc in ix86_set_current_function (fndecl=<function_decl
0x7ffff6c5c800 a.sse2.0>) at
/home/marxin/Programming/gcc/gcc/config/i386/i386.c:5768
#5 0x0000000000baa150 in invoke_set_current_function_hook
(fndecl=<function_decl 0x7ffff6c5c800 a.sse2.0>) at
/home/marxin/Programming/gcc/gcc/function.c:4629
#6 0x0000000000bb1175 in invoke_set_current_function_hook (fndecl=<optimized
out>) at /home/marxin/Programming/gcc/gcc/function.c:4613
#7 set_cfun (new_cfun=<optimized out>, force=<optimized out>) at
/home/marxin/Programming/gcc/gcc/function.c:4653