On 19/11/2024 10:24, Torbjörn SVENSSON wrote:
> Update test cases to use -mcpu=unset/-march=unset feature introduced in
> r15-3606-g7d6c6a0d15c.
> 
> gcc/testsuite/ChangeLog:
>       * gcc.dg/pr41574.c: Added option "-mcpu=unset".
>       * gcc.dg/pr59418.c: Likewise.
>       * lib/target-supports.exp (add_options_for_vect_early_break):
>       Likewise.
>       (add_options_for_arm_v8_neon): Likewise.
>       (check_effective_target_arm_neon_ok_nocache): Likewise.
>       (check_effective_target_arm_simd32_ok_nocache): Likewise.
>       (check_effective_target_arm_sat_ok_nocache): Likewise.
>       (check_effective_target_arm_dsp_ok_nocache): Likewise.
>       (check_effective_target_arm_crc_ok_nocache): Likewise.
>       (add_options_for_aarch64_sve): Likewise.

No, this is an aarch64 target architecture option, not an arm target 
architecture option.

>       (check_effective_target_arm_v8_neon_ok_nocache): Likewise.
>       (check_effective_target_aarch64_fjcvtzs_hw): Likewise.
>       (check_effective_target_arm_v8_1m_mve_fp_ok_nocache): Likewise.
>       (check_effective_target_arm_v8_1a_neon_ok_nocache): Likewise.
>       (check_effective_target_arm_v8_2a_fp16_scalar_ok_nocache):
>       Likewise.
>       (check_effective_target_arm_v8_2a_fp16_neon_ok_nocache):
>       Likewise.
>       (check_effective_target_arm_v8_2a_dotprod_neon_ok_nocache):
>       Likewise.
>       (check_effective_target_arm_v8_1m_mve_ok_nocache): Likewise.
>       (check_effective_target_arm_v8_2a_i8mm_ok_nocache): Likewise.
>       (check_effective_target_arm_fp16fml_neon_ok_nocache): Likewise.
>       (check_effective_target_arm_v8_2a_bf16_neon_ok_nocache):
>       Likewise.
>       (check_effective_target_arm_v8m_main_cde_ok_nocache): Likewise.
>       (check_effective_target_arm_v8m_main_cde_fp_ok_nocache):
>       Likewise.
>       (check_effective_target_arm_v8_1m_main_cde_mve_ok_nocache):
>       Likewise.
>       (check_effective_target_arm_v8_1m_main_cde_mve_fp_ok_nocache):
>       Likewise.

as are the following...

>       (check_effective_target_aarch64_asm_fp_ok): Likewise.
>       (check_effective_target_aarch64_asm_simd_ok): Likewise.
>       (check_effective_target_aarch64_asm_crypto_ok): Likewise.
>       (check_effective_target_aarch64_asm_crc_ok): Likewise.
>       (check_effective_target_aarch64_asm_lse_ok): Likewise.
>       (check_effective_target_aarch64_asm_dotprod_ok): Likewise.
>       (check_effective_target_aarch64_asm_sve_ok): Likewise.
>       (check_effective_target_aarch64_asm_i8mm_ok): Likewise.
>       (check_effective_target_aarch64_asm_f32mm_ok): Likewise.
>       (check_effective_target_aarch64_asm_f64mm_ok): Likewise.
>       (check_effective_target_aarch64_asm_bf16_ok): Likewise.
>       (check_effective_target_aarch64_asm_sb_ok): Likewise.
>       (check_effective_target_aarch64_asm_sve2_ok): Likewise.
>       (check_effective_target_aarch64_asm_ls64_ok): Likewise.
>       (check_effective_target_aarch64_asm_sme_ok): Likewise.
>       (check_effective_target_aarch64_asm_sme-i16i64_ok): Likewise.
>       (check_effective_target_aarch64_asm_sme2_ok): Likewise.

... to here.

You'll need to back out these bits.

R.

