Skip to content
Snippets Groups Projects
Commit de593b3c authored by Tamar Christina's avatar Tamar Christina
Browse files

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.
parent fb590e4e
No related branches found
No related tags found
No related merge requests found
...@@ -82,6 +82,7 @@ aarch64_update_cpp_builtins (cpp_reader *pfile) ...@@ -82,6 +82,7 @@ aarch64_update_cpp_builtins (cpp_reader *pfile)
{ {
aarch64_def_or_undef (flag_unsafe_math_optimizations, "__ARM_FP_FAST", pfile); aarch64_def_or_undef (flag_unsafe_math_optimizations, "__ARM_FP_FAST", pfile);
cpp_undef (pfile, "__ARM_ARCH");
builtin_define_with_int_value ("__ARM_ARCH", AARCH64_ISA_V9A ? 9 : 8); builtin_define_with_int_value ("__ARM_ARCH", AARCH64_ISA_V9A ? 9 : 8);
builtin_define_with_int_value ("__ARM_SIZEOF_MINIMAL_ENUM", builtin_define_with_int_value ("__ARM_SIZEOF_MINIMAL_ENUM",
......
/* { dg-do compile } */
/* { dg-additional-options "-march=armv9-a -Wpedantic -Werror" } */
#include <arm_neon.h>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment