From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4342 invoked by alias); 1 Dec 2009 21:03:37 -0000 Received: (qmail 4170 invoked by uid 22791); 1 Dec 2009 21:03:34 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 01 Dec 2009 21:03:29 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 3C4C01096E; Tue, 1 Dec 2009 21:03:27 +0000 (GMT) Received: from caradoc.them.org (209.195.188.212.nauticom.net [209.195.188.212]) by nan.false.org (Postfix) with ESMTP id 0F009105BF; Tue, 1 Dec 2009 21:03:27 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1NFZsb-0005Tj-QM; Tue, 01 Dec 2009 16:03:25 -0500 Date: Tue, 01 Dec 2009 21:15:00 -0000 From: Daniel Jacobowitz To: Jakub Jelinek Cc: Jason Merrill , gcc-patches@gcc.gnu.org Subject: Re: [C++ PATCH] Optimize C++ comdat ctors/dtors in classes without virtual bases (PR c++/3187, take 3) Message-ID: <20091201210325.GA19501@caradoc.them.org> Mail-Followup-To: Jakub Jelinek , Jason Merrill , gcc-patches@gcc.gnu.org References: <20091130223653.GO22813@hs20-bc2-1.build.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091130223653.GO22813@hs20-bc2-1.build.redhat.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes 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: 2009-12/txt/msg00099.txt.bz2 On Mon, Nov 30, 2009 at 05:36:53PM -0500, Jakub Jelinek wrote: > Hi! > > Here is the latest version of the cdtor optimization patch. > The comdat group name is *[CD]5* and if the dtor is virtual, deleting dtor > is emitted into that comdat group as well. > libstdc++ symbol version script has been adjusted, so that it exports > exactly what it used to export before this patch. > On x86_64-linux this patch saves 21KB of libstdc++.so's .text. Can you explain how this patch is ABI-safe at the object (.o) level? Suppose that some other or older compiler creates a C0 comdat group in first.o. second.o references the C0 symbol. Then suppose that GCC creates a C5 comdat group in third.o, and defines C0 and C1 in that group. A reference to C1 will now pull in the group in third.o and we have two definitions of the global symbol for the C0 constructor. Neither can be discarded at this point. -- Daniel Jacobowitz CodeSourcery