This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/77493] [6/7 Regression] -fcrossjumping (-O2) on ppc64le causes segfaults (jump to 0x0) (first bad r230091)
- From: "david.abdurachmanov at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 06 Sep 2016 22:30:27 +0000
- Subject: [Bug target/77493] [6/7 Regression] -fcrossjumping (-O2) on ppc64le causes segfaults (jump to 0x0) (first bad r230091)
- Auto-submitted: auto-generated
- References: <bug-77493-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77493
--- Comment #10 from David Abdurachmanov <david.abdurachmanov at gmail dot com> ---
We have been bitten by DSE with TBB already on GCC 6.2.0.
I decided to try -fno-lifetime-dse on the first bad commit and got some
surprising results. Now it fails with:
pure virtual method called
terminate called without an active exception
In this case we have a standard library container with 7 elements,
std::shared_ptr<TrackingRecHit>, where TrackingRecHit is abstract class, which
has:
virtual int dimension() const = 0;
If I dump the actual type: typeid(*(x.get())).name() the actual object is of
MuonTransientTrackingRecHit type.
Then the code does std::stable_sort on the collection and now in some cases
MuonTransientTrackingRecHit changes to TrackingRecHit (abstract class). Thus we
are really calling pure virtual method.
This does not happen on x86_64.
I guess, this could be caused by actual MuonTransientTrackingRecHit being
destroyed if the last std::shared_ptr point to it goes away.
DUMP_BEFORE: std::shared_ptr<TrackingRecHit const>
DUMP_BEFORE_TYPE: MuonTransientTrackingRecHit
DUMP_BEFORE: std::shared_ptr<TrackingRecHit const>
DUMP_BEFORE_TYPE: MuonTransientTrackingRecHit
DUMP_BEFORE: std::shared_ptr<TrackingRecHit const>
DUMP_BEFORE_TYPE: MuonTransientTrackingRecHit
DUMP_BEFORE: std::shared_ptr<TrackingRecHit const>
DUMP_BEFORE_TYPE: MuonTransientTrackingRecHit
DUMP_BEFORE: std::shared_ptr<TrackingRecHit const>
DUMP_BEFORE_TYPE: MuonTransientTrackingRecHit
DUMP_BEFORE: std::shared_ptr<TrackingRecHit const>
DUMP_BEFORE_TYPE: MuonTransientTrackingRecHit
DUMP_BEFORE: std::shared_ptr<TrackingRecHit const>
DUMP_BEFORE_TYPE: MuonTransientTrackingRecHit
// after std::stable_sort
DUMP: std::shared_ptr<TrackingRecHit const>
DUMP_TYPE: MuonTransientTrackingRecHit
DUMP: std::shared_ptr<TrackingRecHit const>
DUMP_TYPE: MuonTransientTrackingRecHit
DUMP: std::shared_ptr<TrackingRecHit const>
DUMP_TYPE: TrackingRecHit
DUMP: std::shared_ptr<TrackingRecHit const>
DUMP_TYPE: TrackingRecHit
DUMP: std::shared_ptr<TrackingRecHit const>
DUMP_TYPE: MuonTransientTrackingRecHit
DUMP: std::shared_ptr<TrackingRecHit const>
DUMP_TYPE: TrackingRecHit
DUMP: std::shared_ptr<TrackingRecHit const>
DUMP_TYPE: TrackingRecHit
SIZE: 7