public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/3631: another linking problem with virtual derivation
@ 2001-07-17  7:38 nathan
  0 siblings, 0 replies; 3+ messages in thread
From: nathan @ 2001-07-17  7:38 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nathan, nobody, snyder

Synopsis: another linking problem with virtual derivation

Responsible-Changed-From-To: unassigned->nathan
Responsible-Changed-By: nathan
Responsible-Changed-When: Tue Jul 17 07:38:57 2001
Responsible-Changed-Why:
    mine
State-Changed-From-To: open->analyzed
State-Changed-By: nathan
State-Changed-When: Tue Jul 17 07:38:57 2001
State-Changed-Why:
    bad compiler

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=3631&database=gcc


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

* Re: c++/3631: another linking problem with virtual derivation
@ 2001-07-31  1:59 nathan
  0 siblings, 0 replies; 3+ messages in thread
From: nathan @ 2001-07-31  1:59 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nathan, snyder

Synopsis: another linking problem with virtual derivation

State-Changed-From-To: analyzed->closed
State-Changed-By: nathan
State-Changed-When: Tue Jul 31 01:59:34 2001
State-Changed-Why:
    Fixed for 3.0.1
    2001-07-31  Nathan Sidwell  <nathan@codesourcery.com>
    
    	PR c++/3631
    	* class.c (update_vtable_entry_for_fn): The fixed adjustment
    	of a virtual thunk should be from declaring base.
    
    2001-07-31  Nathan Sidwell  <nathan@codesourcery.com>
    
    	* g++.dg/abi/vthunk1.C: New test.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=3631&database=gcc


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

* c++/3631: another linking problem with virtual derivation
@ 2001-07-09 20:26 snyder
  0 siblings, 0 replies; 3+ messages in thread
From: snyder @ 2001-07-09 20:26 UTC (permalink / raw)
  To: gcc-gnats

>Number:         3631
>Category:       c++
>Synopsis:       another linking problem with virtual derivation
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Mon Jul 09 20:26:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     scott snyder
>Release:        3.0.1 20010703 (prerelease)
>Organization:
>Environment:
System: Linux karma 2.4.2-2 #1 Sun Apr 8 20:41:30 EDT 2001 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../egcs/configure --prefix=/usr/local/egcs --enable-threads=posix --enable-long-long
>Description:

I get an link error compiling the problem, about an undefined virtual
thunk:

$ c++ -o x x.cc
/tmp/ccB0aFEJ.o(.gnu.linkonce.d._ZTC1K12_1J+0xa0): undefined reference to `virtual thunk to G::destroy()'
collect2: ld returned 1 exit status

Here are the symbols containing destroy that we generate in this object:

$ nm -Bo x.o | grep destroy
x.o:00000000 W _ZN1B7destroyEv
x.o:00000000 W _ZN1G7destroyEv
x.o:00000000 W _ZTv0_n20_N1G7destroyEv
x.o:         U _ZTvn8_n20_N1G7destroyEv


This is some sort of name mangling problem?

I think this is the same problem as reported in
http://gcc.gnu.org/ml/gcc-patches/2001-06/msg01636.html

The problem goes away if i revert Jason's last change to class.c
on the 3.0 branch:

2001-06-18  Jason Merrill  <jason_merrill@redhat.com>

	* class.c (dfs_accumulate_vtbl_inits): Just point to the base we're
	sharing a ctor vtable with.  Merge code for cases 1 and 2.
	(binfo_ctor_vtable): New fn.
	(build_vtt_inits, dfs_build_secondary_vptr_vtt_inits): Use it.



>How-To-Repeat:

------------------------------------------------------------
struct A { virtual ~A () {} };

struct B : virtual public A
{
  virtual void destroy() {}
};

class C : virtual public B {};
class D : virtual public C {};
class E : public virtual A {};

struct F : virtual public B, virtual public E
{
  virtual void destroy() = 0;
};

struct G : public virtual F
{
  virtual void destroy() {}
};

class H : virtual public C, virtual public F {};
class I : virtual public D, virtual public H {};
class J : public virtual G, public virtual H {};

class K : public virtual I, public virtual J
{
public:
  virtual ~K();
};
K::~K() {}



int main ()
{
  return 0;
}
------------------------------------------------------------


>Fix:
	
>Release-Note:
>Audit-Trail:
>Unformatted:


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

end of thread, other threads:[~2001-07-31  1:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-17  7:38 c++/3631: another linking problem with virtual derivation nathan
  -- strict thread matches above, loose matches on Subject: below --
2001-07-31  1:59 nathan
2001-07-09 20:26 snyder

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