]> git.ipfire.org Git - thirdparty/gcc.git/commit
AArch64: Fix Armv9-a warnings that get emitted whenever a ACLE header is used.
authorTamar Christina <tamar.christina@arm.com>
Thu, 12 Oct 2023 14:55:58 +0000 (15:55 +0100)
committerTamar Christina <tamar.christina@arm.com>
Thu, 12 Oct 2023 14:55:58 +0000 (15:55 +0100)
commitde593b3cffdc9c030c5e697ad9092b1b085dabc4
tree331ff8fb15ce3c9dc0d480adccb8da30e6f651cc
parentfb590e4eeb1aa897209b853430dc4854ece97802
AArch64: Fix Armv9-a warnings that get emitted whenever a ACLE header is used.

At the moment, trying to use -march=armv9-a with any ACLE header such as
arm_neon.h results in rows and rows of warnings saying:

<built-in>: warning: "__ARM_ARCH" redefined
<built-in>: note: this is the location of the previous definition

This is obviously not useful and happens because the header was defined at
__ARM_ARCH == 8 and the commandline changes it.

The Arm port solves this by undef the macro during argument processing and we do
the same on AArch64 for the majority of macros.  However we define this macro
using a different helper which requires the manual undef.

Thanks,
Tamar

gcc/ChangeLog:

* config/aarch64/aarch64-c.cc (aarch64_update_cpp_builtins): Add undef.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/armv9_warning.c: New test.
gcc/config/aarch64/aarch64-c.cc
gcc/testsuite/gcc.target/aarch64/armv9_warning.c [new file with mode: 0644]