This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Known problems with -fvtable-thunks in egcs-1.1.1?



The following code fails to execute properly unless -fno-vtable-thunks
is used with egcs-1.1.1 on linux.  Is this a known problem?  And/or
fixed in the egcs_1_1_branch?

-------------------------------------------------------------------------------
Lee Iverson     		SRI International
leei@ai.sri.com			333 Ravenswood Ave., Menlo Park CA 94025
http://www.ai.sri.com/~leei/	(650) 859-3307

-- Forwarded Message --
From: rick@aai.com
Received: (from rick@localhost)
	by garcia.aai.com (8.9.1/8.9.1) id BAA21846;
	Fri, 5 Feb 1999 01:33:22 -0500 (EST)
Date: Fri, 5 Feb 1999 01:33:22 -0500 (EST)
Message-id: <199902050633.BAA21846@garcia.aai.com>
To: hoffman@albirio.crd.ge.com, hough@amerinex1.aai.com,
        leei@Sunset.AI.SRI.COM, rick@amerinex1.aai.com,
        trees@amerinex1.aai.com
Subject: EGCS error example

Bill,

  Here is a small example of the problem.  Interestingly the problem appears
only with EGCS 1.1.1 on Linux.  I tried EGCS 1.1.1 and GCC 2.7.2 on linux and
EGCS 1.0, 1.1.1, and GCC 2.7.2 on Solaris.

Rick

#include <iostream.h>

class super
{
public:
  virtual void doit() =0;
};

class top : virtual public super
{
public:
  virtual void doit();
};

class mid : public top
{
public:
  mid();
};

class leaf : public mid
{
public:
  leaf();
  int i;
};



void top::doit()
{
  cout << "top::doit " << this << endl;
}

mid::mid()
{
  cout << "mid " << this << endl;
  top::doit();
  top* hackptr = this;
  hackptr->doit();	// <<<<<******** incorrectly adjusts "this" by size of leaf
}

leaf::leaf()
{
  cout << "leaf " << this << endl;
}

int main ()
{
  leaf* l = new leaf();
  return 0;
}




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]