This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/45699] [4.6 Regression] Incorrect copy constructor generated with -O
- From: "jamborm at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 8 Oct 2010 16:51:25 +0000
- Subject: [Bug middle-end/45699] [4.6 Regression] Incorrect copy constructor generated with -O
- Auto-submitted: auto-generated
- References: <bug-45699-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45699
--- Comment #10 from Martin Jambor <jamborm at gcc dot gnu.org> 2010-10-08 16:51:19 UTC ---
I think I know what is going on. BINFO_VIRTUALS of the BINFO
describing Probability_Model within Parameters pint to a wring thunk
of the method Parameters:clone().
Therefore when the call is devirtualized, the this parameter is not
adjusted to point to the whole Ptr object and points only to the part
representing the Probability_Model ancestor. And so all references to
the fields of the object just load garbage.