public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/5390: Libiberty fails to demangle multi-digit template parameters.
@ 2003-03-11 20:06 Wolfgang Bangerth
  0 siblings, 0 replies; 9+ messages in thread
From: Wolfgang Bangerth @ 2003-03-11 20:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/5390; it has been noted by GNATS.

From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: DJ Delorie <dj@redhat.com>
Cc: carlo@alinoe.com, <gcc-gnats@gcc.gnu.org>
Subject: Re: c++/5390: Libiberty fails to demangle multi-digit template
 parameters.
Date: Tue, 11 Mar 2003 14:03:55 -0600 (CST)

 Carlo, DJ,
 many thanks for working this out in a professional manner!
 
 I assume I can close the report now, right?
 
 Thanks
   Wolfgang
 
 
 On Tue, 11 Mar 2003, DJ Delorie wrote:
 
 > 
 > > 2003-03-10  Carlo Wood  <carlo@gnu.org>
 > > 
 > >         * cplus-dem.c (demangle_integral_value): Correction to reflect
 > > 	patch of 2002-01-10 in order to also make negative multi-digits
 > > 	without leading underscore work.
 > 
 > Approved and applied.  Thanks!
 > 
 
 -------------------------------------------------------------------------
 Wolfgang Bangerth             email:            bangerth@ticam.utexas.edu
                               www: http://www.ticam.utexas.edu/~bangerth/
 
 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: c++/5390: Libiberty fails to demangle multi-digit template parameters.
@ 2003-03-11 20:06 DJ Delorie
  0 siblings, 0 replies; 9+ messages in thread
From: DJ Delorie @ 2003-03-11 20:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/5390; it has been noted by GNATS.

From: DJ Delorie <dj@redhat.com>
To: carlo@alinoe.com
Cc: bangerth@ticam.utexas.edu, gcc-gnats@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: Re: c++/5390: Libiberty fails to demangle multi-digit template parameters.
Date: Tue, 11 Mar 2003 14:55:47 -0500

 > 2003-03-10  Carlo Wood  <carlo@gnu.org>
 > 
 >         * cplus-dem.c (demangle_integral_value): Correction to reflect
 > 	patch of 2002-01-10 in order to also make negative multi-digits
 > 	without leading underscore work.
 
 Approved and applied.  Thanks!


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: c++/5390: Libiberty fails to demangle multi-digit template parameters.
@ 2003-03-11  2:26 Carlo Wood
  0 siblings, 0 replies; 9+ messages in thread
From: Carlo Wood @ 2003-03-11  2:26 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/5390; it has been noted by GNATS.

