This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13118] New: Missed covariant return thunk
- From: "grigory at stl dot sarov dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Nov 2003 08:37:39 -0000
- Subject: [Bug c++/13118] New: Missed covariant return thunk
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
For routine f6 of class c28 in the hirarchy listed below it is expected 5
covariant thunks to be emitted.
covariant return thunk [nv:0] [v:0,-12] to c28::f6()
covariant return thunk [nv:0] [v:0,-16] to c28::f6()
covariant return thunk [v:0,-16] [v:0,-16] to c28::f6()
covariant return thunk [v:0,-24] [v:0,-12] to c28::f6()
covariant return thunk [v:0,-24] [v:0,-16] to c28::f6()
However G++ 3.4 compiler misses (does not generate) the last thunk from the
list. This seems to be a C++ ABI failure.
$ cat test.cpp
struct c0 {};
struct c1 : virtual c0 {
virtual class ::c0* f6() {};
};
struct c5 {
virtual void foo(){};
};
struct c10 : virtual c1 {
virtual void foo(){};
};
struct c11 : virtual c10, c1 {
int i;
virtual c1* f6() {}
};
struct c18 : c5, virtual c1 {
virtual void bar(){};
};
struct c28 : virtual c0, virtual c11 {
virtual c18* f6() {};
} obj;
$ g++ -c test.cpp
$ nm test.o | grep "_ZTc.*c282f6"
00000006 W _ZTch0_v0_n12_N3c282f6Ev
00000036 W _ZTch0_v0_n16_N3c282f6Ev
00000056 W _ZTcv0_n16_v0_n16_N3c282f6Ev
00000026 W _ZTcv0_n24_v0_n12_N3c282f6Ev
There is no expected thunk "_ZTcv0_n24_v0_n12_N3c282f6Ev" generated.
--
Summary: Missed covariant return thunk
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: grigory at stl dot sarov dot ru
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-redhat-linux
GCC host triplet: i686-redhat-linux
GCC target triplet: i686-redhat-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13118