[PATCH 3/4] remove %K from error() calls in the aarch64/arm back ends (PR 98512)

Richard Sandiford richard.sandiford@arm.com
Fri Jun 11 09:58:33 GMT 2021


Martin Sebor via Gcc-patches <gcc-patches@gcc.gnu.org> writes:
> diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
> index 7b37e1b602c..7cdc824730c 100644
> --- a/gcc/config/arm/arm.c
> +++ b/gcc/config/arm/arm.c
> @@ -13242,13 +13242,8 @@ bounds_check (rtx operand, HOST_WIDE_INT low, HOST_WIDE_INT high,
>    lane = INTVAL (operand);
>  
>    if (lane < low || lane >= high)
> -    {
> -      if (exp)
> -	error ("%K%s %wd out of range %wd - %wd",
> -	       exp, desc, lane, low, high - 1);
> -      else
> -	error ("%s %wd out of range %wd - %wd", desc, lane, low, high - 1);
> -    }
> +    error_at (EXPR_LOCATION (exp),
> +	      "%s %wd out of range %wd - %wd", desc, lane, low, high - 1);
>  }
>  
>  /* Bounds-check lanes.  */

This part doesn't look safe: “exp” is null when called from arm_const_bounds.

Thanks,
Richard


More information about the Gcc-patches mailing list