Re: enable-build-with-cxx bootstrap compare broken by r149964

2009-10-31 Thread Jason Merrill
Here's the fix I'm checking in for the * path. Jason commit 16463ef55164d4668d6f1eeb150974452e1dbe58 Author: Jason Merrill Date: Sat Oct 31 18:10:17 2009 -0400 * rtti.c (tinfo_name): Fix lengths for private case. diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index 2926f97..c7af74a 100644 -

Re: enable-build-with-cxx bootstrap compare broken by r149964

2009-10-28 Thread Jason Merrill
On 10/29/2009 01:06 AM, Jerry Quinn wrote: And here is the latest patch. This one is OK, thanks. Jason

Re: enable-build-with-cxx bootstrap compare broken by r149964

2009-10-28 Thread Jerry Quinn
On Wed, 2009-10-28 at 11:35 -0400, Jason Merrill wrote: > On 10/28/2009 07:29 AM, Jerry Quinn wrote: > > + length = strlen (name); > > + if (mark_private) > > + name_string = build_string (length + 1, buf); > > + else > > +name_string = build_string (length + 1, name); > > These two ca

Re: enable-build-with-cxx bootstrap compare broken by r149964

2009-10-28 Thread Jason Merrill
On 10/28/2009 07:29 AM, Jerry Quinn wrote: + length = strlen (name); + if (mark_private) + name_string = build_string (length + 1, buf); + else +name_string = build_string (length + 1, name); These two calls shouldn't be using the same length. I think the +1 in the old code was un

Re: enable-build-with-cxx bootstrap compare broken by r149964

2009-10-28 Thread Jerry Quinn
On Mon, 2009-10-26 at 09:53 -0400, Jason Merrill wrote: > On 10/26/2009 07:14 AM, Jakub Jelinek wrote: > >> -/* Generate the mangled representation of TYPE for the typeinfo name. > >> */ > >> +/* Generate the mangled representation of TYPE. */ > >> > >> const char * > >> -mangle_type_string_for_

Re: enable-build-with-cxx bootstrap compare broken by r149964

