]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
arm: testsuite: fix arm_neon_h checks with conflicting cpu/arch
authorRichard Earnshaw <rearnsha@arm.com>
Tue, 11 Mar 2025 10:48:54 +0000 (10:48 +0000)
committerRichard Earnshaw <rearnsha@arm.com>
Tue, 11 Mar 2025 11:02:14 +0000 (11:02 +0000)
GCC will complain if the -mcpu flag specifies a different architecture
to that specified in -march, but if the floating-point ABI is "soft",
then differences in the floating-point architecture features are
ignored.

However, the arm_libc_fp_abi checks whether we change the FP ABI by
adding -mfloat-abi=hard/softfp to override the defaults.  If that
fails it won't add anything.

Unfortunately arm_neon_h_ok wasn't correctly checking whether the libc
check had worked and just assumed that it would always add something
to enable FP.  That's insufficient and we need to consider this failure.
We simply mark tests as unsupported in this case.

gcc/testsuite/ChangeLog:

* lib/target-supports.exp
(check_effective_target_arm_neon_h_ok_nocache): Return zero if
check_effective_target_arm_libc_fp_abi_ok reports failure.

gcc/testsuite/lib/target-supports.exp

index a184ef37ccb4b59632c0191d387b85645b60d3c5..c456f7d2c6faea791cb6aea2fc8ebc994371ddd3 100644 (file)
@@ -5167,7 +5167,8 @@ proc add_options_for_arm_libc_fp_abi { flags } {
 proc check_effective_target_arm_neon_h_ok_nocache { } {
     # none-arm or thumb1 cannot support neon, so there's no point in
     # looking further.
-    if { [istarget arm*-*-*] } {
+    if { [istarget arm*-*-*]
+        && [check_effective_target_arm_libc_fp_abi_ok]} {
        global et_arm_neon_h_flags
        set base_flags [add_options_for_arm_libc_fp_abi ""]
        foreach flags {"" "-mfpu=auto" "-marm" "-marm -mfpu=auto" \