------- Comment #13 from davidxl at gcc dot gnu dot org 2010-02-03 22:05 ------- (In reply to comment #12) > Btw, a destructor call also changes the vtbl pointer. >
ctors, dtors, wrapper function calls etc are all handled. Detailed write up will be available at some point. To put it a simple way, it is done via live across analyis: if an poly object is referenced before and after a call (accesses to any field of it) both available and anticipated from a a call -- it is live across the call -- vptr field won't be modified by the call. Partially anticipated case is also handled. Once vptr is handled, vtbl access follows automatically -- at vtbls are RO. vptr assignment is treated conservatively. I implemented this thing in 4.4 line using special shadow symbols and VUSE/VDEFS. It works as expected except that SCCVN time went to hell. Simple fix to collapse varying defs in DFS walk help a lot but still slow. Need to do this using alias oracle. David -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35560