From: Carlo Wood <carlo@alinoe.com>
To: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
Cc: gcc-gnats@gcc.gnu.org, gcc-patches@gcc.gnu.org, dj@redhat.com
Subject: Re: c++/5390: Libiberty fails to demangle multi-digit template parameters.
Date: Tue, 11 Mar 2003 03:23:41 +0100

 --zhXaljGHf11kAtnf
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 On Mon, Mar 10, 2003 at 03:03:05PM -0600, Wolfgang Bangerth wrote:
 > >  So, as far as I am concerned you can close this PR.
 > 
 > Does this still hold given DJ's mail?
 > 
 > > (Personally, I'd fix it though if I were you - but I am a perfectionist).
 > 
 > I might if I could. I have no knowledge of gcc, libiberty, etc at all. My 
 > place is gnats, beyond that I can only try to get patch creators and 
 > reviewers into contact -- usually a fruitless endeavor...
 
 I tested it again and, as I've written to DJ in private, it seems
 that my patch WAS applied more or less to gcc version 3.1.
 However, the way it is now is that it doesn't work for negative
 template integrals less than -9.
 
 For example:
 
 /usr/src/gcc/gcc-cvs-3.3/libiberty>echo 'main(int argc, char* argv[]) { printf("%s\n", cplus_demangle(argv[1], 3)); }' > main.c
 /usr/src/gcc/gcc-cvs-3.3/libiberty>gcc -I../include cplus-dem.c safe-ctype.c xmalloc.c xexit.c xstrdup.c cp-demangle.c dyn-string.c main.c
 /usr/src/gcc/gcc-cvs-3.3/libiberty>a.out X__FGt3Bar1im10i
 X(Bar<-1>, , int)
 
 I corrected cplus-dem.c again to completely reflect my original patch
 after which I get correctly:
 
 /usr/src/gcc/gcc-cvs-3.3/libiberty>a.out X__FGt3Bar1im10i
 X(Bar<-10>, int)
 
 
 The new diff is attached.
 
 Log entry:
 
 
 2003-03-10  Carlo Wood  <carlo@gnu.org>
 
         * cplus-dem.c (demangle_integral_value): Correction to reflect
 	patch of 2002-01-10 in order to also make negative multi-digits
 	without leading underscore work.
 
 -- 
 Carlo Wood <carlo@alinoe.com>
 
 --zhXaljGHf11kAtnf
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="dem3.diff"
 
 Index: cplus-dem.c
 ===================================================================
 RCS file: /cvsroot/gcc/gcc/libiberty/cplus-dem.c,v
 retrieving revision 1.89.4.1
 diff -u -d -p -r1.89.4.1 cplus-dem.c
 --- cplus-dem.c	4 Mar 2003 02:57:48 -0000	1.89.4.1
 +++ cplus-dem.c	11 Mar 2003 02:07:23 -0000
 @@ -1797,31 +1797,34 @@ demangle_integral_value (work, mangled, 
  
        success = 0;
  
 -      /* Negative numbers are indicated with a leading `m'.  */
 -      if (**mangled == 'm')
 -	{
 -	  string_appendn (s, "-", 1);
 -	  (*mangled)++;
 -	}
 -      else if (mangled[0][0] == '_' && mangled[0][1] == 'm')
 -	{
 -	  /* Since consume_count_with_underscores does not handle the
 -	     `m'-prefix we must do it here, using consume_count and
 -	     adjusting underscores: we have to consume the underscore
 -	     matching the prepended one.  */
 -	  multidigit_without_leading_underscore = 1;
 -	  string_appendn (s, "-", 1);
 -	  (*mangled) += 2;
 -	}
 -      else if (**mangled == '_')
 -	{
 -	  /* Do not consume a following underscore;
 -	     multidigit_without_leading_underscore will consume what should be
 -	     consumed.  */
 -	  leave_following_underscore = 1;
 +      if (**mangled == '_')
 +        {
 +	  if (mangled[0][1] == 'm')
 +	    {
 +	      /* Since consume_count_with_underscores does not handle the
 +		 `m'-prefix we must do it here, using consume_count and
 +		 adjusting underscores: we have to consume the underscore
 +		 matching the prepended one.  */
 +	      multidigit_without_leading_underscore = 1;
 +	      string_appendn (s, "-", 1);
 +	      (*mangled) += 2;
 +	    }
 +	  else
 +	    {
 +	      /* Do not consume a following underscore;
 +	         consume_count_with_underscores will consume what
 +	         should be consumed.  */
 +	      leave_following_underscore = 1;
 +	    }
  	}
        else
  	{
 +	  /* Negative numbers are indicated with a leading `m'.  */
 +	  if (**mangled == 'm')
 +	  {
 +	    string_appendn (s, "-", 1);
 +	    (*mangled)++;
 +	  }
  	  /* Since consume_count_with_underscores does not handle
  	     multi-digit numbers that do not start with an underscore,
  	     and this number can be an integer template parameter,
 @@ -1862,7 +1865,7 @@ demangle_integral_value (work, mangled, 
  	  /* All is well.  */
  	  success = 1;
  	}
 -    }
 +      }
  
    return success;
  }
 
 --zhXaljGHf11kAtnf--


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: c++/5390: Libiberty fails to demangle multi-digit template parameters.
@ 2003-03-10 21:06 Wolfgang Bangerth
  0 siblings, 0 replies; 9+ messages in thread
