On Mon, May 11, 2026 at 3:34 AM Naveen
<[email protected]> wrote:
>
> aarch64_output_simd_mov_imm_low emits the instruction directly using
> output_asm_insn and returns an empty string to indicate that no further
> template needs to be emitted.  Since the returned empty string is a string
> literal, the function should return const char * rather than char *.
>
> This fixes a bootstrap failure with -Werror=write-strings.
>
> gcc/ChangeLog:
>
>         * config/aarch64/aarch64-protos.h (aarch64_output_simd_mov_imm_low):
>         Change return type to const char *.
>         * config/aarch64/aarch64.cc (aarch64_output_simd_mov_imm_low): 
> Likewise.

Ok.

>
> Signed-off-by: Naveen <[email protected]>
> ---
>  gcc/config/aarch64/aarch64-protos.h | 2 +-
>  gcc/config/aarch64/aarch64.cc       | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gcc/config/aarch64/aarch64-protos.h 
> b/gcc/config/aarch64/aarch64-protos.h
> index 0798546809d..8d201821e93 100644
> --- a/gcc/config/aarch64/aarch64-protos.h
> +++ b/gcc/config/aarch64/aarch64-protos.h
> @@ -952,7 +952,7 @@ char *aarch64_output_simd_and_imm (rtx, unsigned);
>  char *aarch64_output_simd_xor_imm (rtx, unsigned);
>  char *aarch64_output_fmov (rtx);
>
> -char *aarch64_output_simd_mov_imm_low (rtx *);
> +const char *aarch64_output_simd_mov_imm_low (rtx *);
>  char *aarch64_output_sve_mov_immediate (rtx);
>  char *aarch64_output_sve_ptrues (rtx);
>  bool aarch64_const_vec_fmov_p (rtx);
> diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc
> index 619c2a6d226..cd5ed154c7a 100644
> --- a/gcc/config/aarch64/aarch64.cc
> +++ b/gcc/config/aarch64/aarch64.cc
> @@ -24650,7 +24650,7 @@ aarch64_const_vec_fmov_p (rtx op)
>
>  /* Output a move of an FP constant vector in which the low register element 
> is
>     materialized using FMOV and all other elements are zero.  */
> -char *
> +const char *
>  aarch64_output_simd_mov_imm_low (rtx *operands)
>  {
>    machine_mode mode = GET_MODE (operands[1]);
> --
> 2.34.1
>

Reply via email to