[gcc(refs/vendors/ARM/heads/morello)] Define UINTPTR_TYPE, INTPTR_TYPE, and PTRADDR_TYPE in aarch64-elf

Matthew Malcomson matmal01@gcc.gnu.org
Tue Sep 21 09:13:19 GMT 2021


https://gcc.gnu.org/g:8a4f09372ea4a5fc5359c4f8840532935926a087

commit 8a4f09372ea4a5fc5359c4f8840532935926a087
Author: Matthew Malcomson <matthew.malcomson@arm.com>
Date:   Mon Aug 9 10:51:48 2021 +0100

    Define UINTPTR_TYPE, INTPTR_TYPE, and PTRADDR_TYPE in aarch64-elf
    
    Originally we added the INTPTR_TYPE definitions into aarch64-linux.h
    under the false impression that AArch64 only had these defined through
    glibc-stdint.h and this was only included when targetting aarch64-linux.
    
    As we are now targetting aarch64-elf we have found a need to have these
    macros defined there as well, so we have moved the definitions there.
    In doing so we realised that AArch64 was originally using the
    INTPTR_TYPE from newlib-stdint.h for none-elf, so the original decision
    was mistaken anyway.
    
    This does mean that we define these macros for free-bsd and netbsd
    targets though they originally were not.  We could have avoided this
    by defining these macros in both `aarch64-elf-raw.h` and
    `aarch64-linux.h`.  We suspect defining these macros everywhere is a
    good thing, and will test if/when we start looking at using Morello on
    those platforms.
    
    We also add the definition of PTRADDR_TYPE in this file.

Diff:
---
 gcc/config/aarch64/aarch64-elf.h   | 11 +++++++++++
 gcc/config/aarch64/aarch64-linux.h |  9 ---------
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/gcc/config/aarch64/aarch64-elf.h b/gcc/config/aarch64/aarch64-elf.h
index 07685657c5e..2ffdbebe6ac 100644
--- a/gcc/config/aarch64/aarch64-elf.h
+++ b/gcc/config/aarch64/aarch64-elf.h
@@ -147,4 +147,15 @@ ASM_MABI_SPEC
 /* Stabs debug not required.  */
 #undef DBX_DEBUGGING_INFO
 
+#undef INTPTR_TYPE
+#undef UINTPTR_TYPE
+#undef PTRADDR_TYPE
+#define INTPTR_TYPE ((TARGET_CAPABILITY_FAKE || TARGET_CAPABILITY_PURE) \
+			? "__intcap_t" \
+			: (LONG_TYPE_SIZE == 64 ? "long int" : "int"))
+#define UINTPTR_TYPE ((TARGET_CAPABILITY_FAKE || TARGET_CAPABILITY_PURE) \
+			? "__uintcap_t" \
+			: (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "unsigned int"))
+#define PTRADDR_TYPE "long unsigned int"
+
 #endif /* GCC_AARCH64_ELF_H */
diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h
index 0f9ae595c29..e587e2e9ad6 100644
--- a/gcc/config/aarch64/aarch64-linux.h
+++ b/gcc/config/aarch64/aarch64-linux.h
@@ -77,13 +77,4 @@
 /* Define this to be nonzero if static stack checking is supported.  */
 #define STACK_CHECK_STATIC_BUILTIN 1
 
-#undef INTPTR_TYPE
-#undef UINTPTR_TYPE
-#define INTPTR_TYPE ((TARGET_CAPABILITY_FAKE || TARGET_CAPABILITY_PURE) \
-			? "__intcap_t" \
-			: (LONG_TYPE_SIZE == 64 ? "long int" : "int"))
-#define UINTPTR_TYPE ((TARGET_CAPABILITY_FAKE || TARGET_CAPABILITY_PURE) \
-			? "__uintcap_t" \
-			: (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "unsigned int"))
-
 #endif  /* GCC_AARCH64_LINUX_H */


More information about the Gcc-cvs mailing list