From patchwork Thu Apr 24 13:25:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Glisse X-Patchwork-Id: 342406 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 7AB0F140109 for ; Thu, 24 Apr 2014 23:25:43 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:in-reply-to:message-id:references :mime-version:content-type; q=dns; s=default; b=Zy//to4rcxYfWhys DYPjo3RjVKEXSgvDaope7xO272VS6VRtt4ZImiG7+MqsHHpZuOUV2mEKRfDBp+KC P0deub1eOtXwJOCVa+dSXDePbjKFXg/HVho6WIyUuLW4ShzuviCwsMWuGBTnNPT6 +gd4OoXMwe/vD5pIVlcxYHLYKy0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:in-reply-to:message-id:references :mime-version:content-type; s=default; bh=QCtRljBbXX6/0JFTwcZPhA PIp8I=; b=QPNpfS9n3cRLkfSad6ebJ1fUBK7wkVlixI4pF7idkMuUwre+U2m2Wh Yx/a/qCbb5RkaKJcyNI8HfSJBO3tRo4tA1mUa5jBpw6ePMKEDCUT2h8yaN+hMqPB d7UI5DrPfVzWUn/NtXWP2MHgrbe+QYHHaJTiPIFhySilBDber3uYE= Received: (qmail 2036 invoked by alias); 24 Apr 2014 13:25:36 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 2024 invoked by uid 89); 24 Apr 2014 13:25:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.8 required=5.0 tests=AWL, BAYES_99, BAYES_999, KAM_STOCKTIP, RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mail3-relais-sop.national.inria.fr Received: from mail3-relais-sop.national.inria.fr (HELO mail3-relais-sop.national.inria.fr) (192.134.164.104) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Thu, 24 Apr 2014 13:25:33 +0000 Received: from stedding.saclay.inria.fr ([193.55.250.194]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/AES128-SHA; 24 Apr 2014 15:25:13 +0200 Received: from glisse (helo=localhost) by stedding.saclay.inria.fr with local-esmtp (Exim 4.82) (envelope-from ) id 1WdJeL-0005zd-6j; Thu, 24 Apr 2014 15:25:13 +0200 Date: Thu, 24 Apr 2014 15:25:13 +0200 (CEST) From: Marc Glisse To: ramrad01@arm.com cc: Richard Henderson , gcc-patches , Jason Merrill Subject: Re: [c++] typeinfo for target types In-Reply-To: Message-ID: References: <53580A7D.5070800@redhat.com> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 On Thu, 24 Apr 2014, Ramana Radhakrishnan wrote: > On Wed, Apr 23, 2014 at 8:43 PM, Marc Glisse wrote: >> On Wed, 23 Apr 2014, Richard Henderson wrote: >> >>> On 04/13/2014 01:41 AM, Marc Glisse wrote: >>>> >>>> Hello, >>>> >>>> this patch generates typeinfo for target types. On x86_64, it adds these >>>> 6 >>>> lines to nm -C libsupc++.a. A follow-up patch will be needed to export >>>> and >>>> version those in the shared library. >>>> >>>> +0000000000000000 V typeinfo for __float128 >>>> +0000000000000000 V typeinfo for __float128 const* >>>> +0000000000000000 V typeinfo for __float128* >>>> +0000000000000000 V typeinfo name for __float128 >>>> +0000000000000000 V typeinfo name for __float128 const* >>>> +0000000000000000 V typeinfo name for __float128* >>>> >>>> Bootstrap and testsuite on x86_64-linux-gnu (a bit of noise in >>>> tsan/tls_race.c). >>>> >>>> 2014-04-13 Marc Glisse >>>> >>>> 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. >>>> >>> >>> This is causing aarch64 builds to break. >> >> >> If it is causing too much trouble, we could ifdef out the last 2 lines of >> emit_support_tinfos and revert the libstdc++ changes (or even revert the >> whole thing). >> >> >>> Any c++ compilation aborts at >> >> >> That's surprising, the code I touched is only ever supposed to run while >> compiling one file in libsupc++, if I understand correctly. >> >> >>> #0 fancy_abort (file=0x14195c8 "../../git-rh/gcc/cp/mangle.c", line=2303, >>> function=0x1419ff8 >>> "write_builtin_type") at ../../git-rh/gcc/diagnostic.c:1190 >>> #1 0x00000000007ce2b4 in write_builtin_type ( >>> type=) >>> at ../../git-rh/gcc/cp/mangle.c:2303 >>> #2 0x00000000007cc85c in write_type ( >>> type=) >>> at ../../git-rh/gcc/cp/mangle.c:1969 >>> #3 0x00000000007d4d98 in mangle_special_for_type ( >>> type=, >>> code=0x1419a98 "TI") at ../../git-rh/gcc/cp/mangle.c:3569 >>> #4 0x00000000007d4dcc in mangle_typeinfo_for_type ( >>> type=) >>> at ../../git-rh/gcc/cp/mangle.c:3585 >>> #5 0x000000000070618c in get_tinfo_decl ( >>> type=) >>> at ../../git-rh/gcc/cp/rtti.c:422 >>> #6 0x0000000000709ff0 in emit_support_tinfo_1 ( >>> bltn=) >>> at ../../git-rh/gcc/cp/rtti.c:1485 >>> #7 0x000000000070a344 in emit_support_tinfos () >>> at ../../git-rh/gcc/cp/rtti.c:1550 >>> >>> Presumably the backend needs to grow some mangling support for its >>> builtins, >> >> >> aarch64 has complicated builtins... __builtin_aarch64_simd_df uses >> double_aarch64_type_node which is not the same as double_type_node. I mostly >> looked at the x86 backend, so I didn't notice that aarch64 registers a lot >> more builtins. >> >> >>> but in the meantime can we do something less drastic than abort? >> >> >> Sounds good, but I am not sure how exactly. We could use a separate hook >> (register_builtin_type_for_typeinfo?) so back-ends have to explicitly say >> they want typeinfo, but it is ugly having to register types multiple times. >> We could add a parameter to the existing register_builtin_type saying >> whether we want typeinfo, but that means updating all back-ends. We could also make typeinfo_in_lib_p more strict so for REAL_TYPE it only returns true for the types listed in fundamentals. > Well some of these scalar types are not really user visible which is > where I believe the problem is coming from and prima-facie I don't > think we should be inventing mangling for some of these "internal" > types. If the types are not user-visible, it is not clear to me why they need to be registered with the front-end... >> We could >> get the mangling functions to take a parameter that says whether errors >> should be fatal and skip generating the typeinfo when we can't mangle, but >> there is no convenient way to communicate this mangling failure (0 bytes >> written?). >> >> Would mangling the aarch64 builtins be a lot of work? Did other platforms >> break as well? > > It's not a lot of work but I'd like to make sure we're doing the right > thing on both AArch32 and AArch64. So, for now can we just revert this > till the thing is sorted out. Ok, I'll commit the attached as soon as I've checked it isn't too broken. It is not a complete revert: splitting the rtti function is still cleaner, and the int128 symbols are still there. 2014-04-24 Marc Glisse PR libstdc++/43622 gcc/cp/ * rtti.c (emit_support_tinfos): Do not iterate on registered_builtin_types (partial revert). libstdc++/ * config/abi/pre/gnu.ver (CXXABI_1.3.9): Remove __float128 symbols. * config/abi/pre/gnu-versioned-namespace.ver: Likewise. * config/abi/post/x86_64-linux-gnu/baseline_symbols.txt: Update. Index: gcc/cp/rtti.c =================================================================== --- gcc/cp/rtti.c (revision 209747) +++ gcc/cp/rtti.c (working copy) @@ -1539,22 +1539,20 @@ emit_support_tinfos (void) /*tag_scope=*/ts_current, false); pop_abi_namespace (); if (!COMPLETE_TYPE_P (bltn_type)) return; dtor = CLASSTYPE_DESTRUCTORS (bltn_type); if (!dtor || DECL_EXTERNAL (dtor)) return; doing_runtime = 1; for (ix = 0; fundamentals[ix]; ix++) 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 tinfo decl. Determine whether it needs emitting, and if so generate the initializer. */ bool emit_tinfo_decl (tree decl) { tree type = TREE_TYPE (DECL_NAME (decl)); Index: libstdc++-v3/config/abi/post/x86_64-linux-gnu/baseline_symbols.txt =================================================================== --- libstdc++-v3/config/abi/post/x86_64-linux-gnu/baseline_symbols.txt (revision 209747) +++ libstdc++-v3/config/abi/post/x86_64-linux-gnu/baseline_symbols.txt (working copy) @@ -2618,21 +2618,20 @@ OBJECT:16:_ZTISt16nested_exception@@CXXA OBJECT:16:_ZTISt8ios_base@@GLIBCXX_3.4 OBJECT:16:_ZTISt9exception@@GLIBCXX_3.4 OBJECT:16:_ZTISt9time_base@@GLIBCXX_3.4 OBJECT:16:_ZTISt9type_info@@GLIBCXX_3.4 OBJECT:16:_ZTIa@@CXXABI_1.3 OBJECT:16:_ZTIb@@CXXABI_1.3 OBJECT:16:_ZTIc@@CXXABI_1.3 OBJECT:16:_ZTId@@CXXABI_1.3 OBJECT:16:_ZTIe@@CXXABI_1.3 OBJECT:16:_ZTIf@@CXXABI_1.3 -OBJECT:16:_ZTIg@@CXXABI_1.3.9 OBJECT:16:_ZTIh@@CXXABI_1.3 OBJECT:16:_ZTIi@@CXXABI_1.3 OBJECT:16:_ZTIj@@CXXABI_1.3 OBJECT:16:_ZTIl@@CXXABI_1.3 OBJECT:16:_ZTIm@@CXXABI_1.3 OBJECT:16:_ZTIn@@CXXABI_1.3.5 OBJECT:16:_ZTIo@@CXXABI_1.3.5 OBJECT:16:_ZTIs@@CXXABI_1.3 OBJECT:16:_ZTIt@@CXXABI_1.3 OBJECT:16:_ZTIv@@CXXABI_1.3 @@ -3119,21 +3118,20 @@ OBJECT:2:_ZNS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ECT:32:_ZTIPKi@@CXXABI_1.3 OBJECT:32:_ZTIPKj@@CXXABI_1.3 OBJECT:32:_ZTIPKl@@CXXABI_1.3 OBJECT:32:_ZTIPKm@@CXXABI_1.3 OBJECT:32:_ZTIPKn@@CXXABI_1.3.5 OBJECT:32:_ZTIPKo@@CXXABI_1.3.5 OBJECT:32:_ZTIPKs@@CXXABI_1.3 OBJECT:32:_ZTIPKt@@CXXABI_1.3 OBJECT:32:_ZTIPKv@@CXXABI_1.3 OBJECT:32:_ZTIPKw@@CXXABI_1.3 OBJECT:32:_ZTIPKx@@CXXABI_1.3 OBJECT:32:_ZTIPKy@@CXXABI_1.3 OBJECT:32:_ZTIPa@@CXXABI_1.3 OBJECT:32:_ZTIPb@@CXXABI_1.3 OBJECT:32:_ZTIPc@@CXXABI_1.3 OBJECT:32:_ZTIPd@@CXXABI_1.3 OBJECT:32:_ZTIPe@@CXXABI_1.3 OBJECT:32:_ZTIPf@@CXXABI_1.3 -OBJECT:32:_ZTIPg@@CXXABI_1.3.9 OBJECT:32:_ZTIPh@@CXXABI_1.3 OBJECT:32:_ZTIPi@@CXXABI_1.3 OBJECT:32:_ZTIPj@@CXXABI_1.3 OBJECT:32:_ZTIPl@@CXXABI_1.3 OBJECT:32:_ZTIPm@@CXXABI_1.3 OBJECT:32:_ZTIPn@@CXXABI_1.3.5 OBJECT:32:_ZTIPo@@CXXABI_1.3.5 OBJECT:32:_ZTIPs@@CXXABI_1.3 OBJECT:32:_ZTIPt@@CXXABI_1.3 OBJECT:32:_ZTIPv@@CXXABI_1.3 @@ -3228,21 +3224,20 @@ OBJECT:39:_ZTSSt13basic_filebufIwSt11cha OBJECT:39:_ZTSSt13basic_fstreamIcSt11char_traitsIcEE@@GLIBCXX_3.4 OBJECT:39:_ZTSSt13basic_fstreamIwSt11char_traitsIwEE@@GLIBCXX_3.4 OBJECT:39:_ZTSSt13basic_istreamIwSt11char_traitsIwEE@@GLIBCXX_3.4 OBJECT:39:_ZTSSt13basic_ostre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TSPKm@@CXXABI_1.3 OBJECT:4:_ZTSPKn@@CXXABI_1.3.9 OBJECT:4:_ZTSPKo@@CXXABI_1.3.9 OBJECT:4:_ZTSPKs@@CXXABI_1.3 OBJECT:4:_ZTSPKt@@CXXABI_1.3 OBJECT:4:_ZTSPKv@@CXXABI_1.3 Index: libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver =================================================================== --- libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver (revision 209747) +++ libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver (working copy) @@ -314,24 +314,24 @@ CXXABI_2.0 { # typeinfo for decimal floating point types _ZTID[fde]; _ZTIPD[fde]; _ZTIPKD[fde]; # typeinfo for decltype(nullptr) _ZTIDn; _ZTIPDn; _ZTIPKDn; - # typeinfo for __int128, unsigned __int128 and __float128 - _ZTI[gno]; - _ZTIP[gno]; - _ZTIPK[gno]; + # typeinfo for __int128 and unsigned __int128 + _ZTI[no]; + _ZTIP[no]; + _ZTIPK[no]; # virtual table _ZTVN10__cxxabiv117__array_type_infoE; _ZTVN10__cxxabiv117__class_type_infoE; _ZTVN10__cxxabiv116__enum_type_infoE; _ZTVN10__cxxabiv120__function_type_infoE; _ZTVN10__cxxabiv123__fundamental_type_infoE; _ZTVN10__cxxabiv117__pbase_type_infoE; _ZTVN10__cxxabiv129__pointer_to_member_type_infoE; _ZTVN10__cxxabiv119__pointer_type_infoE; Index: libstdc++-v3/config/abi/pre/gnu.ver =================================================================== --- libstdc++-v3/config/abi/pre/gnu.ver (revision 209747) +++ libstdc++-v3/config/abi/pre/gnu.ver (working copy) @@ -1579,29 +1579,24 @@ CXXABI_1.3.8 { _Z16__VLTRegisterSet*; _Z21__VLTRegisterSetDebug*; _Z24__VLTVerifyVtablePointer*; _Z29__VLTVerifyVtablePointerDebug*; __VLTChangePermission; } CXXABI_1.3.7; CXXABI_1.3.9 { - # typeinfo name for __int128, unsigned __int128 and __float128 - _ZTS[gno]; - _ZTSP[gno]; - _ZTSPK[gno]; - - # typeinfo for __float128 - _ZTIg; - _ZTIPg; - _ZTIPKg; + # typeinfo name for __int128 and unsigned __int128 + _ZTS[no]; + _ZTSP[no]; + _ZTSPK[no]; } CXXABI_1.3.8; # Symbols in the support library (libsupc++) supporting transactional memory. CXXABI_TM_1 { global: __cxa_tm_cleanup; };