aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2005-06-19 21:12:16 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2005-06-19 21:12:16 +0100
commitcac24f06cb5600e5e744e724764687b2837a2a52 (patch)
tree8e704170ad94af96c0f083d2ecfe2c5891e475cd /gcc/config
parent5556f74b3a46fe10f286b1efb27f0f1d09bc6a20 (diff)
downloadgcc-cac24f06cb5600e5e744e724764687b2837a2a52.zip
gcc-cac24f06cb5600e5e744e724764687b2837a2a52.tar.gz
gcc-cac24f06cb5600e5e744e724764687b2837a2a52.tar.bz2
i386.c (TARGET_MANGLE_FUNDAMENTAL_TYPE): Define.
* config/i386/i386.c (TARGET_MANGLE_FUNDAMENTAL_TYPE): Define. (ix86_mangle_fundamental_type): New. * config/ia64/ia64.c (TARGET_MANGLE_FUNDAMENTAL_TYPE): Define. (ia64_mangle_fundamental_type): New. testsuite: * g++.dg/abi/mangle24.C, g++.dg/abi/mangle25.C: New tests. From-SVN: r101191
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/i386/i386.c22
-rw-r--r--gcc/config/ia64/ia64.c21
2 files changed, 43 insertions, 0 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index d2484cd..8425ef8 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -905,6 +905,7 @@ static bool ix86_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode,
tree, bool);
static void ix86_init_builtins (void);
static rtx ix86_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
+static const char *ix86_mangle_fundamental_type (tree);
/* This function is only used on Solaris. */
static void i386_solaris_elf_named_section (const char *, unsigned int, tree)
@@ -1077,6 +1078,9 @@ static void init_ext_80387_constants (void);
#define TARGET_INSERT_ATTRIBUTES SUBTARGET_INSERT_ATTRIBUTES
#endif
+#undef TARGET_MANGLE_FUNDAMENTAL_TYPE
+#define TARGET_MANGLE_FUNDAMENTAL_TYPE ix86_mangle_fundamental_type
+
struct gcc_target targetm = TARGET_INITIALIZER;
@@ -17539,4 +17543,22 @@ i386_solaris_elf_named_section (const char *name, unsigned int flags,
default_elf_asm_named_section (name, flags, decl);
}
+/* Return the mangling of TYPE if it is an extended fundamental type. */
+
+static const char *
+ix86_mangle_fundamental_type (tree type)
+{
+ switch (TYPE_MODE (type))
+ {
+ case TFmode:
+ /* __float128 is "g". */
+ return "g";
+ case XFmode:
+ /* "long double" or __float80 is "e". */
+ return "e";
+ default:
+ return NULL;
+ }
+}
+
#include "gt-i386.h"
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 5c6d11f..e64962a 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -262,6 +262,7 @@ static tree ia64_gimplify_va_arg (tree, tree, tree *, tree *);
static bool ia64_scalar_mode_supported_p (enum machine_mode mode);
static bool ia64_vector_mode_supported_p (enum machine_mode mode);
static bool ia64_cannot_force_const_mem (rtx);
+static const char *ia64_mangle_fundamental_type (tree);
/* Table of valid machine attributes. */
static const struct attribute_spec ia64_attribute_table[] =
@@ -429,6 +430,9 @@ static const struct attribute_spec ia64_attribute_table[] =
#undef TARGET_CANNOT_FORCE_CONST_MEM
#define TARGET_CANNOT_FORCE_CONST_MEM ia64_cannot_force_const_mem
+#undef TARGET_MANGLE_FUNDAMENTAL_TYPE
+#define TARGET_MANGLE_FUNDAMENTAL_TYPE ia64_mangle_fundamental_type
+
struct gcc_target targetm = TARGET_INITIALIZER;
typedef enum
@@ -8639,4 +8643,21 @@ ia64_profile_hook (int labelno)
label, Pmode);
}
+/* Return the mangling of TYPE if it is an extended fundamental type. */
+
+static const char *
+ia64_mangle_fundamental_type (tree type)
+{
+ /* On HP-UX, "long double" is mangled as "e" so __float128 is
+ mangled as "e". */
+ if (!TARGET_HPUX && TYPE_MODE (type) == TFmode)
+ return "g";
+ /* On HP-UX, "e" is not available as a mangling of __float80 so use
+ an extended mangling. Elsewhere, "e" is available since long
+ double is 80 bits. */
+ if (TYPE_MODE (type) == XFmode)
+ return TARGET_HPUX ? "u9__float80" : "e";
+ return NULL;
+}
+
#include "gt-ia64.h"