From: Wolfgang Bangerth @ 2003-03-10 21:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/5390; it has been noted by GNATS.

From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: Carlo Wood <carlo@alinoe.com>
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c++/5390: Libiberty fails to demangle multi-digit template
 parameters.
Date: Mon, 10 Mar 2003 15:03:05 -0600 (CST)

 > > - gcc up to 2.95 has never generated the cases that your patch addresses
 > 
 > It does.  That is the whole point: 2.95 generates mangled names that are
 > not supported, while the mangled names produces by older version ARE
 > supported.
 
 OK, thanks for the clarifications. I wasn't aware of this ABI change back 
 then.
 
 
 > > The question thus is: if people are not overly interested in your patch 
 > > (which is regrettable, but apparently the case), then we can as well close 
 > > the PR. Since if we don't, we'll ask the same question again in a year, 
 > > and then people will care even less about 2.95.
 > > 
 > > What's your opinion on this?
 > 
 > The reason I filed the PR was because my library generated a mangled
 > name that made libiberty core.  As a library developer I *have* to
 > support ALL versions of gcc(/libiberty) and was able to think of
 > a workaround (somehow make sure that the template parameter constant
 > where always < 10).  It is never urgent for to have something fixed:
 > I have to work with the current version (2.95.1 and up, all of them)
 > anyway.
 
 I understand these concerns. We build our library by 3 or 4 different 
 compilers and a total of 10 different versions or so :-(
 
 >  So, as far as I am concerned you can close this PR.
 
 Does this still hold given DJ's mail?
 
 
 > (Personally, I'd fix it though if I were you - but I am a perfectionist).
 
 I might if I could. I have no knowledge of gcc, libiberty, etc at all. My 
 place is gnats, beyond that I can only try to get patch creators and 
 reviewers into contact -- usually a fruitless endeavor...
 
 W.
 
 -------------------------------------------------------------------------
 Wolfgang Bangerth             email:            bangerth@ticam.utexas.edu
                               www: http://www.ticam.utexas.edu/~bangerth/
 
 
 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: c++/5390: Libiberty fails to demangle multi-digit template parameters.
@ 2003-03-07 23:16 Carlo Wood
  0 siblings, 0 replies; 9+ messages in thread
From: Carlo Wood @ 2003-03-07 23:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/5390; it has been noted by GNATS.

From: Carlo Wood <carlo@alinoe.com>
To: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
Cc: gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Subject: Re: c++/5390: Libiberty fails to demangle multi-digit template parameters.
Date: Sat, 8 Mar 2003 00:14:43 +0100

 On Fri, Mar 07, 2003 at 10:03:32AM -0600, Wolfgang Bangerth wrote:
 > As time progresses, this is becoming more and more irrelevant: as far 
 > as I understand you,
 > - gcc since 3.0 has a different mangling scheme, which isn't concerned in 
 >   this PR 
 > - gcc up to 2.95 has never generated the cases that your patch addresses
 
 It does.  That is the whole point: 2.95 generates mangled names that are
 not supported, while the mangled names produces by older version ARE
 supported.
 
 > - gcc 2.95 is certainly not going to be fixed to generate them any more
 > - gcc 2.95 is slowly dying out.
 > 
 > The question thus is: if people are not overly interested in your patch 
 > (which is regrettable, but apparently the case), then we can as well close 
 > the PR. Since if we don't, we'll ask the same question again in a year, 
 > and then people will care even less about 2.95.
 > 
 > What's your opinion on this?
 
 The reason I filed the PR was because my library generated a mangled
 name that made libiberty core.  As a library developer I *have* to
 support ALL versions of gcc(/libiberty) and was able to think of
 a workaround (somehow make sure that the template parameter constant
 where always < 10).  It is never urgent for to have something fixed:
 I have to work with the current version (2.95.1 and up, all of them)
 anyway.  So, as far as I am concerned you can close this PR.
 (Personally, I'd fix it though if I were you - but I am a perfectionist).
 
 -- 
 Carlo Wood <carlo@alinoe.com>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: c++/5390: Libiberty fails to demangle multi-digit template parameters.
@ 2003-03-07 17:26 DJ Delorie
  0 siblings, 0 replies; 9+ messages in thread
From: DJ Delorie @ 2003-03-07 17:26 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/5390; it has been noted by GNATS.

From: DJ Delorie <dj@redhat.com>
To: carlo@alinoe.com
Cc: bangerth@dealii.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
   nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Subject: Re: c++/5390: Libiberty fails to demangle multi-digit template parameters.
Date: Fri, 7 Mar 2003 12:18:18 -0500

 Vlad reported a core dump.  Nick fixed it with a small patch.  You
 also wrote a significantly larger patch also claiming to fix it.  You
 were asked if you tested on older gcc's to ensure backward
 compatibility.  You said you didn't.  The issue of backward
 compatibility was never resolved to my satisfaction, so I didn't
 approve it.  I also noted that the demanglers are normally maintained
 by the C++ folks, but apparently you didn't convince them either.
 
 However, if you look in libiberty's ChangeLog, you'll see that your
 patch was eventually applied, over a year ago.  So, I'm not sure what
 you're complaining about.
 
 2002-02-18  Carlo Wood  <carlo@gnu.org>
 
 	PR c++/5390
 	* cplus-dem.c (demangle_integral_value): Accept multi-digit
 	numbers that do not start with an underscore; This is needed
 	for integer template parameters. This doesn't break anything
 	because multi-digit numbers are never followed by a digit.
 	* testsuite/demangle-expected: Corrected all mangled test
 	cases with multi-digit template parameters: g++ 2.95.x does
 	not generate underscores around these parameters.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: c++/5390: Libiberty fails to demangle multi-digit template parameters.
@ 2003-03-07 16:06 Wolfgang Bangerth
  0 siblings, 0 replies; 9+ messages in thread
From: Wolfgang Bangerth @ 2003-03-07 16:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/5390; it has been noted by GNATS.

From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: Carlo Wood <carlo@alinoe.com>
Cc: gcc-bugs@gcc.gnu.org, <gcc-gnats@gcc.gnu.org>
Subject: Re: c++/5390: Libiberty fails to demangle multi-digit template
 parameters.
Date: Fri, 7 Mar 2003 10:03:32 -0600 (CST)

 Carlo,
 first this: When I complained that this PR has been sitting idle despite 
 the fact that it has a patch, I complained to the ones who are in power of 
 reviewing and applying patches. That it has not been reviewed is not your 
 fault. We are grateful for people sending in patches, and I, too, am 
 embarrassed if we turn them down by just not taking notice of their 
 work...
 
 > > State-Changed-From-To: open->feedback
 > > State-Changed-Why:
 > >     Carlo, this report has been sitting idly for a year now.
 > >     What is the present state? Is it still unsolved, or did
 > >     your patch go in?
 > [...]
 > 
 > c++filt of 3.3 does not demangle the correct mangled names (at least the
 > ones I tried) - while it does demangle the old (wrong) mangled names. 
 
 As time progresses, this is becoming more and more irrelevant: as far 
 as I understand you,
 - gcc since 3.0 has a different mangling scheme, which isn't concerned in 
   this PR 
 - gcc up to 2.95 has never generated the cases that your patch addresses
 - gcc 2.95 is certainly not going to be fixed to generate them any more
 - gcc 2.95 is slowly dying out.
 
 The question thus is: if people are not overly interested in your patch 
 (which is regrettable, but apparently the case), then we can as well close 
 the PR. Since if we don't, we'll ask the same question again in a year, 
 and then people will care even less about 2.95.
 
 What's your opinion on this?
 
 Thanks
   Wolfgang
 
 -------------------------------------------------------------------------
 Wolfgang Bangerth             email:            bangerth@ticam.utexas.edu
                               www: http://www.ticam.utexas.edu/~bangerth/
 
 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: c++/5390: Libiberty fails to demangle multi-digit template parameters.
@ 2003-03-07 12:36 Carlo Wood
  0 siblings, 0 replies; 9+ messages in thread
From: Carlo Wood @ 2003-03-07 12:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/5390; it has been noted by GNATS.

From: Carlo Wood <carlo@alinoe.com>
To: bangerth@dealii.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
  nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: c++/5390: Libiberty fails to demangle multi-digit template parameters.
Date: Fri, 7 Mar 2003 13:14:20 +0100

 On Fri, Mar 07, 2003 at 02:26:50AM -0000, bangerth@dealii.org wrote:
 > Synopsis: Libiberty fails to demangle multi-digit template parameters.
 > 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: bangerth
 > State-Changed-When: Fri Mar  7 02:26:50 2003
 > State-Changed-Why:
 >     Carlo, this report has been sitting idly for a year now.
 >     What is the present state? Is it still unsolved, or did
 >     your patch go in?
 >     
 >     Thanks
 >       Wolfgang
 > 
 > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5390
 
 
 I don't have 2.95.4 and don't even know if there is a CVS branch for it.
 
 The file libiberty/testsuite/demangle-expected still exists in version 3.3,
 and contains some broken mangled names (the way 2.95.x doesn't mangle them):
 my patch was not applied to 'libiberty/testsuite/demangle-expected' but it
 seems to have been partly applied, or someone did double work (and a bad job).
 
 c++filt of 3.3 does not demangle the correct mangled names (at least the
 ones I tried) - while it does demangle the old (wrong) mangled names.  By
 looking at libiberty/cplus-dem.c it seems that the patch was at least party
 applied, but someone made changes that broke it, or they ignored failing
 hunks.  As it is, libiberty/cplus-dem.c cannot demangle all the names as
 produced by 2.95.x.
 
 Because in the past my patches have been totally ignored too often, I did put
 this one in the bugs database, so it wouldn't get lost... But later I got so
 much demotivated that I unsubbed from all gcc mailinglists and stopped
 caring about gcc.  Therefore I must say now: I am sorry, but I can't bother
 to put more time into this one and fix it AGAIN - for the current cplus-dem.c.
 Perhaps you manage to manually fix the current cplus-dem.c by looking at
 the old patch and figuring out what was applied and what was not applied.
 Keep in mind that it is not possible, nor interesting to keep backwards
 compatibility with the mangled names as mangled by pre-2.95.x (the ones
 with a '-' in front of it in my testsuite/demangle-expected patch) in
 libiberty/testsuite/demangle-expected: if you do that then you garanteed
 have a broken demangler for the way 2.95.x mangles these names.  My patch
 (for cplus-dem.c) was the best possible fix imho.
 
 -- 
 Carlo Wood <carlo@alinoe.com>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: c++/5390: Libiberty fails to demangle multi-digit template parameters.
@ 2003-03-07  2:26 bangerth
  0 siblings, 0 replies; 9+ messages in thread
From: bangerth @ 2003-03-07  2:26 UTC (permalink / raw)
  To: carlo, gcc-bugs, gcc-prs, nobody

Synopsis: Libiberty fails to demangle multi-digit template parameters.

State-Changed-From-To: open->feedback
State-Changed-By: bangerth
State-Changed-When: Fri Mar  7 02:26:50 2003
State-Changed-Why:
    Carlo, this report has been sitting idly for a year now.
    What is the present state? Is it still unsolved, or did
    your patch go in?
    
    Thanks
      Wolfgang

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5390


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-03-11 20:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-11 20:06 c++/5390: Libiberty fails to demangle multi-digit template parameters Wolfgang Bangerth
  -- strict thread matches above, loose matches on Subject: below --
2003-03-11 20:06 DJ Delorie
2003-03-11  2:26 Carlo Wood
2003-03-10 21:06 Wolfgang Bangerth
2003-03-07 23:16 Carlo Wood
2003-03-07 17:26 DJ Delorie
2003-03-07 16:06 Wolfgang Bangerth
2003-03-07 12:36 Carlo Wood
2003-03-07  2:26 bangerth

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).