aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2004-09-03 00:43:59 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2004-09-03 00:43:59 +0000
commit40a1c5cb5e9ac61a3152e84815b60069d80e31b1 (patch)
tree00f44a86fe46ab3dee185812c70fc99b06132af2 /gcc
parent085b68226c2664ccc04c9458e3985e328ea9e79e (diff)
downloadgcc-40a1c5cb5e9ac61a3152e84815b60069d80e31b1.zip
gcc-40a1c5cb5e9ac61a3152e84815b60069d80e31b1.tar.gz
gcc-40a1c5cb5e9ac61a3152e84815b60069d80e31b1.tar.bz2
bpabi.h (TARGET_BPABI_CPP_BUILTINS): Define.
* config/arm/bpabi.h (TARGET_BPABI_CPP_BUILTINS): Define. (TARGET_OS_CPP_BUILTINS): Likewise. * config/arm/symbian.h (TARGET_OS_CPP_BUILTINS): Include TARGET_BPABI_CPP_BUILTINS. * g++.dg/abi/arm_rtti1.C: New test. * libsupc++/typeinfo: Honor __GXX_MERGED_TYPEINFO_NAMES if already defined. [[Split portion of a mixed commit.]] From-SVN: r87018.2
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/arm/bpabi.h16
-rw-r--r--gcc/config/arm/symbian.h7
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/g++.dg/abi/arm_rtti1.C14
5 files changed, 46 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 758a33a..96eb1b8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2004-09-02 Mark Mitchell <mark@codesourcery.com>
+
+ * config/arm/bpabi.h (TARGET_BPABI_CPP_BUILTINS): Define.
+ (TARGET_OS_CPP_BUILTINS): Likewise.
+ * config/arm/symbian.h (TARGET_OS_CPP_BUILTINS): Include
+ TARGET_BPABI_CPP_BUILTINS.
+
2004-09-02 Roman Zippel <zippel@linux-m68k.org>
* combine.c (distribute_notes): Don't add REG_LABEL to jump insn.
diff --git a/gcc/config/arm/bpabi.h b/gcc/config/arm/bpabi.h
index 60d6e75..e2be114 100644
--- a/gcc/config/arm/bpabi.h
+++ b/gcc/config/arm/bpabi.h
@@ -84,3 +84,19 @@
#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatdisf, l2f)
#endif
+/* The BPABI requires that we always use an out-of-line implementation
+ of RTTI comparison, even if the target supports weak symbols,
+ because the same object file might be used on a target that does
+ not support merging symbols across DLL boundaries. This macro is
+ broken out separately so that it can be used within
+ TARGET_OS_CPP_BUILTINS in configuration files for systems based on
+ the BPABI. */
+#define TARGET_BPABI_CPP_BUILTINS() \
+ do \
+ { \
+ builtin_define ("__GXX_MERGED_TYPEINFO_NAMES=0"); \
+ } \
+ while (false)
+
+#define TARGET_OS_CPP_BUILTINS() \
+ TARGET_BPABI_CPP_BUILTINS()
diff --git a/gcc/config/arm/symbian.h b/gcc/config/arm/symbian.h
index 5a59e79..a900d76 100644
--- a/gcc/config/arm/symbian.h
+++ b/gcc/config/arm/symbian.h
@@ -75,9 +75,12 @@
#define RENAME_LIBRARY(GCC_NAME, AEABI_NAME) /* empty */
/* Define the __symbian__ macro. */
+#undef TARGET_OS_CPP_BUILTINS
#define TARGET_OS_CPP_BUILTINS() \
- do \
+ do \
{ \
+ /* Include the default BPABI stuff. */ \
+ TARGET_BPABI_CPP_BUILTINS (); \
builtin_define ("__symbian__"); \
- } \
+ } \
while (false)
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index df9b806..428480c 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2004-09-02 Mark Mitchell <mark@codesourcery.com>
+
+ * g++.dg/abi/arm_rtti1.C: New test.
+
2004-09-02 Geoffrey Keating <geoffk@apple.com>
* gcc.dg/ppc-vector-memcpy.c: New.
diff --git a/gcc/testsuite/g++.dg/abi/arm_rtti1.C b/gcc/testsuite/g++.dg/abi/arm_rtti1.C
new file mode 100644
index 0000000..a481bdd
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/arm_rtti1.C
@@ -0,0 +1,14 @@
+// { dg-do compile { target arm*-*-eabi* arm*-*-symbianelf* } }
+// { dg-options "-O2" }
+// Check that, even when optimizing, we emit an out-of-line call to
+// the type-info comparison function.
+// { dg-final { scan-assembler _ZNKSt9type_infoeqERKS_ } }
+
+#include <typeinfo>
+
+extern const std::type_info& t1;
+extern const std::type_info& t2;
+
+bool f() {
+ return t1 == t2;
+}