bpabi.h (TARGET_BPABI_CPP_BUILTINS): Define.
authorMark Mitchell <mark@codesourcery.com>
Fri, 3 Sep 2004 00:43:59 +0000 (00:43 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Fri, 3 Sep 2004 00:43:59 +0000 (00:43 +0000)
* 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

gcc/ChangeLog
gcc/config/arm/bpabi.h
gcc/config/arm/symbian.h
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/abi/arm_rtti1.C [new file with mode: 0644]
libstdc++-v3/ChangeLog
libstdc++-v3/libsupc++/typeinfo

index 758a33ac9b979e9dd0824ba5bf027d4d95720af2..96eb1b86835ee5627e89fc8355fe8b48dfb92a2e 100644 (file)
@@ -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.
index 60d6e75b73a8f71bd94e08e67d50b22a095af8ac..e2be11446f8dfe0456a925acb8b2bb9077d82566 100644 (file)
 #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()
index 5a59e79af17333bca5984d1ce10590e7820d8a0d..a900d76f76b6f9b7d48e191b6fdf99f9f91ad733 100644 (file)
 #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)
index df9b8065f75d97bf520537e8468bdaa99cb9b230..428480c3b3c1b01e2055e60a8c46bb2a61937739 100644 (file)
@@ -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 (file)
index 0000000..a481bdd
--- /dev/null
@@ -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;
+}
index 0f4816b6dea9dfe7e1db4e52eb870dddb82e6ef1..1cdfef625ec17090db2dfff25e8cd4bc705fa60b 100644 (file)
@@ -1,3 +1,8 @@
+2004-09-02  Mark Mitchell  <mark@codesourcery.com>
+
+       * libsupc++/typeinfo: Honor __GXX_MERGED_TYPEINFO_NAMES if already
+       defined. 
+
 2004-09-02  Benjamin Kosnik  <bkoz@redhat.com>
             Simon Richter  <Simon.Richter@hogyros.de>
        
index 46803ad4d147b0608fcabb6fd571410b533f9a25..81824223eb641bf08ecd88c1bab048ec54998207 100644 (file)
@@ -46,12 +46,14 @@ namespace __cxxabiv1
   class __class_type_info;
 } // namespace __cxxabiv1
 
-#if !__GXX_WEAK__
-  // If weak symbols are not supported, typeinfo names are not merged.
-  #define __GXX_MERGED_TYPEINFO_NAMES 0
-#else
-  // On platforms that support weak symbols, typeinfo names are merged.
-  #define __GXX_MERGED_TYPEINFO_NAMES 1
+#ifndef __GXX_MERGED_TYPEINFO_NAMES
+  #if !__GXX_WEAK__
+    // If weak symbols are not supported, typeinfo names are not merged.
+    #define __GXX_MERGED_TYPEINFO_NAMES 0
+  #else
+    // On platforms that support weak symbols, typeinfo names are merged.
+    #define __GXX_MERGED_TYPEINFO_NAMES 1
+  #endif
 #endif
 
 namespace std