https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90756
--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #5)
> The r228175
> (promote_ssa_mode): Disregard BLKmode from promote_decl, and
>
> bypass TYPE_MODE to get the actual vector mode.
>
>
> + /* Bypass TYPE_MODE when it maps vector modes to BLKmode. */
>
> + if (mode == BLKmode)
>
> + {
>
> + gcc_assert (VECTOR_TYPE_P (type));
>
> + mode = type->type_common.mode;
>
> + }
>
> +
>
>
> change looks highly suspicious, that introduces in the IL vector modes that
> aren't really supported. If that was done because some SSA_NAMEs might have
> underlying decl that has DECL_MODE, I'd say we should either treat all
> DECL_MODE similarly to TYPE_MODE, or add more hacks where for vector type
> decls we just ignore DECL_MODE and use corresponding TYPE_MODE (I think we
> have quite a few of those already).
Indeed. We probably need to differentiate callers of promote_ssa_mode.
Like the one in get_temp_reg seems to deal with BLKmode but AFAICS
promote_ssa_mode will never return BLKmode itself? Thus
Index: gcc/tree-outof-ssa.c
===================================================================
--- gcc/tree-outof-ssa.c (revision 272616)
+++ gcc/tree-outof-ssa.c (working copy)
@@ -652,9 +652,10 @@ get_temp_reg (tree name)
{
tree type = TREE_TYPE (name);
int unsignedp;
- machine_mode reg_mode = promote_ssa_mode (name, &unsignedp);
- if (reg_mode == BLKmode)
+ if (TYPE_MODE (type) == BLKmode)
return assign_temp (type, 0, 0);
+ machine_mode reg_mode = promote_ssa_mode (name, &unsignedp);
+ gcc_assert (reg_mode != BLKmode);
rtx x = gen_reg_rtx (reg_mode);
if (POINTER_TYPE_P (type))
mark_reg_pointer (x, TYPE_ALIGN (TREE_TYPE (type)));
the original change may have been motivated by ABI boundary issues
of caller/callee mismatching in what ISA they support despite having
arguments whose ABI depend on that?