🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #47

Bug Report 1

#47
From: Mike Tiller
Date: Wed, 04 Nov 1992 10:09
60 lines
1972 bytes
This is a bug report for the gcc-2.3.1 C++ compiler.

Platform:   sparc-sun-sunos4.1

Summary:    The routine that builds unique names for derived classes
            allows '<' and '>' characters to get into assembly files.
            This only happens (as far as I know) when you are using
            templates.  I found a way of correcting this, but it is a
            real hack and I'm afriad it might generate non-unique names.

Here is the problem in the assembly files:

    call ___main,0
    nop
    sethi %hi(__vt$AB<int>$A.3),%o1      <-- Bad
    or %o1,%lo(__vt$AB<int>$A.3),%o0     <-- Ditto
    st %o0,[%fp-20]
    sethi %hi(__vt$t2AB1Zi.2),%o1        <-- But it works here (?)
    or %o1,%lo(__vt$t2AB1Zi.2),%o0       <-- Ditto
    st %o0,[%fp-24]
    mov 0,%i0

It seems like a slight correction might fix it, I would really like
any advice (or patches) on what might be the problem here.  I already have
a hack to cp-search.c which will kinda fix the problem, but I don't trust
it at all (it just substitutes _ for < or > if they appear).

Here is the offending code, took me a long time to trim this down:

class	A
{
	public:
		virtual	void	Foo() = 0;
};

class	B
{
	public:
		virtual	void	Bar() = 0;
};

template<class T>
class	AB : public B , public A
{
	public:
		void	Foo() { };
		void	Bar() { };
};

int
main()
{
	AB<int>		a;
}


Thanks
(tiller@solace.me.uiuc.edu)

P.S. - Great compiler!
Technical Details
Message-ID: <9211042209.AA13749@solace.me.uiuc.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!iggy.GW.Vitalink.COM!cs.widener.edu!umn.edu!spool.mu.edu!uwm.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!solace.me.uiuc.edu!tiller

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!iggy.GW.Vitalink.COM!cs.widener.edu!umn.edu!spool.mu.edu!uwm.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!solace.me.uiuc.edu!tiller
From: tiller@solace.me.uiuc.edu (Mike Tiller)
Subject: Bug Report 1
Message-ID: <9211042209.AA13749@solace.me.uiuc.edu>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Wed, 4 Nov 1992 10:09:54 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 61