From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13240 invoked by alias); 26 Oct 2009 11:14:58 -0000 Received: (qmail 13223 invoked by uid 22791); 26 Oct 2009 11:14:56 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS 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; Mon, 26 Oct 2009 11:14:51 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n9QBEnGO003389; Mon, 26 Oct 2009 07:14:49 -0400 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [10.16.42.4]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n9QBEmog014362 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 26 Oct 2009 07:14:49 -0400 Received: (from jakub@localhost) by tyan-ft48-01.lab.bos.redhat.com (8.14.2/8.14.2/Submit) id n9QBEmIm013965; Mon, 26 Oct 2009 12:14:48 +0100 Date: Mon, 26 Oct 2009 11:15:00 -0000 From: Jakub Jelinek To: Jerry Quinn Cc: Jason Merrill , GCC , "gcc-patches@gcc.gnu.org" Subject: Re: enable-build-with-cxx bootstrap compare broken by r149964 Message-ID: <20091026111448.GZ14664@tyan-ft48-01.lab.bos.redhat.com> Reply-To: Jakub Jelinek References: <1250345548.19163.155.camel@cerberus.qb5.org> <4A960A78.8040704@redhat.com> <1251694626.7629.2.camel@cerberus.qb5.org> <4AAE6745.3070706@redhat.com> <4AB7B28E.7030501@redhat.com> <1253617474.4274.2795.camel@cerberus.qb5.org> <4AB8D3D1.8010704@redhat.com> <1253712164.4274.2800.camel@cerberus.qb5.org> <4ABA391C.2050903@redhat.com> <1256357452.31533.131.camel@cerberus.qb5.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1256357452.31533.131.camel@cerberus.qb5.org> User-Agent: Mutt/1.5.18 (2008-05-17) 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-10/txt/msg01553.txt.bz2 Hi! Just some random comments: On Sat, Oct 24, 2009 at 12:10:52AM -0400, Jerry Quinn wrote: > + if (mark_private) > + { > + /* Inject '*' at beginning of name to force pointer comparison. > */ > + char* buf = (char*) XNEWVEC (char, length + 1); > + buf[0] = '*'; > + memcpy (buf + 1, name, length); > + name_string = build_string (length + 1, buf); > + XDELETEVEC (buf); You could as well use XALLOCAVEC (char, length + 1) and remove XDELETEVEC. No need to cast the result of XNEWVEC or XALLOCAVEC to char *. And, the formatting is wrong, space goes after char, no space between * and buf. > /* Generate the NTBS array variable. */ > tree name_type = build_cplus_array_type > (build_qualified_type (char_type_node, TYPE_QUAL_CONST), > NULL_TREE); > - tree name_string = tinfo_name (target); > + // tree name_string = tinfo_name (target); This should be removed, rather than commented out. > @@ -2921,10 +2893,6 @@ > name_base = obstack_alloc (&name_obstack, 0); > } > > -/* Done with mangling. If WARN is true, and the name of G.entity will > - be mangled differently in a future version of the ABI, issue a > - warning. */ > - > static void > finish_mangling_internal (const bool warn) > { Why are you removing the comment? > @@ -3011,18 +2979,15 @@ > SET_DECL_ASSEMBLER_NAME (decl, id); > } > > -/* Generate the mangled representation of TYPE for the typeinfo name. > */ > +/* Generate the mangled representation of TYPE. */ > > const char * > -mangle_type_string_for_rtti (const tree type) > +mangle_type_string (const tree type) Why this change? > bool operator==(const type_info& __arg) const > { > return ((__name == __arg.__name) > - || __builtin_strcmp (__name, __arg.__name) == 0); > + || (__name[0] != '*' && __arg.__name[0] != '*' && > + __builtin_strcmp (__name, __arg.__name) == 0)); I see no point in both tests for * here, just __name[0] != '*' should be enough (or __arg.__name[0] != '*'). If one string starts with * and the other doesn't, strcmp will return non-0. > --- libstdc++-v3/libsupc++/tinfo.cc (revision 153489) > +++ libstdc++-v3/libsupc++/tinfo.cc (working copy) > @@ -41,7 +41,9 @@ > #if __GXX_MERGED_TYPEINFO_NAMES > return name () == arg.name (); > #else > - return (&arg == this) || (__builtin_strcmp (name (), arg.name ()) == > 0); > + return (&arg == this) > + || (name ()[0] != '*' && arg.name ()[0] != '*' > + && (__builtin_strcmp (name (), arg.name ()) == 0)); > #endif > } Likewise. Jakub