>       (check_effective_target_arm_v8_3a_complex_neon_ok_nocache):
>       Likewise.
>       (check_effective_target_arm_v8_3a_fp16_complex_neon_ok_nocache):
>       Likewise.
>       (check_effective_target_arm_v8_1_lob_ok): Likewise.
> ---
>  gcc/testsuite/gcc.dg/pr41574.c        |  2 +-
>  gcc/testsuite/gcc.dg/pr59418.c        |  2 +-
>  gcc/testsuite/lib/target-supports.exp | 66 +++++++++++++--------------
>  3 files changed, 35 insertions(+), 35 deletions(-)
> 
> diff --git a/gcc/testsuite/gcc.dg/pr41574.c b/gcc/testsuite/gcc.dg/pr41574.c
> index 062c0044532..e25295bc4fd 100644
> --- a/gcc/testsuite/gcc.dg/pr41574.c
> +++ b/gcc/testsuite/gcc.dg/pr41574.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-O2 -march=armv7-a -mfloat-abi=softfp -mfpu=neon 
> -fno-unsafe-math-optimizations -fdump-rtl-combine" { target { arm*-*-* } } } 
> */
> +/* { dg-options "-O2 -mcpu=unset -march=armv7-a -mfloat-abi=softfp 
> -mfpu=neon -fno-unsafe-math-optimizations -fdump-rtl-combine" { target { 
> arm*-*-* } } } */
>  /* { dg-options "-O2 -fno-unsafe-math-optimizations -fdump-rtl-combine" { 
> target { ! arm*-*-* } } } */
>  
>  
> diff --git a/gcc/testsuite/gcc.dg/pr59418.c b/gcc/testsuite/gcc.dg/pr59418.c
> index 4b54ef2b42d..6ab46ecde8a 100644
> --- a/gcc/testsuite/gcc.dg/pr59418.c
> +++ b/gcc/testsuite/gcc.dg/pr59418.c
> @@ -3,7 +3,7 @@
>  
>  /* { dg-do compile } */
>  /* { dg-options "-Os -g" } */
> -/* { dg-options "-march=armv7-a+fp -mfloat-abi=hard -Os -g" { target { 
> arm*-*-* && { ! arm_thumb1 } } } } */
> +/* { dg-options "-mcpu=unset -march=armv7-a+fp -mfloat-abi=hard -Os -g" { 
> target { arm*-*-* && { ! arm_thumb1 } } } } */
>  
>  extern int printf (const char *__format, ...);
>  double bar (const char *, int);
> diff --git a/gcc/testsuite/lib/target-supports.exp 
> b/gcc/testsuite/lib/target-supports.exp
> index 6241c00a752..54c7af5dae4 100644
> --- a/gcc/testsuite/lib/target-supports.exp
> +++ b/gcc/testsuite/lib/target-supports.exp
> @@ -4351,7 +4351,7 @@ proc add_options_for_vect_early_break { flags } {
>  
>      if { [check_effective_target_arm_v8_neon_ok] } {
>       global et_arm_v8_neon_flags
> -     return "$flags $et_arm_v8_neon_flags -march=armv8-a"
> +     return "$flags $et_arm_v8_neon_flags -mcpu=unset -march=armv8-a"
>      }
>  
>      if { [check_effective_target_sse4] } {
> @@ -5122,7 +5122,7 @@ proc add_options_for_arm_v8_neon { flags } {
>       return "$flags"
>      }
>      global et_arm_v8_neon_flags
> -    return "$flags $et_arm_v8_neon_flags -march=armv8-a"
> +    return "$flags $et_arm_v8_neon_flags -mcpu=unset -march=armv8-a"
>  }
>  
>  # Add the options needed for ARMv8.1 Adv.SIMD.  Also adds the ARMv8 NEON
> @@ -5196,7 +5196,7 @@ proc check_effective_target_arm_neon_ok_nocache { } {
>      global et_arm_neon_flags
>      set et_arm_neon_flags ""
>      if { [check_effective_target_arm32] } {
> -     foreach flags {"" "-mfloat-abi=softfp" "-mfpu=neon" "-mfpu=neon 
> -mfloat-abi=softfp" "-mfpu=neon -mfloat-abi=softfp -march=armv7-a" 
> "-mfloat-abi=hard" "-mfpu=neon -mfloat-abi=hard" "-mfpu=neon -mfloat-abi=hard 
> -march=armv7-a"} {
> +     foreach flags {"" "-mfloat-abi=softfp" "-mfpu=neon" "-mfpu=neon 
> -mfloat-abi=softfp" "-mfpu=neon -mfloat-abi=softfp -mcpu=unset 
> -march=armv7-a" "-mfloat-abi=hard" "-mfpu=neon -mfloat-abi=hard" "-mfpu=neon 
> -mfloat-abi=hard -mcpu=unset -march=armv7-a"} {
>           if { [check_no_compiler_messages_nocache arm_neon_ok object {
>               #include <arm_neon.h>
>               int dummy;
> @@ -5233,7 +5233,7 @@ proc check_effective_target_arm_neon_ok { } {
>  proc check_effective_target_arm_simd32_ok_nocache { } {
>      global et_arm_simd32_flags
>      set et_arm_simd32_flags ""
> -    foreach flags {"" "-march=armv6" "-march=armv6 -mfloat-abi=softfp" 
> "-march=armv6 -mfloat-abi=hard"} {
> +    foreach flags {"" "-mcpu=unset -march=armv6" "-mcpu=unset -march=armv6 
> -mfloat-abi=softfp" "-mcpu=unset -march=armv6 -mfloat-abi=hard"} {
>        if { [check_no_compiler_messages_nocache arm_simd32_ok object {
>       #include <arm_acle.h>
>       int dummy;
> @@ -5271,7 +5271,7 @@ proc add_options_for_arm_simd32 { flags } {
>  proc check_effective_target_arm_sat_ok_nocache { } {
>      global et_arm_sat_flags
>      set et_arm_sat_flags ""
> -    foreach flags {"" "-march=armv6" "-march=armv6 -mfloat-abi=softfp" 
> "-march=armv6 -mfloat-abi=hard -mfpu=vfp"} {
> +    foreach flags {"" "-mcpu=unset -march=armv6" "-mcpu=unset -march=armv6 
> -mfloat-abi=softfp" "-mcpu=unset -march=armv6 -mfloat-abi=hard -mfpu=vfp"} {
>        if { [check_no_compiler_messages_nocache et_arm_sat_flags object {
>       #include <arm_acle.h>
>       int dummy;
> @@ -5311,7 +5311,7 @@ proc add_options_for_arm_sat { flags } {
>  proc check_effective_target_arm_dsp_ok_nocache { } {
>      global et_arm_dsp_flags
>      set et_arm_dsp_flags ""
> -    foreach flags {"" "-march=armv5te" "-march=armv5te -mfloat-abi=softfp" 
> "-march=armv5te -mfloat-abi=hard"} {
> +    foreach flags {"" "-mcpu=unset -march=armv5te" "-mcpu=unset 
> -march=armv5te -mfloat-abi=softfp" "-mcpu=unset -march=armv5te 
> -mfloat-abi=hard"} {
>        if { [check_no_compiler_messages_nocache et_arm_dsp_ok object {
>       #include <arm_acle.h>
>       int dummy;
> @@ -5374,7 +5374,7 @@ proc check_effective_target_arm_neon_ok_no_float_abi { 
> } {
>  
>  proc check_effective_target_arm_crc_ok_nocache { } {
>      global et_arm_crc_flags
> -    set et_arm_crc_flags "-march=armv8-a+crc"
> +    set et_arm_crc_flags "-mcpu=unset -march=armv8-a+crc"
>      return [check_no_compiler_messages_nocache arm_crc_ok object {
>       #if !defined (__ARM_FEATURE_CRC32)
>       #error FOO
> @@ -5499,7 +5499,7 @@ proc add_options_for_aarch64_sve { flags } {
>      if { ![istarget aarch64*-*-*] || [check_effective_target_aarch64_sve] } {
>       return "$flags"
>      }
> -    return "$flags -march=armv8.2-a+sve"
> +    return "$flags -mcpu=unset -march=armv8.2-a+sve"
>  }
>  
>  # Return 1 if this is an ARM target supporting the FP16 alternative
> @@ -5585,7 +5585,7 @@ proc check_effective_target_arm_v8_neon_ok_nocache { } {
>               {
>                 __asm__ volatile ("vrintn.f32 q0, q0");
>               }
> -         } "$flags -march=armv8-a"] } {
> +         } "$flags -mcpu=unset -march=armv8-a"] } {
>               set et_arm_v8_neon_flags $flags
>               return 1
>           }
> @@ -6261,7 +6261,7 @@ proc check_effective_target_aarch64_fjcvtzs_hw { } {
>                       : /* No clobbers.  */);
>         return out != 25;
>       }
> -    } "-march=armv8.3-a" ]
> +    } "-mcpu=unset -march=armv8.3-a" ]
>  }
>  
>  # Return 1 if GCC was configured with --enable-standard-branch-protection
> @@ -6315,7 +6315,7 @@ proc check_effective_target_arm_v8_1m_mve_fp_ok_nocache 
> { } {
>  
>      # Iterate through sets of options to find the compiler flags that
>      # need to be added to the -march option.
> -    foreach flags {"" "-mfloat-abi=softfp -mfpu=auto 
> -march=armv8.1-m.main+mve.fp" "-mfloat-abi=hard -mfpu=auto 
> -march=armv8.1-m.main+mve.fp"} {
> +    foreach flags {"" "-mfloat-abi=softfp -mfpu=auto -mcpu=unset 
> -march=armv8.1-m.main+mve.fp" "-mfloat-abi=hard -mfpu=auto -mcpu=unset 
> -march=armv8.1-m.main+mve.fp"} {
>       if { [check_no_compiler_messages_nocache \
>                 arm_v8_1m_mve_fp_ok object {
>           #include <arm_mve.h>
> @@ -6364,7 +6364,7 @@ proc check_effective_target_arm_v8_1a_neon_ok_nocache { 
> } {
>      # since AArch64 only needs the -march setting.
>      foreach flags {"" "-mfpu=neon-fp-armv8" "-mfloat-abi=softfp" \
>                      "-mfpu=neon-fp-armv8 -mfloat-abi=softfp"} {
> -     foreach arches { "-march=armv8-a+rdma" "-march=armv8.1-a" } {
> +     foreach arches { "-mcpu=unset -march=armv8-a+rdma" "-mcpu=unset 
> -march=armv8.1-a" } {
>           if { [check_no_compiler_messages_nocache arm_v8_1a_neon_ok object {
>               #if !defined (__ARM_FEATURE_QRDMX)
>               #error "__ARM_FEATURE_QRDMX not defined"
> @@ -6405,8 +6405,8 @@ proc 
> check_effective_target_arm_v8_2a_fp16_scalar_ok_nocache { } {
>           #if !defined (__ARM_FEATURE_FP16_SCALAR_ARITHMETIC)
>           #error "__ARM_FEATURE_FP16_SCALAR_ARITHMETIC not defined"
>           #endif
> -     } "$flags -march=armv8.2-a+fp16"] } {
> -         set et_arm_v8_2a_fp16_scalar_flags "$flags -march=armv8.2-a+fp16"
> +     } "$flags -mcpu=unset -march=armv8.2-a+fp16"] } {
> +         set et_arm_v8_2a_fp16_scalar_flags "$flags -mcpu=unset 
> -march=armv8.2-a+fp16"
>           return 1
>       }
>      }
> @@ -6440,8 +6440,8 @@ proc 
> check_effective_target_arm_v8_2a_fp16_neon_ok_nocache { } {
>           #if !defined (__ARM_FEATURE_FP16_VECTOR_ARITHMETIC)
>           #error "__ARM_FEATURE_FP16_VECTOR_ARITHMETIC not defined"
>           #endif
> -     } "$flags -march=armv8.2-a+fp16"] } {
> -         set et_arm_v8_2a_fp16_neon_flags "$flags -march=armv8.2-a+fp16"
> +     } "$flags -mcpu=unset -march=armv8.2-a+fp16"] } {
> +         set et_arm_v8_2a_fp16_neon_flags "$flags -mcpu=unset 
> -march=armv8.2-a+fp16"
>           return 1
>       }
>      }
> @@ -6475,8 +6475,8 @@ proc 
> check_effective_target_arm_v8_2a_dotprod_neon_ok_nocache { } {
>           #if !defined (__ARM_FEATURE_DOTPROD)
>           #error "__ARM_FEATURE_DOTPROD not defined"
>           #endif
> -     } "$flags -march=armv8.2-a+dotprod"] } {
> -         set et_arm_v8_2a_dotprod_neon_flags "$flags 
> -march=armv8.2-a+dotprod"
> +     } "$flags -mcpu=unset -march=armv8.2-a+dotprod"] } {
> +         set et_arm_v8_2a_dotprod_neon_flags "$flags -mcpu=unset 
> -march=armv8.2-a+dotprod"
>           return 1
>       }
>      }
> @@ -6498,7 +6498,7 @@ proc check_effective_target_arm_v8_1m_mve_ok_nocache { 
> } {
>  
>      # Iterate through sets of options to find the compiler flags that
>      # need to be added to the -march option.
> -    foreach flags {"" "-mfloat-abi=softfp -mfpu=auto 
> -march=armv8.1-m.main+mve" "-mfloat-abi=hard -mfpu=auto 
> -march=armv8.1-m.main+mve"} {
> +    foreach flags {"" "-mfloat-abi=softfp -mfpu=auto -mcpu=unset 
> -march=armv8.1-m.main+mve" "-mfloat-abi=hard -mfpu=auto -mcpu=unset 
> -march=armv8.1-m.main+mve"} {
>       if { [check_no_compiler_messages_nocache \
>                 arm_v8_1m_mve_ok object {
>           #if !defined (__ARM_FEATURE_MVE)
> @@ -6564,8 +6564,8 @@ proc check_effective_target_arm_v8_2a_i8mm_ok_nocache { 
> } {
>           #if !defined (__ARM_FEATURE_MATMUL_INT8)
>           #error "__ARM_FEATURE_MATMUL_INT8 not defined"
>           #endif
> -     } "$flags -march=armv8.2-a+i8mm"] } {
> -         set et_arm_v8_2a_i8mm_flags "$flags -march=armv8.2-a+i8mm"
> +     } "$flags -mcpu=unset -march=armv8.2-a+i8mm"] } {
> +         set et_arm_v8_2a_i8mm_flags "$flags -mcpu=unset 
> -march=armv8.2-a+i8mm"
>           return 1
>       }
>      }
> @@ -6609,8 +6609,8 @@ proc check_effective_target_arm_fp16fml_neon_ok_nocache 
> { } {
>               {
>                 return vfmlal_high_f16 (r, a, b);
>               }
> -     } "$flags -march=armv8.2-a+fp16fml"] } {
> -         set et_arm_fp16fml_neon_flags "$flags -march=armv8.2-a+fp16fml"
> +     } "$flags -mcpu=unset -march=armv8.2-a+fp16fml"] } {
> +         set et_arm_fp16fml_neon_flags "$flags -mcpu=unset 
> -march=armv8.2-a+fp16fml"
>           return 1
>       }
>      }
> @@ -6648,8 +6648,8 @@ proc 
> check_effective_target_arm_v8_2a_bf16_neon_ok_nocache { } {
>           #if !defined (__ARM_FEATURE_BF16_VECTOR_ARITHMETIC)
>           #error "__ARM_FEATURE_BF16_VECTOR_ARITHMETIC not defined"
>           #endif
> -     } "$flags -march=armv8.2-a+bf16"] } {
> -         set et_arm_v8_2a_bf16_neon_flags "$flags -march=armv8.2-a+bf16"
> +     } "$flags -mcpu=unset -march=armv8.2-a+bf16"] } {
> +         set et_arm_v8_2a_bf16_neon_flags "$flags -mcpu=unset 
> -march=armv8.2-a+bf16"
>           return 1
>       }
>      }
> @@ -6716,8 +6716,8 @@ foreach { armfunc armflag armdef arminc } {
>               #endif
>               #include <arm_cde.h>
>               INC
> -         } "FLAG"] } {
> -                 set et_FUNC_flags "FLAG"
> +         } "-mcpu=unset FLAG"] } {
> +                 set et_FUNC_flags "-mcpu=unset FLAG"
>                   return 1
>           }
>  
> @@ -12134,7 +12134,7 @@ foreach { aarch64_ext } { "fp" "simd" "crypto" "crc" 
> "lse" "dotprod" "sve"
>         if { [istarget aarch64*-*-*] } {
>               return [check_no_compiler_messages aarch64_FUNC_assembler 
> object {
>                       __asm__ (".arch_extension FUNC");
> -             } "-march=armv8-a+FUNC"]
> +             } "-mcpu=unset -march=armv8-a+FUNC"]
>         } else {
>               return 0
>         }
> @@ -13121,8 +13121,8 @@ proc 
> check_effective_target_arm_v8_3a_complex_neon_ok_nocache { } {
>           #if !defined (__ARM_FEATURE_COMPLEX)
>           #error "__ARM_FEATURE_COMPLEX not defined"
>           #endif
> -     } "$flags -march=armv8.3-a"] } {
> -         set et_arm_v8_3a_complex_neon_flags "$flags -march=armv8.3-a"
> +     } "$flags -mcpu=unset -march=armv8.3-a"] } {
> +         set et_arm_v8_3a_complex_neon_flags "$flags -mcpu=unset 
> -march=armv8.3-a"
>           return 1;
>       }
>      }
> @@ -13163,9 +13163,9 @@ proc 
> check_effective_target_arm_v8_3a_fp16_complex_neon_ok_nocache { } {
>           #if !defined (__ARM_FEATURE_COMPLEX)
>           #error "__ARM_FEATURE_COMPLEX not defined"
>           #endif
> -     } "$flags -march=armv8.3-a+fp16"] } {
> +     } "$flags -mcpu=unset -march=armv8.3-a+fp16"] } {
>           set et_arm_v8_3a_fp16_complex_neon_flags \
> -                     "$flags -march=armv8.3-a+fp16"
> +                     "$flags -mcpu=unset -march=armv8.3-a+fp16"
>           return 1;
>       }
>      }
> @@ -13251,7 +13251,7 @@ proc check_effective_target_arm_v8_1_lob_ok { } {
>                 asm goto ("le lr, %l0" : : : "lr" : loop);
>                 return i != 10;
>               }
> -     } "-mcpu=unset -march=armv8.1-m.main -mthumb" ]
> +     } "-mcpu=unset -mcpu=unset -march=armv8.1-m.main -mthumb" ]
>      }
>  }
>  

Reply via email to