From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30174 invoked by alias); 10 Jul 2009 19:35:54 -0000 Received: (qmail 30164 invoked by uid 22791); 10 Jul 2009 19:35:53 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 10 Jul 2009 19:35:47 +0000 Received: from wpaz17.hot.corp.google.com (wpaz17.hot.corp.google.com [172.24.198.81]) by smtp-out.google.com with ESMTP id n6AJZhCt029938 for ; Fri, 10 Jul 2009 20:35:44 +0100 Received: from ey-out-1920.google.com (eye13.prod.google.com [10.208.5.13]) by wpaz17.hot.corp.google.com with ESMTP id n6AJZakE001374 for ; Fri, 10 Jul 2009 12:35:36 -0700 Received: by ey-out-1920.google.com with SMTP id 13so226498eye.62 for ; Fri, 10 Jul 2009 12:35:36 -0700 (PDT) Received: by 10.210.116.14 with SMTP id o14mr2809678ebc.97.1247254535999; Fri, 10 Jul 2009 12:35:35 -0700 (PDT) Received: from localhost.localdomain.google.com (dhcp-172-22-125-203.mtv.corp.google.com [172.22.125.203]) by mx.google.com with ESMTPS id 7sm3297820eyb.55.2009.07.10.12.35.33 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 10 Jul 2009 12:35:35 -0700 (PDT) To: Lassi Tuura Cc: , Peter Elmer , Giulio Eulisse Subject: Re: -fvisibility-inlines-hidden not hiding inline methods? References: From: Ian Lance Taylor Date: Fri, 10 Jul 2009 19:35:00 -0000 In-Reply-To: (Lassi Tuura's message of "Fri\, 10 Jul 2009 17\:25\:01 +0200") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2009-07/txt/msg00161.txt.bz2 Lassi Tuura writes: >> -fvisibility-inlines-hidden only affects inline methods. It does not >> affect inline functions which are not methods. E.g., your test cases >> uses std::sort, but std::sort is not an inline method of any class. >> In >> general -fvisibility-inlines-hidden does not apply to template >> instantiations, since that would break explicit instantiations. > > Thanks. We do see this happening for members as well such as > std::vector::_M_insert_aux. Do I understand you correctly the > option only applies to non-template inline member functions? That > would be unfortunate as we have by far more template-generated inline > goo than other origins :-/ > > Is there any way to override the above restriction to apply to all > inlines - or at least templates and out-of-class free functions > included - and/or would a patch to enable such behaviour be accepted? > Should one expect any major drawbacks for such a change on pretty bog > standard C++ use, such as standard library or boost? > > Is different visibility for template specialisations common for those > that use the option? I couldn't think of any construct in our code > that would call for it, and was wondering if there were examples of > how it's used elsewhere so that I don't misunderstand this feature. I think you understand me correctly. The problem with templates is that changing the visibility will break explicit instantiation--that is, -fvisibility-inlines-hidden will always work as long as you don't compare function pointers. I think it would be OK to have an option which says that you also promise not to use explicit instantiation. Ian