public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13118] New: Missed covariant return thunk
@ 2003-11-19  8:37 grigory at stl dot sarov dot ru
  2003-11-19 14:33 ` [Bug c++/13118] [ABI] " bangerth at dealii dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: grigory at stl dot sarov dot ru @ 2003-11-19  8:37 UTC (permalink / raw)
  To: gcc-bugs

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


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

end of thread, other threads:[~2003-12-12 18:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-19  8:37 [Bug c++/13118] New: Missed covariant return thunk grigory at stl dot sarov dot ru
2003-11-19 14:33 ` [Bug c++/13118] [ABI] " bangerth at dealii dot org
2003-11-19 16:32 ` pinskia at gcc dot gnu dot org
2003-11-21  9:16 ` nathan at gcc dot gnu dot org
2003-11-21  9:33 ` nathan at gcc dot gnu dot org
2003-11-21 14:29 ` pinskia at gcc dot gnu dot org
2003-11-22 14:46 ` grigory at stl dot sarov dot ru
2003-12-12 14:54 ` nathan at gcc dot gnu dot org
2003-12-12 18:22 ` cvs-commit at gcc dot gnu dot org
2003-12-12 18:43 ` nathan at gcc dot gnu dot org

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