This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch, ARM, testsuite] Add -mfloat-abi=hard to arm_neon_ok


Hi,

I have recently updated the dejagnu version I use for
cross-testing arm and aarch64 toolchains to 1.6+. One of the side
effects was mentioned by Jonathan in
https://gcc.gnu.org/ml/gcc-patches/2017-05/msg01267.html. Since I
use multilibs to test many configurations, I noticed several
changes in the results I get.

In particular, on arm-none-linux-gnueabihf with -march=armv5t,
all the tests that require arm_neon_ok fail to compile because
they now use -march=armv5t -mfpu=neon -mfloat-abi=softfp
-march=armv7-a, which leads to a failure to include
gnu/stubs-soft.h (not present since the target is
'hf'). Previously, -march=armv5t was appended, making the tests
unsupported because -mfpu=neon conflicts with -march=armv5t. Now,
arm_neon_ok succeeds because it only checks if some preprocessor
defines are present.

This patch fixes that by including arm_neon.h in arm_neon_ok, such
that it fails for unsupported cases. However, since most of these
tests should pass instead of becoming unsupported, I have added flag
combinations with -mfloat-abi=hard.

However, this is not sufficient to make the
gcc.target/arm/lto/pr65837* tests pass: they do not require
arm_neon_ok, and when I tried to add it, they still failed
because these lto tests do not support dg-add-options. My
proposal is to add a new
check_effective_target_arm_neon_ok_no_float_abi function which
tries to use neon without trying to change the -mfloat-abi
setting (that is, the same as arm_neon_ok, with only ""
and "-mfpu=neon" in the list of flags) . This makes these two lto
tests unsupported for non-hf targets (again because
gnu/stubs-soft.h is not present).

To make them pass on "hf" targets:
- I added -mfpu=neon to dg-lto-options in pr65837-attr_0.c,
  because the fpu attributes in arm_neon.h only work if
  -mfpu=neon is enabled
- I removed dg-suppress-ld-options {-mfpu=neon} from pr65837_0.c,
  -mfpu=neon is needed for the test to compile with toolchains
  where the default fpu is not neon (eg vfpv3-d16-fp16)

On arm-none-linux-gnueabihf --with-cpu=cortex-a9 --with-fpu=vfp
and multilib test flag=-march=armv5t, this patch brings:
- 2 UNRESOLVED -> FAIL (gcc.dg/vect/vect-align-1.c)
- 14 UNRESOLVED -> XPASS (in gcc.dg/vect/)
- 2765 new PASS
- 3639 FAIL -> PASS
- 1826 UNRESOLVED -> PASS
- 102 UNRESOLVED -> XFAIL

as visible in the red cell at
http://people.linaro.org/~christophe.lyon/cross-validation/gcc-test-patches/248552-gnu-stubs9.patch/report-build-info.html
(the build-failed line can be ignored, it was caused by a server
problem)

Sorry, the explanation is almost longer than the patch :-)

Is it OK for trunk?
(Just realizing that I forgot to document the new functions :( )

Thanks,

Christophe

Attachment: gnu-stubs9.chlog.txt
Description: Text document

Attachment: gnu-stubs9.patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]