This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
FIO, powerpc-darwin mangling patch [7.x and earlier].
- From: Iain Sandoe <iain at sandoe dot co dot uk>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Cc: Segher Boessenkool <segher at kernel dot crashing dot org>, Mike Stump <mikestump at comcast dot net>
- Date: Tue, 27 Nov 2018 15:05:57 +0000
- Subject: FIO, powerpc-darwin mangling patch [7.x and earlier].
Hi,
So it turns out that the Darwin PPC port was broken essentially “forever” (before the tidy-up in 8.2) with respect to mangling the symbols for __ibm128 type (the default long double for the port).
In 7.x and earlier (at least back to Apple’s 4.2.1) the use passes right through rs6000_mangle_type, which causes it to mangle to ‘e’ - which is the representation for long double as a 64b value (-mlong-double-64).
This is fixable, even quite easily, but I think it’s better to have the break in the upstream sources on a major boundary (so we leave it alone and have the correction in 8+)
In due course, I will apply the following fix to my “vendor” branches (7, 6 and 5) for anyone who actually cares.
cheers
Iain
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index d377e24..ccb771b 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -35375,6 +35375,10 @@ rs6000_mangle_type (const_tree type)
&& !TARGET_IEEEQUAD)
return "g";
+ if (TARGET_MACHO && type == long_double_type_node
+ && TREE_INT_CST_LOW (TYPE_SIZE (type)) == 128)
+ return "g";
+
/* For all other types, use normal C++ mangling. */
return NULL;
}