From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8664 invoked by alias); 27 Nov 2012 15:34:31 -0000 Received: (qmail 4279 invoked by uid 48); 27 Nov 2012 15:34:07 -0000 From: "aldyh at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/55264] [4.6/4.7/4.8 Regression] ICE: in ipa_make_edge_direct_to_target, at ipa-prop.c:2141 with -O2 -fno-early-inlining -fno-weak Date: Tue, 27 Nov 2012 15:34: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-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: aldyh at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: aldyh at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.0 X-Bugzilla-Changed-Fields: CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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: 2012-11/txt/msg02539.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55264 Aldy Hernandez changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org, | |jason at gcc dot gnu.org --- Comment #3 from Aldy Hernandez 2012-11-27 15:34:06 UTC --- When compiled with -fno-weak, we re-use the out-of-line copy in clone_inlined_nodes(), around here: /* We may eliminate the need for out-of-line copy to be output. In that case just go ahead and re-use it. This is not just an memory optimization. Making offline copy of fuction disappear from the program will improve future decisions on inlining. */ This happens because the conditional can_remove_node_now_p_1() returns true for virtuals that are not weak: /* Inlining might enable more devirtualizing, so we want to remove those only after all devirtualizable virtual calls are processed. Lacking may edges in callgraph we just preserve them post inlining. */ && (!DECL_VIRTUAL_P (node->symbol.decl) || (!DECL_COMDAT (node->symbol.decl) && !DECL_EXTERNAL (node->symbol.decl))) When we re-use the out-of-line copy in clone_inlined_nodes(), we end up setting inlined_to here: e->callee->global.inlined_to = e->caller; This causes the ICE in ipa_make_edge_direct_to_target, because inlined_to is non-NULL: /* We can not make edges to inline clones. It is bug that someone removed the cgraph node too early. */ gcc_assert (!callee->global.inlined_to); Any tips on how to proceed from here?