From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5589 invoked by alias); 9 Jul 2004 06:00:59 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 5462 invoked from network); 9 Jul 2004 06:00:55 -0000 Received: from unknown (HELO mail-out3.apple.com) (17.254.13.22) by sourceware.org with SMTP; 9 Jul 2004 06:00:55 -0000 Received: from mailgate1.apple.com (a17-128-100-225.apple.com [17.128.100.225]) by mail-out3.apple.com (8.12.11/8.12.11) with ESMTP id i6961U6i003803; Thu, 8 Jul 2004 23:01:30 -0700 (PDT) Received: from relay4.apple.com (relay4.apple.com) by mailgate1.apple.com (Content Technologies SMTPRS 4.3.12) with ESMTP id ; Thu, 8 Jul 2004 23:00:54 -0700 Received: from [17.201.26.99] (il0102b-dhcp49.apple.com [17.201.26.99]) by relay4.apple.com (8.12.11/8.12.11) with ESMTP id i6960beU025280; Thu, 8 Jul 2004 23:00:37 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v667) In-Reply-To: <20040709055003.GA29236@lucon.org> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <4C6A1D9B-D16D-11D8-BC99-00039351ED8A@apple.com> Cc: gcc@gcc.gnu.org, Andrew Pinski , Andrew Pinski Content-Transfer-Encoding: 7bit From: Andrew Pinski Subject: [PATCH] Re: 21 GCC HEAD regressions, 2 new, with your patch on 2004-07-07T22:45:18Z. Date: Fri, 09 Jul 2004 06:24:00 -0000 To: gcc-patches@gcc.gnu.org X-SW-Source: 2004-07/txt/msg00886.txt.bz2 > > It looks like we may need a undo_make_decl_one_only if we have to > change our mind like that. Yes and I was just creating one. Here is the patch which fixes the problem for me on powerpc-apple-darwin. OK? Bootstrapped on powerpc-apple-darwin. I have not added to the other targets which need the macro also. The C++ part and the other target support is needed for the 3.4 branch also. Thanks, Andrew Pinski ChangLog: * config/darwin-protos.h (darwin_make_decl_non_one_only): Prototype. * config/darwin.c (darwin_make_decl_non_one_only): Declare. * config/darwin.h (MAKE_DECL_NON_ONE_ONLY): Declare. * doc/tm.texi (MAKE_DECL_NON_ONE_ONLY): Document. cp/ChangeLog: * cp/rtti.c (emit_tinfo_decl): Call MAKE_DECL_NON_ONE_ONLY when making the decl non weak. Index: config/darwin-protos.h =================================================================== RCS file: /cvs/gcc/gcc/gcc/config/darwin-protos.h,v retrieving revision 1.35 diff -u -p -r1.35 darwin-protos.h --- config/darwin-protos.h 19 May 2004 02:11:42 -0000 1.35 +++ config/darwin-protos.h 9 Jul 2004 05:54:57 -0000 @@ -85,6 +85,7 @@ extern void darwin_pragma_unused (struct extern void darwin_file_end (void); extern void darwin_make_decl_one_only (tree decl); +extern void darwin_make_decl_non_one_only (tree decl); /* Expanded by EXTRA_SECTION_FUNCTIONS into varasm.o. */ extern void const_section (void); Index: config/darwin.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/config/darwin.c,v retrieving revision 1.70 diff -u -p -r1.70 darwin.c --- config/darwin.c 8 Jul 2004 00:12:27 -0000 1.70 +++ config/darwin.c 9 Jul 2004 05:54:57 -0000 @@ -1142,6 +1142,14 @@ darwin_make_decl_one_only (tree decl) } void +darwin_make_decl_non_one_only (tree decl) +{ + TREE_PUBLIC (decl) = 0; + DECL_ONE_ONLY (decl) = 0; + DECL_SECTION_NAME (decl) = NULL; +} + +void machopic_select_section (tree exp, int reloc, unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED) { Index: config/darwin.h =================================================================== RCS file: /cvs/gcc/gcc/gcc/config/darwin.h,v retrieving revision 1.83 diff -u -p -r1.83 darwin.h --- config/darwin.h 8 Jul 2004 00:12:27 -0000 1.83 +++ config/darwin.h 9 Jul 2004 05:54:57 -0000 @@ -336,6 +336,10 @@ do { text_section (); \ /* Making a symbols weak on Darwin requires more than just setting DECL_WEAK. */ #define MAKE_DECL_ONE_ONLY(DECL) darwin_make_decl_one_only (DECL) +/* Making a symbol non-weak again on Darwin requires more than just setting + DECL_WEAK. */ +#define MAKE_DECL_NON_ONE_ONLY(DECL) darwin_make_decl_non_one_only (DECL) + /* Representation of linkonce symbols for the MACH-O assembler. Linkonce symbols must be given a special section *and* must be preceded by a special assembler directive. */ Index: cp/rtti.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/cp/rtti.c,v retrieving revision 1.186 diff -u -p -r1.186 rtti.c --- cp/rtti.c 7 Jul 2004 18:29:38 -0000 1.186 +++ cp/rtti.c 9 Jul 2004 05:54:57 -0000 @@ -1464,7 +1464,15 @@ emit_tinfo_decl (tree decl) { DECL_COMDAT (decl) = 0; if (SUPPORTS_ONE_ONLY) - DECL_ONE_ONLY (decl) = 0; + { + if (DECL_ONE_ONLY (decl)) + { +#ifdef MAKE_DECL_NON_ONE_ONLY + MAKE_DECL_NON_ONE_ONLY (decl); +#endif + DECL_ONE_ONLY (decl) = 0; + } + } } DECL_INITIAL (decl) = var_init; Index: doc/tm.texi =================================================================== RCS file: /cvs/gcc/gcc/gcc/doc/tm.texi,v retrieving revision 1.337 diff -u -p -r1.337 tm.texi --- doc/tm.texi 5 Jul 2004 19:49:20 -0000 1.337 +++ doc/tm.texi 9 Jul 2004 05:54:58 -0000 @@ -6763,6 +6763,13 @@ section flags in the Microsoft Windows P requires changes to @var{decl}, such as putting it in a separate section. @end defmac +@defmac MAKE_DECL_NON_ONE_ONLY (@var{decl}) +A C statement (sans semicolon) to mark @var{decl} to be emitted as a +public symbol such that extra copies in multiple translation units will +be not discarded by the linker. This is used to revert the effects of +the MAKE_DECL_ONE_ONLY macro. +@end defmac + @defmac SUPPORTS_ONE_ONLY A C expression which evaluates to true if the target supports one-only semantics.