From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15476 invoked by alias); 23 Apr 2002 10:28:48 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 15444 invoked from network); 23 Apr 2002 10:28:43 -0000 Received: from unknown (HELO mta03bw.bigpond.com) (139.134.6.86) by sources.redhat.com with SMTP; 23 Apr 2002 10:28:43 -0000 Received: from bubble.local ([144.135.24.81]) by mta03bw.bigpond.com (Netscape Messaging Server 4.15 mta03bw Feb 26 2002 03:44:21) with SMTP id GV0NRT00.9D1 for ; Tue, 23 Apr 2002 20:28:41 +1000 Received: from CPE-144-136-176-14.sa.bigpond.net.au ([144.136.176.14]) by bwmam05.mailsvc.email.bigpond.com(MailRouter V3.0l 44/279729); 23 Apr 2002 20:28:40 Received: (qmail 9753 invoked by uid 179); 23 Apr 2002 10:28:40 -0000 Date: Tue, 23 Apr 2002 03:53:00 -0000 From: Alan Modra To: Mark Mitchell Cc: gcc@gcc.gnu.org Subject: Re: GCC 3.1 Prerelease Message-ID: <20020423102840.GG31160@bubble.sa.bigpond.net.au> Mail-Followup-To: Mark Mitchell , gcc@gcc.gnu.org References: <14800000.1019552485@gandalf.codesourcery.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <14800000.1019552485@gandalf.codesourcery.com> User-Agent: Mutt/1.3.25i X-SW-Source: 2002-04/txt/msg01151.txt.bz2 On Tue, Apr 23, 2002 at 02:01:25AM -0700, Mark Mitchell wrote: > > Joseph, if you have time to look at PR 6343 (C front end regression > involving "attribute((weak))"), please do so. I can imagine this > being a significant problem. I've been using this, which at least cures the problem with __register_frame_info*. Credit for the patch goes to Franz Sirl. diff -urpN -xCVS -x'*~' -xTAGS gcc-31.orig/gcc/c-decl.c gcc-31/gcc/c-decl.c --- gcc-31.orig/gcc/c-decl.c 2002-04-03 09:00:04.000000000 +0930 +++ gcc-31/gcc/c-decl.c 2002-04-23 18:06:31.000000000 +0930 @@ -1955,7 +1955,16 @@ duplicate_decls (newdecl, olddecl, diffe } /* Merge the storage class information. */ - DECL_WEAK (newdecl) |= DECL_WEAK (olddecl); + if (DECL_WEAK (newdecl) && !DECL_WEAK (olddecl)) + declare_weak (olddecl); + if (!DECL_WEAK (newdecl) && DECL_WEAK (olddecl)) + declare_weak (newdecl); + if (DECL_WEAK (newdecl) && DECL_RTL (newdecl) + && GET_CODE (DECL_RTL (newdecl)) == MEM + && XEXP (DECL_RTL (newdecl), 0) + && GET_CODE (XEXP (DECL_RTL (newdecl), 0)) == SYMBOL_REF) + SYMBOL_REF_WEAK (XEXP (DECL_RTL (newdecl), 0)) = 1; + /* For functions, static overrides non-static. */ if (TREE_CODE (newdecl) == FUNCTION_DECL) { diff -urpN -xCVS -x'*~' -xTAGS gcc-31.orig/gcc/cp/decl.c gcc-31/gcc/cp/decl.c --- gcc-31.orig/gcc/cp/decl.c 2002-04-17 18:56:57.000000000 +0930 +++ gcc-31/gcc/cp/decl.c 2002-04-23 18:06:31.000000000 +0930 @@ -3645,7 +3645,15 @@ duplicate_decls (newdecl, olddecl) } /* Merge the storage class information. */ - DECL_WEAK (newdecl) |= DECL_WEAK (olddecl); + if (DECL_WEAK (newdecl) && !DECL_WEAK (olddecl)) + declare_weak (olddecl); + if (!DECL_WEAK (newdecl) && DECL_WEAK (olddecl)) + declare_weak (newdecl); + if (DECL_WEAK (newdecl) && DECL_RTL (newdecl) + && GET_CODE (DECL_RTL (newdecl)) == MEM + && XEXP (DECL_RTL (newdecl), 0) + && GET_CODE (XEXP (DECL_RTL (newdecl), 0)) == SYMBOL_REF) + SYMBOL_REF_WEAK (XEXP (DECL_RTL (newdecl), 0)) = 1; DECL_ONE_ONLY (newdecl) |= DECL_ONE_ONLY (olddecl); DECL_DEFER_OUTPUT (newdecl) |= DECL_DEFER_OUTPUT (olddecl); TREE_PUBLIC (newdecl) = TREE_PUBLIC (olddecl); -- Alan Modra IBM OzLabs - Linux Technology Centre