https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114801

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #5)
> So (completely untested):
> --- gcc/config/arm/arm-mve-builtins.cc.jj     2024-03-19 09:51:05.203631194 
> +0100
> +++ gcc/config/arm/arm-mve-builtins.cc        2024-04-26 15:49:55.380344060 
> +0200
> @@ -2100,7 +2100,12 @@ function_expander::add_input_operand (in
>        mode = GET_MODE (x);
>      }
>    else if (VALID_MVE_PRED_MODE (mode))
> -    x = gen_lowpart (mode, x);
> +    {
> +      if (mode == HImode && GET_MODE (x) != HImode)
> +     /* GCC promotes QI/HImode arguments to int, undo that
> +        here.  */
> +     x = lowpart_subreg (mode, x, SImode);

Perhaps even
      else
        gcc_assert (GET_MODE (x) == mode);
here?

Reply via email to