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]
Other format: [Raw text]

Re: C++ ABI testing issues, gcc-3.3 <-> gcc-3.2 compatibility


On Mon, Aug 05, 2002 at 09:00:29AM +0200, Andreas Jaeger wrote:
> "Goodman, Joe" <joe.goodman@intel.com> writes:
> 
> > We provide a C++ ABI test suite you can download from
> > http://developer.intel.com/software/products/opensource/.  Please feel free
> > to download and run this suite.
> 
> Thanks for reminding us.  I did test it some weeks ago and decided to
> look again add it - and noticed that I configured it wrong the last
> time and was not executing the tests (config.mk disables them by
> default on non-ia64 platforms :-( ).
> 
> Here're the results on i686-linux-gnu from GCC 3.2 branch as of
> 2002-08-04:
> 
> ./bitfield1
> Test 1 Failure: bitfield1.cpp:59

This looks like real problem (if we care about oversized bitfields).
struct A { char a; int b : 224; char c; } x;
g++ now pads field b as if it were long long b : 224, ie.
the fields + its padding has size 32 bytes, offsetof(A, c) == 36
and sizeof(A) == 40.
I've tried g++ 2.96-RH and it gave the expected result, ie.
offsetof(A, c) == 32, sizeof(A) == 36.

> ./dynamic1
> Test 9 Failure: dynamic1.cpp:79

This looks to me like a bug in the testcase:
struct S { int i; };
struct T1 { virtual void f () {} };
struct U3 : public T1, public S { long long l; };
Here offsetof(U3, l) is 8, ie. vptr and i comes before
the long long, yet the testcase requires this to be
sizeof (void *) + sizeof (long long). Why?
On IA-64 where sizeof (void *) == sizeof (long long) this makes no
difference, but on 32-bit arches it does.

> ./virtual3
> Test 4 Failure: virtual3.cpp:65

This again looks like a testcase bug to me:
struct R { int i; };
struct Q { double d; };
struct U2 : virtual public R, public Q { long long l; };
Here offsetof (U2, d) is 4 instead of 8 expected by the testcase,
which is because on IA-32
__alignof__ (Q) != __alignof__ (double).
IMHO the test should use Q type, not double directly.

> ./virtual9
> Test 9 Failure: virtual9.cpp:92

Similarly, this looks like result of
struct Q { long long l; };
__alignof__ (Q) != __alignof__ (long long).

> ./vtable1
> Test 3 Failure: vtable1.cpp:70
> ./vtable2
> Test 3 Failure: vtable2.cpp:102

I don't get these 2. I was using binutils 2.12.90.0.15 if it matters.

> And the known failure for new (we have size_t == int on
> i686-linux-gnu):
> 
>   missing: _Znwm
>   missing: _Znam
> make: *** [operator1.pass] Error 1

Yes, IMHO a bug in the testsuite.

Now I don't claim I must be 100% right in this, so somebody please check
it all again.

And it looks like we very badly need something like this in our testsuite.
IMHO it would be enough to put various kinds of inherited
classes, bitfields etc. into consistency.vlad, and generate output for a few
important platforms...

	Jakub


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