c++/9143: 64BIT: Error in dump class hiearchy file generated for basic inheritance
lei@ca.ibm.com
lei@ca.ibm.com
Thu Jan 2 19:46:00 GMT 2003
>Number: 9143
>Category: c++
>Synopsis: 64BIT: Error in dump class hiearchy file generated for basic inheritance
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Jan 02 11:46:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator: Lei Huang
>Release: 3.2.0
>Organization:
>Environment:
Linux Version 2.4.19 SuSE SLES 8 (ppc) - Kernel 2.4.19-ul1-ppc64-SMP (36).
GNU assembler version 2.12.90.0.15 (powerpc-suse-linux) using BFD version 2.12.90.0.15 20020717 (SuSE)
>Description:
Error in dump class hiearchy file generated for basic inheritance in 64bit
compile.
Options given when GCC was configured/built:
Configured with: /usr/src/packages/BUILD/cross-ppc64-gcc-3.2/gcc-3.2/configure --enable-languages=c,c++,f77 --prefix=/opt/cross --host=powerpc-suse-linux --target=powerpc64-linux --enable-threads=posix --disable-nls --enable-shared --with-headers=/usr/src/packages/BUILD/cross-ppc64-gcc-3.2/include-ppc64-glibc-2.2.5
Thread model: posix
gcc version 3.2
Sourc code for a.cpp:
------------------------------------------------
struct A {
int a;
virtual void f(){};
} ;
struct B: virtual A {};
B d;
------------------------------------------------
Actual class hierarchy file (a.cpp.class):
------------------------------------------------
Vtable for A
A::_ZTV1A: 3 entries
0 0
8 &_ZTI1A
16 A::f()
Class A
size=16 align=8
A (0x40066100) 0
vptr=((&A::_ZTV1A) + 16)
Vtable for B
B::_ZTV1B: 7 entries
0 8
8 0
16 &_ZTI1B
24 0
32 000000000 //ERR: expect this to be a none-zero offset
40 &_ZTI1B
48 A::f()
VTT for B
B::_ZTT1B: 2 entries
0 ((&B::_ZTV1B) + 24)
8 ((&B::_ZTV1B) + 48)
Class B
size=24 align=8
B (0x40066680) 0 nearly-empty
vptridx=0 vptr=((&B::_ZTV1B) + 24)
A (0x400666c0) 8 virtual canonical
vptridx=8 vbaseoffset=-24 vptr=((&B::_ZTV1B) + 48)
-----------------------------------------------------------
Expected Behaviour:
- see comment in dump file above
a.ii generated with -save-temps option
------------------------------------------------
# 1 "a.cpp"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "a.cpp"
struct A {
int a;
virtual void f(){};
} ;
struct B: virtual A {};
B d;
------------------------------------------------
>How-To-Repeat:
1. g++ -fdump-class-hierarchy -c a.cpp
2. cat a.cpp.class
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-bugs
mailing list