From: Jakub Jelinek <jakub@redhat.com>
To: Jerry Quinn <jlquinn@optonline.net>
Cc: Jason Merrill <jason@redhat.com>, GCC <gcc@gcc.gnu.org>,
"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: enable-build-with-cxx bootstrap compare broken by r149964
Date: Mon, 26 Oct 2009 11:15:00 -0000 [thread overview]
Message-ID: <20091026111448.GZ14664@tyan-ft48-01.lab.bos.redhat.com> (raw)
In-Reply-To: <1256357452.31533.131.camel@cerberus.qb5.org>
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
next prev parent reply other threads:[~2009-10-26 11:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1250345548.19163.155.camel@cerberus.qb5.org>
[not found] ` <4A89BA99.1000900@redhat.com>
[not found] ` <1250563251.4312.6.camel@cerberus.qb5.org>
[not found] ` <4A8ACC37.8020200@redhat.com>
[not found] ` <1250743680.4312.38.camel@cerberus.qb5.org>
[not found] ` <4A8D218D.20209@gmail.com>
[not found] ` <1250771594.4312.40.camel@cerberus.qb5.org>
[not found] ` <4A8D4A1A.4080902@gmail.com>
[not found] ` <1250775261.4312.48.camel@cerberus.qb5.org>
[not found] ` <4A8D5C3B.7010604@gmail.com>
[not found] ` <1250890624.4312.54.camel@cerberus.qb5.org>
[not found] ` <4A8F1EE7.9030001@redhat.com>
2009-08-22 18:57 ` Jerry Quinn
[not found] ` <4A960A78.8040704@redhat.com>
[not found] ` <1251694626.7629.2.camel@cerberus.qb5.org>
[not found] ` <4AAE6745.3070706@redhat.com>
[not found] ` <4AB7B28E.7030501@redhat.com>
[not found] ` <1253617474.4274.2795.camel@cerberus.qb5.org>
[not found] ` <4AB8D3D1.8010704@redhat.com>
[not found] ` <1253712164.4274.2800.camel@cerberus.qb5.org>
[not found] ` <4ABA391C.2050903@redhat.com>
2009-10-24 5:28 ` Jerry Quinn
2009-10-26 11:15 ` Jakub Jelinek [this message]
2009-10-26 14:42 ` Jason Merrill
2009-10-28 12:49 ` Jerry Quinn
2009-10-28 15:52 ` Jason Merrill
2009-10-29 5:35 ` Jerry Quinn
2009-10-29 6:45 ` Jason Merrill
2009-11-01 5:02 ` Jason Merrill
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091026111448.GZ14664@tyan-ft48-01.lab.bos.redhat.com \
--to=jakub@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=gcc@gcc.gnu.org \
--cc=jason@redhat.com \
--cc=jlquinn@optonline.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).