From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11664 invoked by alias); 14 Dec 2012 10:43:02 -0000 Received: (qmail 11565 invoked by uid 48); 14 Dec 2012 10:42:41 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/55683] [4.8 Regression] ICE in inline_call, at ipa-inline-transform.c:270 Date: Fri, 14 Dec 2012 10:43: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: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.0 X-Bugzilla-Changed-Fields: 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-12/txt/msg01416.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55683 --- Comment #5 from Richard Biener 2012-12-14 10:42:39 UTC --- Happens once in the unreduced testcase. The following will maybe give us testcases with even more off values (off-by-1 happens quite often): Index: gcc/ipa-inline-transform.c =================================================================== --- gcc/ipa-inline-transform.c (revision 194496) +++ gcc/ipa-inline-transform.c (working copy) @@ -211,11 +211,6 @@ inline_call (struct cgraph_edge *e, bool struct cgraph_node *callee = cgraph_function_or_thunk_node (e->callee, NULL); bool new_edges_found = false; -#ifdef ENABLE_CHECKING - int estimated_growth = estimate_edge_growth (e); - bool predicated = inline_edge_summary (e)->predicate != NULL; -#endif - /* Don't inline inlined edges. */ gcc_assert (e->inline_failed); /* Don't even think of inlining inline clone. */ @@ -263,11 +258,22 @@ inline_call (struct cgraph_edge *e, bool #ifdef ENABLE_CHECKING /* Verify that estimated growth match real growth. Allow off-by-one error due to INLINE_SIZE_SCALE roudoff errors. */ - gcc_assert (!update_overall_summary || !overall_size - || abs (estimated_growth - (new_size - old_size)) <= 1 - /* FIXME: a hack. Edges with false predicate are accounted - wrong, we should remove them from callgraph. */ - || predicated); + if (update_overall_summary && overall_size) + { + int estimated_growth = estimate_edge_growth (e); + bool predicated = inline_edge_summary (e)->predicate != NULL; + + if (dump_file && (dump_flags & TDF_DETAILS) + && (estimated_growth - (new_size - old_size)) != 0) + { + /* FIXME: Edges with false predicate are accounted + wrong, we should remove them from callgraph. */ + fprintf (dump_file, " Estimated growth is off by %d%s", + estimated_growth - (new_size - old_size), + predicated ? " (predicated)\n" : "\n"); + } + gcc_assert (abs (estimated_growth - (new_size - old_size)) <= 2); + } #endif /* Account the change of overall unit size; external functions will be