public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/8963: [3.2/3.3 regression] [ABI] The same template instance is mangled with 2 different names
@ 2002-12-25  1:12 lerdsuwa
  0 siblings, 0 replies; 3+ messages in thread
From: lerdsuwa @ 2002-12-25  1:12 UTC (permalink / raw)
  To: catherin, gcc-bugs, gcc-prs, nobody

Synopsis: [3.2/3.3 regression] [ABI] The same template instance is mangled with 2 different names

State-Changed-From-To: analyzed->closed
State-Changed-By: lerdsuwa
State-Changed-When: Wed Dec 25 01:12:39 2002
State-Changed-Why:
    The code is ill-formed according to 14.5.5.1 p7,8.  A compiler is not required to be able to figure out that 
    thing<(signed char)(thirty)> is equivalent to 
    thing<(unsigned char)(thirty)>

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


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

* Re: c++/8963: [3.2/3.3 regression] [ABI] The same template instance is mangled with 2 different names
@ 2002-12-31  0:18 lerdsuwa
  0 siblings, 0 replies; 3+ messages in thread
From: lerdsuwa @ 2002-12-31  0:18 UTC (permalink / raw)
  To: catherin, gcc-bugs, gcc-prs, nobody

Synopsis: [3.2/3.3 regression] [ABI] The same template instance is mangled with 2 different names

State-Changed-From-To: closed->analyzed
State-Changed-By: lerdsuwa
State-Changed-When: Tue Dec 31 00:18:40 2002
State-Changed-Why:
    I am not quite sure with this PR.  So I change this back to analyzed state for now.

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


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

* Re: c++/8963: [3.2/3.3 regression] [ABI] The same template instance is mangled with 2 different names
@ 2002-12-16 11:48 bangerth
  0 siblings, 0 replies; 3+ messages in thread
From: bangerth @ 2002-12-16 11:48 UTC (permalink / raw)
  To: catherin, gcc-bugs, gcc-prs, nobody

Old Synopsis: The same template instance is mangled with 2 different names
New Synopsis: [3.2/3.3 regression] [ABI] The same template instance is mangled with 2 different names

State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Mon Dec 16 11:48:12 2002
State-Changed-Why:
    Confirmed. In essence, this happens: we have
    ----------------------------
    template <int> struct thing;
    
    template <int J, int K>
    void stuff (thing<(unsigned char)(30)> *);
    
    int main() {
      stuff<7,8> (0);
    }
    --------------------------
    Compile and run nm on it:
    tmp/g> /home/bangerth/bin/gcc-3.3-pre/bin/c++ -c x.cc
    tmp/g> nm x.o | /home/bangerth/bin/gcc-3.2/bin/c++filt
             U void stuff<(int)7, (int)8>(thing<operator unsigned char((int)30)>*)
    
    Note that the conversion operator (unsigned char)(30)
    is coded into the mangled name, which I believe it
    should not be since the type of the template argument
    is fixed (it is integer).
    
    This does not happen if we make the function a non-template:
    ------------------
    template <int> struct thing;
    
    void stuff (thing<(unsigned char)(30)> *);
    
    int main() {
      stuff (0);
    }
    --------------tmp/g> /home/bangerth/bin/gcc-3.3-pre/bin/c++ -c x.cc
    tmp/g> nm x.o | /home/bangerth/bin/gcc-3.2/bin/c++filt
             U stuff(thing<(int)30>*)
    
    I don't have enough knowledge of the ABI standard to say
    what is right and what is wrong, but I would think this
    is a bug. Also, -fabi-version does not change anything.
    
    gcc 2.95 can't compile the code at all, generating invalid
    assembler logic. However, similar cases compile without
    mangling the conversion operator, so I would rate this as
    a regression, if it is considered a bug, which is why I
    increase the priority. This way, someone with enough
    knowledge will look at it eventually ;-)

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


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

end of thread, other threads:[~2002-12-31  8:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-25  1:12 c++/8963: [3.2/3.3 regression] [ABI] The same template instance is mangled with 2 different names lerdsuwa
  -- strict thread matches above, loose matches on Subject: below --
2002-12-31  0:18 lerdsuwa
2002-12-16 11:48 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).