From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23842 invoked by alias); 3 Feb 2010 22:06:04 -0000 Received: (qmail 23806 invoked by uid 48); 3 Feb 2010 22:05:52 -0000 Date: Wed, 03 Feb 2010 22:06:00 -0000 Message-ID: <20100203220552.23805.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/35560] Missing CSE/PRE for memory operations involved in virtual call. In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "davidxl at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-02/txt/msg00241.txt.bz2 ------- 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