https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125696
--- Comment #6 from Drea Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #5)
> (simplify
> (view_convert CONSTRUCTOR@0)
> (with
> { tree ctor = (TREE_CODE (@0) == SSA_NAME
> ? gimple_assign_rhs1 (SSA_NAME_DEF_STMT (@0)) : @0); }
> (switch
> (if (CONSTRUCTOR_NELTS (ctor) == 0)
> { build_zero_cst (type); })
> (if (CONSTRUCTOR_NELTS (ctor) == 1
> && VECTOR_TYPE_P (TREE_TYPE (ctor))
> && operand_equal_p (TYPE_SIZE (type),
> TYPE_SIZE (TREE_TYPE
> (CONSTRUCTOR_ELT (ctor, 0)->value))))
> (view_convert { CONSTRUCTOR_ELT (ctor, 0)->value; })))))
>
> should handle this?
Yes if we used fold_build1 instead of build1 in a few places :).