2009-10-26 Thread Jason Merrill
On 10/26/2009 07:14 AM, Jakub Jelinek wrote: -/* 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? Thi

Re: enable-build-with-cxx bootstrap compare broken by r149964

2009-10-26 Thread Jakub Jelinek
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

Re: enable-build-with-cxx bootstrap compare broken by r149964

2009-10-23 Thread Jerry Quinn
On Wed, 2009-09-23 at 11:05 -0400, Jason Merrill wrote: > On 09/23/2009 09:22 AM, Jerry Quinn wrote: > > I'm not really sure how everything fits together here. Am I missing > > something obvious? > > I notice that you're missing the fix_string_type that tinfo_name does. > But I'd rather not dupl

Re: enable-build-with-cxx bootstrap compare broken by r149964

2009-09-23 Thread Jason Merrill
On 09/23/2009 09:22 AM, Jerry Quinn wrote: I'm not really sure how everything fits together here. Am I missing something obvious? I notice that you're missing the fix_string_type that tinfo_name does. But I'd rather not duplicate the code that creates the STRING_CST; better to delay the call

Re: enable-build-with-cxx bootstrap compare broken by r149964

2009-09-23 Thread Jerry Quinn
On Tue, 2009-09-22 at 09:40 -0400, Jason Merrill wrote: > On 09/22/2009 07:04 AM, Jerry Quinn wrote: > > On Mon, 2009-09-21 at 13:06 -0400, Jason Merrill wrote: > >> On 09/14/2009 11:54 AM, Jason Merrill wrote: > >>> I think the way to go with this is to revert the compiler bits of > >>> r149964, n

Re: enable-build-with-cxx bootstrap compare broken by r149964

2009-09-22 Thread Jason Merrill
On 09/22/2009 07:04 AM, Jerry Quinn wrote: On Mon, 2009-09-21 at 13:06 -0400, Jason Merrill wrote: On 09/14/2009 11:54 AM, Jason Merrill wrote: I think the way to go with this is to revert the compiler bits of r149964, not mess with mangle.c at all, and insert the initial * if the typeinfo name

Re: enable-build-with-cxx bootstrap compare broken by r149964

2009-09-22 Thread Jerry Quinn
On Mon, 2009-09-21 at 13:06 -0400, Jason Merrill wrote: > On 09/14/2009 11:54 AM, Jason Merrill wrote: > > I think the way to go with this is to revert the compiler bits of > > r149964, not mess with mangle.c at all, and insert the initial * if the > > typeinfo name won't have TREE_PUBLIC set, sinc

Re: enable-build-with-cxx bootstrap compare broken by r149964

2009-09-21 Thread Jason Merrill
On 09/21/2009 02:43 PM, Jerry Quinn wrote: Another approach could be to use 2 different names for anonymous namespaces that should and should not be compared by pointer. I don't like the speed implications, but it might work. Any type that involves the anonymous namespace should be compared by

Re: enable-build-with-cxx bootstrap compare broken by r149964

2009-09-21 Thread Jerry Quinn
On Mon, 2009-09-21 at 13:06 -0400, Jason Merrill wrote: > On 09/14/2009 11:54 AM, Jason Merrill wrote: > > I think the way to go with this is to revert the compiler bits of > > r149964, not mess with mangle.c at all, and insert the initial * if the > > typeinfo name won't have TREE_PUBLIC set, sinc

Re: enable-build-with-cxx bootstrap compare broken by r149964

2009-09-21 Thread Jason Merrill
On 09/14/2009 11:54 AM, Jason Merrill wrote: I think the way to go with this is to revert the compiler bits of r149964, not mess with mangle.c at all, and insert the initial * if the typeinfo name won't have TREE_PUBLIC set, since that's precisely the property we want to mirror in comparison. T

Re: enable-build-with-cxx bootstrap compare broken by r149964

2009-09-14 Thread Jason Merrill
On 08/31/2009 12:57 AM, Jerry Quinn wrote: On Thu, 2009-08-27 at 00:24 -0400, Jason Merrill wrote: Do you know why r149964 makes a difference? I understand now. The patch changed the anonymous namespace name to use get_file_function_name in all cases, where previously we were using the same

Re: enable-build-with-cxx bootstrap compare broken by r149964

2009-09-03 Thread Alexandre Oliva
On Aug 27, 2009, Jason Merrill wrote: > On 08/15/2009 10:12 AM, Jerry Quinn wrote: >> Building with --enable-build-with-cxx fails to bootstrap as follows: >> >> x86_64-unknown-linux-gnu/32/libstdc++-v3/libsupc++/eh_alloc.o differs >> ... > Do you know why r149964 makes a difference? No idea if

Re: enable-build-with-cxx bootstrap compare broken by r149964

2009-08-30 Thread Jerry Quinn
On Thu, 2009-08-27 at 00:24 -0400, Jason Merrill wrote: > On 08/15/2009 10:12 AM, Jerry Quinn wrote: > > Building with --enable-build-with-cxx fails to bootstrap as follows: > > > > Comparing stages 2 and 3 > > warning: gcc/cc1plus-checksum.o differs > > warning: gcc/cc1-checksum.o differs > > Boot

Re: enable-build-with-cxx bootstrap compare broken by r149964

2009-08-26 Thread Jason Merrill
On 08/15/2009 10:12 AM, Jerry Quinn wrote: Building with --enable-build-with-cxx fails to bootstrap as follows: Comparing stages 2 and 3 warning: gcc/cc1plus-checksum.o differs warning: gcc/cc1-checksum.o differs Bootstrap comparison failure! x86_64-unknown-linux-gnu/32/libstdc++-v3/libsupc++/eh

Re: enable-build-with-cxx bootstrap compare broken by r149964

2009-08-22 Thread Jerry Quinn
On Fri, 2009-08-21 at 15:25 -0700, Richard Henderson wrote: > On 08/21/2009 02:37 PM, Jerry Quinn wrote: > > OK, I've gotten almost this far and can bootstrap (the asterisk is > > actually not the very first char and I have to figure that out). > > However, in the referenced test case, both typeinf

Re: enable-build-with-cxx bootstrap compare broken by r149964

2009-08-21 Thread Richard Henderson
On 08/21/2009 02:37 PM, Jerry Quinn wrote: OK, I've gotten almost this far and can bootstrap (the asterisk is actually not the very first char and I have to figure that out). However, in the referenced test case, both typeinfos are apparently merged, thus returning the same pointer for their name

Re: enable-build-with-cxx bootstrap compare broken by r149964

2009-08-21 Thread Jerry Quinn
On Thu, 2009-08-20 at 15:22 +0100, Dave Korn wrote: > Your patch puts the asterisk into the namespace identifier decl, so it ends > up in both the rtti NTBS name string, and also in the generated asm name for > the objects. What I think you need to do is use an identifier for the > anonymous nam

Re: enable-build-with-cxx bootstrap compare broken by r149964

2009-08-20 Thread Dave Korn
Dave Korn wrote: > What I think you need to do is use an identifier for the > anonymous namespace without an asterisk, but prefix the asterisk when > generating the corresponding NTBS name string; then your changes to the name > comparison routines in libsupc++ should work, but the typeinfo name st

Re: enable-build-with-cxx bootstrap compare broken by r149964

2009-08-20 Thread Dave Korn
Jerry Quinn wrote: > > OK, I'm now confused. How does this dovetail with anonymous > namespaces? We're talking about typeinfo strings. The namespace is part of the typeinfo name string (the so-called NTBS name), and it's the random number in the anonymous namespace name used for these local

Re: enable-build-with-cxx bootstrap compare broken by r149964

2009-08-20 Thread Jerry Quinn
On Thu, 2009-08-20 at 14:05 +0100, Dave Korn wrote: > Jerry Quinn wrote: > > On Thu, 2009-08-20 at 11:12 +0100, Dave Korn wrote: > >> Jerry Quinn wrote: > > >>> Apparently my change is too naive, because the assembler doesn't like a > >>> name with '*' in it. Are there any chars that can pass mus

Re: enable-build-with-cxx bootstrap compare broken by r149964

2009-08-20 Thread Dave Korn
Jerry Quinn wrote: > On Thu, 2009-08-20 at 11:12 +0100, Dave Korn wrote: >> Jerry Quinn wrote: >>> Apparently my change is too naive, because the assembler doesn't like a >>> name with '*' in it. Are there any chars that can pass muster with >>> assemblers but not be a valid namespace identifier?

Re: enable-build-with-cxx bootstrap compare broken by r149964

2009-08-20 Thread Jerry Quinn
On Thu, 2009-08-20 at 11:12 +0100, Dave Korn wrote: > Jerry Quinn wrote: > > On Tue, 2009-08-18 at 08:43 -0700, Richard Henderson wrote: > >> On 08/17/2009 07:40 PM, Jerry Quinn wrote: > >>> On Mon, 2009-08-17 at 16:16 -0400, Jason Merrill wrote: > I'm not sure why GCC sources would need to ma

Re: enable-build-with-cxx bootstrap compare broken by r149964

2009-08-20 Thread Dave Korn
Jerry Quinn wrote: > On Tue, 2009-08-18 at 08:43 -0700, Richard Henderson wrote: >> On 08/17/2009 07:40 PM, Jerry Quinn wrote: >>> On Mon, 2009-08-17 at 16:16 -0400, Jason Merrill wrote: I'm not sure why GCC sources would need to mangle function-local structs, though. >> Would it be helpf

Re: enable-build-with-cxx bootstrap compare broken by r149964

2009-08-19 Thread Jerry Quinn
On Tue, 2009-08-18 at 08:43 -0700, Richard Henderson wrote: > On 08/17/2009 07:40 PM, Jerry Quinn wrote: > > On Mon, 2009-08-17 at 16:16 -0400, Jason Merrill wrote: > >> I'm not sure why GCC sources would need to mangle function-local > >> structs, though. > > > Would it be helpful to reserve a lea

Re: enable-build-with-cxx bootstrap compare broken by r149964

2009-08-18 Thread Jason Merrill
On 08/18/2009 11:43 AM, Richard Henderson wrote: Would it be helpful to reserve a leading character (say, "*") that means that strcmp should not apply, but rather pointer identity? Thus a class foo that is intended to be local, as opposed to forced local via RTLD_LOCAL, can just use "*foo" and no

Re: enable-build-with-cxx bootstrap compare broken by r149964

2009-08-18 Thread Richard Henderson
On 08/17/2009 07:40 PM, Jerry Quinn wrote: On Mon, 2009-08-17 at 16:16 -0400, Jason Merrill wrote: I'm not sure why GCC sources would need to mangle function-local structs, though. I'm not sure if the following is relevant, but I found it in cp/mangle.c: /* Since we now use strcmp to compare

Re: enable-build-with-cxx bootstrap compare broken by r149964

2009-08-17 Thread Jerry Quinn
On Mon, 2009-08-17 at 16:16 -0400, Jason Merrill wrote: > On 08/15/2009 10:12 AM, Jerry Quinn wrote: > > Bootstrap comparison failure! > >[...] > > (write_nested_name): Add a fake anonymous namespace scope if > > true. > > What I assume is going on here is that use of anonymous namespace

Re: enable-build-with-cxx bootstrap compare broken by r149964

2009-08-17 Thread Jason Merrill
On 08/15/2009 10:12 AM, Jerry Quinn wrote: Bootstrap comparison failure! >[...] (write_nested_name): Add a fake anonymous namespace scope if true. What I assume is going on here is that use of anonymous namespaces can break bitwise comparison, because get_file_function_name uses a r

enable-build-with-cxx bootstrap compare broken by r149964

2009-08-15 Thread Jerry Quinn
Hi, folks, Building with --enable-build-with-cxx fails to bootstrap as follows: Comparing stages 2 and 3 warning: gcc/cc1plus-checksum.o differs warning: gcc/cc1-checksum.o differs Bootstrap comparison failure! x86_64-unknown-linux-gnu/32/libstdc++-v3/libsupc++/eh_alloc.o differs x86_64-unknown-l