From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27131 invoked by alias); 20 Apr 2014 07:10:12 -0000 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 Received: (qmail 27084 invoked by uid 48); 20 Apr 2014 07:10:07 -0000 From: "xinliangli at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/60899] undef reference generated with -fdevirtualize-speculatively Date: Sun, 20 Apr 2014 07:10:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 4.10.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: xinliangli at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: hubicka at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-04/txt/msg01376.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60899 --- Comment #4 from davidxl --- (In reply to davidxl from comment #3) > (In reply to Jan Hubicka from comment #2) > > David, > > it seems a_m.C should be different form a.C. From chain of events you > > describe I think > > we need to figure out why the last folding happens. Does the function pass > > can_refer_decl_in_current_unit_p and if so, how does cgraph node look at > > that time? > > > > Honza > > Cut & paste error: > > // a_m.cc > > #include "a.h" > struct D2: public DI { > virtual int doit () { return 3; } > }; > > extern int bar(DI*); > int main() > { > D2 d2; > return bar(&d2); > } stepping into can_refer_decl_in_current_unit_p indicates it returns true (for A::foo and A::vtable) at the condition @line 106.