On 7/29/25 14:44, Richard Sandiford wrote:
> External email: Use caution opening links or attachments
>
>
> function_expander::get_reg_target didn't actually check for a register,
> meaning that it could return a memory target instead.  That doesn't
> really matter for the current direct and indirect uses (svundef*,
> svcreate*, and svset*) but it will for later patches.
>
> Tested on aarch64-linux-gnu.  OK to install?

Looks good to me,

Remi

>
> Richard
>
>
> gcc/
>          * config/aarch64/aarch64-sve-builtins.cc
>          (function_expander::get_reg_target): Check whether the target
>          is a valid register_operand.
> ---
>   gcc/config/aarch64/aarch64-sve-builtins.cc | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/gcc/config/aarch64/aarch64-sve-builtins.cc 
> b/gcc/config/aarch64/aarch64-sve-builtins.cc
> index 2b627a95060..01833a8de73 100644
> --- a/gcc/config/aarch64/aarch64-sve-builtins.cc
> +++ b/gcc/config/aarch64/aarch64-sve-builtins.cc
> @@ -4004,7 +4004,8 @@ rtx
>   function_expander::get_reg_target ()
>   {
>     machine_mode target_mode = result_mode ();
> -  if (!possible_target || GET_MODE (possible_target) != target_mode)
> +  if (!possible_target
> +      || !register_operand (possible_target, target_mode))
>       possible_target = gen_reg_rtx (target_mode);
>     return possible_target;
>   }
> --
> 2.43.0
>

Reply via email to