From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29720 invoked by alias); 8 Nov 2011 12:56:12 -0000 Received: (qmail 29708 invoked by uid 22791); 8 Nov 2011 12:56:11 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 08 Nov 2011 12:55:58 +0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/51012] [4.7 Regression] ICE: in fold_convert_loc, at fold-const.c:1897 with -fno-early-inlining and passing incompatible function ptr Date: Tue, 08 Nov 2011 13:07: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: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.7.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: 2011-11/txt/msg00771.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51012 Richard Guenther changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hubicka at gcc dot gnu.org, | |jamborm at gcc dot gnu.org --- Comment #2 from Richard Guenther 2011-11-08 12:55:53 UTC --- With -fno-ipa-cp it is indirect inlining that performs the bogus inline. Fixed (for non-WPA only?) by Index: gcc/ipa-prop.c =================================================================== --- gcc/ipa-prop.c (revision 181154) +++ gcc/ipa-prop.c (working copy) @@ -1905,6 +1905,13 @@ update_indirect_edges_after_inlining (st if (new_direct_edge) { new_direct_edge->indirect_inlining_edge = 1; + if (new_direct_edge->call_stmt + && !gimple_check_call_matching_types (new_direct_edge->call_stmt, + new_direct_edge->callee->decl)) + { + gimple_call_set_cannot_inline (new_direct_edge->call_stmt, true); + new_direct_edge->call_stmt_cannot_inline_p = true; + } if (new_edges) { VEC_safe_push (cgraph_edge_p, heap, *new_edges, With -fipa-cp not disabled we still ICE, but we can fixup in cgraph_make_edge_direct (how many copies of such code remain?) Index: gcc/cgraph.c =================================================================== --- gcc/cgraph.c (revision 181154) +++ gcc/cgraph.c (working copy) @@ -1184,6 +1184,13 @@ cgraph_make_edge_direct (struct cgraph_e /* Insert to callers list of the new callee. */ cgraph_set_edge_callee (edge, callee); + if (edge->call_stmt + && !gimple_check_call_matching_types (edge->call_stmt, callee->decl)) + { + gimple_call_set_cannot_inline (edge->call_stmt, true); + edge->call_stmt_cannot_inline_p = true; + } + /* We need to re-determine the inlining status of the edge. */ initialize_inline_failed (edge); } What about WPA stage? I think we don't "fixup" inlinable status of edges at the beginning of ltrans (or inline transform). Do we?