[gcc(refs/vendors/ARM/heads/morello)] aarch64: Fix segfault in aarch64_mangle_type
Matthew Malcomson
matmal01@gcc.gnu.org
Mon Feb 28 12:08:45 GMT 2022
https://gcc.gnu.org/g:8067f214025fd95aaa0fc3af962bb22efede8a67
commit 8067f214025fd95aaa0fc3af962bb22efede8a67
Author: Alex Coplan <alex.coplan@arm.com>
Date: Thu Feb 3 10:57:40 2022 +0000
aarch64: Fix segfault in aarch64_mangle_type
For pure-capability Morello with the new varargs PCS, we just use void*
for __builtin_va_list and don't bother building the va_list_type node in
the backend.
This was causing a segfault via aarch64_mangle_type as it was calling
lang_hooks.types_compatible_p on a NULL va_list_type node. We don't want
special mangling for __builtin_va_list with the new PCS. It is simply
typedef'd to void * and should be mangled as such. So this patch just
guards the special mangling on !TARGET_CAPABILITY_PURE, thereby also
fixing the segfault.
This patch allows us to compile some C++ code for purecap Morello.
Diff:
---
gcc/config/aarch64/aarch64.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 52d86e47924..17d17a140b6 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -18319,8 +18319,12 @@ static const char *
aarch64_mangle_type (const_tree type)
{
/* The AArch64 ABI documents say that "__va_list" has to be
- mangled as if it is in the "std" namespace. */
- if (lang_hooks.types_compatible_p (CONST_CAST_TREE (type), va_list_type))
+ mangled as if it is in the "std" namespace.
+
+ Note that for purecap Morello, va_list_type is just void* and is
+ mangled accordingly. */
+ if (!TARGET_CAPABILITY_PURE
+ && lang_hooks.types_compatible_p (CONST_CAST_TREE (type), va_list_type))
return "St9__va_list";
/* Half-precision floating point types. */
More information about the Gcc-cvs
mailing list