aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/rtti.c
diff options
context:
space:
mode:
authorMarc Glisse <marc.glisse@inria.fr>2014-04-22 18:44:46 +0200
committerMarc Glisse <glisse@gcc.gnu.org>2014-04-22 16:44:46 +0000
commit793c625fb803247ea5b759c11dbeb3d6882cd74a (patch)
tree44bd0f6e4b48f83095c786032dba2ce89733a04f /gcc/cp/rtti.c
parentc6d43074d81f1d46a061689d66a68d775aa4250a (diff)
downloadgcc-793c625fb803247ea5b759c11dbeb3d6882cd74a.zip
gcc-793c625fb803247ea5b759c11dbeb3d6882cd74a.tar.gz
gcc-793c625fb803247ea5b759c11dbeb3d6882cd74a.tar.bz2
re PR libstdc++/43622 (Incomplete C++ library support for __float128)
2014-04-22 Marc Glisse <marc.glisse@inria.fr> PR libstdc++/43622 gcc/c-family/ * c-common.c (registered_builtin_types): Make non-static. * c-common.h (registered_builtin_types): Declare. gcc/cp/ * rtti.c (emit_support_tinfo_1): New function, extracted from emit_support_tinfos. (emit_support_tinfos): Call it and iterate on registered_builtin_types. libstdc++-v3/ * config/abi/pre/gnu.ver (CXXABI_1.3.9): New version, new symbols. * config/abi/pre/gnu-versioned-namespace.ver: New symbols. * config/abi/post/x86_64-linux-gnu/baseline_symbols.txt: Likewise. From-SVN: r209652
Diffstat (limited to 'gcc/cp/rtti.c')
-rw-r--r--gcc/cp/rtti.c77
1 files changed, 41 insertions, 36 deletions
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index a8e6d25..a35036d 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -1465,6 +1465,44 @@ create_tinfo_types (void)
pop_abi_namespace ();
}
+/* Helper for emit_support_tinfos. Emits the type_info descriptor of
+ a single type. */
+
+void
+emit_support_tinfo_1 (tree bltn)
+{
+ tree types[3];
+
+ if (bltn == NULL_TREE)
+ return;
+ types[0] = bltn;
+ types[1] = build_pointer_type (bltn);
+ types[2] = build_pointer_type (cp_build_qualified_type (bltn,
+ TYPE_QUAL_CONST));
+
+ for (int i = 0; i < 3; ++i)
+ {
+ tree tinfo = get_tinfo_decl (types[i]);
+ TREE_USED (tinfo) = 1;
+ mark_needed (tinfo);
+ /* The C++ ABI requires that these objects be COMDAT. But,
+ On systems without weak symbols, initialized COMDAT
+ objects are emitted with internal linkage. (See
+ comdat_linkage for details.) Since we want these objects
+ to have external linkage so that copies do not have to be
+ emitted in code outside the runtime library, we make them
+ non-COMDAT here.
+
+ It might also not be necessary to follow this detail of the
+ ABI. */
+ if (!flag_weak || ! targetm.cxx.library_rtti_comdat ())
+ {
+ gcc_assert (TREE_PUBLIC (tinfo) && !DECL_COMDAT (tinfo));
+ DECL_INTERFACE_KNOWN (tinfo) = 1;
+ }
+ }
+}
+
/* Emit the type_info descriptors which are guaranteed to be in the runtime
support. Generating them here guarantees consistency with the other
structures. We use the following heuristic to determine when the runtime
@@ -1507,42 +1545,9 @@ emit_support_tinfos (void)
return;
doing_runtime = 1;
for (ix = 0; fundamentals[ix]; ix++)
- {
- tree bltn = *fundamentals[ix];
- tree types[3];
- int i;
-
- if (bltn == NULL_TREE)
- continue;
- types[0] = bltn;
- types[1] = build_pointer_type (bltn);
- types[2] = build_pointer_type (cp_build_qualified_type (bltn,
- TYPE_QUAL_CONST));
-
- for (i = 0; i < 3; ++i)
- {
- tree tinfo;
-
- tinfo = get_tinfo_decl (types[i]);
- TREE_USED (tinfo) = 1;
- mark_needed (tinfo);
- /* The C++ ABI requires that these objects be COMDAT. But,
- On systems without weak symbols, initialized COMDAT
- objects are emitted with internal linkage. (See
- comdat_linkage for details.) Since we want these objects
- to have external linkage so that copies do not have to be
- emitted in code outside the runtime library, we make them
- non-COMDAT here.
-
- It might also not be necessary to follow this detail of the
- ABI. */
- if (!flag_weak || ! targetm.cxx.library_rtti_comdat ())
- {
- gcc_assert (TREE_PUBLIC (tinfo) && !DECL_COMDAT (tinfo));
- DECL_INTERFACE_KNOWN (tinfo) = 1;
- }
- }
- }
+ emit_support_tinfo_1 (*fundamentals[ix]);
+ for (tree t = registered_builtin_types; t; t = TREE_CHAIN (t))
+ emit_support_tinfo_1 (TREE_VALUE (t));
}
/* Finish a type info decl. DECL_PTR is a pointer to an unemitted