From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29538 invoked by alias); 7 Jul 2011 02:26:39 -0000 Received: (qmail 29527 invoked by uid 22791); 7 Jul 2011 02:26:39 -0000 X-SWARE-Spam-Status: No, hits=-6.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 07 Jul 2011 02:26:24 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p672QOfS022914 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 6 Jul 2011 22:26:24 -0400 Received: from [127.0.0.1] (ovpn-113-44.phx2.redhat.com [10.3.113.44]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p672QNZQ015010 for ; Wed, 6 Jul 2011 22:26:23 -0400 Message-ID: <4E15194E.9060905@redhat.com> Date: Thu, 07 Jul 2011 05:35:00 -0000 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: gcc-patches List Subject: C++ PATCH for c++/49353 (emitting functions with DECL_EXTERNAL set) Content-Type: multipart/mixed; boundary="------------050200070706010408000204" Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-07/txt/msg00422.txt.bz2 This is a multi-part message in MIME format. --------------050200070706010408000204 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 353 The C++ front end sets DECL_EXTERNAL on functions and variables with vague linkage during most of compilation, and then clears the flag at EOF if we actually want to emit them. But we were failing to clear DECL_EXTERNAL in the case of inlines that we are emitting because of -fkeep-inline-functions. Tested x86_64-pc-linux-gnu, applying to trunk. --------------050200070706010408000204 Content-Type: text/x-patch; name="49353.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="49353.patch" Content-length: 712 commit 600157c6ee5b6425f47b24d03dceaa4b5ac06359 Author: Jason Merrill Date: Wed Jul 6 18:01:40 2011 -0400 PR c++/49353 * semantics.c (expand_or_defer_fn_1): Clear DECL_EXTERNAL on kept inlines. diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 6fcf0da..5caeafe 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -3634,7 +3634,10 @@ expand_or_defer_fn_1 (tree fn) && !DECL_REALLY_EXTERN (fn)) || (flag_keep_inline_dllexport && lookup_attribute ("dllexport", DECL_ATTRIBUTES (fn)))) - mark_needed (fn); + { + mark_needed (fn); + DECL_EXTERNAL (fn) = 0; + } } /* There's no reason to do any of the work here if we're only doing --------------050200070706010408000204--