From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26216 invoked by alias); 6 Dec 2013 15:27:00 -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 26179 invoked by uid 48); 6 Dec 2013 15:26:56 -0000 From: "hubicka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/58477] [4.9 Regression] ice in cgraph_speculative_call_info Date: Fri, 06 Dec 2013 15:27:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hubicka at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: hubicka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.9.0 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: 2013-12/txt/msg00510.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58477 --- Comment #5 from Jan Hubicka --- I am testing Index: ../gcc/cgraphclones.c =================================================================== --- ../gcc/cgraphclones.c (revision 205737) +++ ../gcc/cgraphclones.c (working copy) @@ -123,7 +123,10 @@ cgraph_clone_edge (struct cgraph_edge *e { tree decl; - if (call_stmt && (decl = gimple_call_fndecl (call_stmt))) + if (call_stmt && (decl = gimple_call_fndecl (call_stmt)) + /* When the call is speculative, we need to resolve it + via cgraph_resolve_speculation and not here. */ + && !e->speculative) { struct cgraph_node *callee = cgraph_get_node (decl); gcc_checking_assert (callee); The problem is that cgraph_clone_edge is too eager to turn the edge into a direct edge because inliner managed to do the same resolution. This fixes the ICE but we however ought to do this optimization at IPA level.