From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14623 invoked by alias); 22 May 2009 14:46:43 -0000 Received: (qmail 13903 invoked by uid 48); 22 May 2009 14:46:29 -0000 Date: Fri, 22 May 2009 14:46:00 -0000 Subject: [Bug middle-end/40223] New: cgraph_estimate_size_after_inlining missmatch X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "sergei_lus at yahoo dot com" 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: 2009-05/txt/msg01868.txt.bz2 It is not so much a bug report, but probably a note: In ipa-inline.c function cgraph_estimate_size_after_inlining has the following loop: for (arg = DECL_ARGUMENTS (fndecl); arg; arg = TREE_CHAIN (arg)) call_insns += estimate_move_cost (TREE_TYPE (arg)); Should it actually be something like this: for (arg = DECL_ARGUMENTS (fndecl); arg; arg = TREE_CHAIN (arg)) if (!VOID_TYPE_P (TREE_TYPE (arg))) call_insns += estimate_move_cost (TREE_TYPE (arg)); fndecl usually has VOID as last tree chain member, and that adds 4 points to cost that it is probably not intending. See tree-inline.c on trunk (147575)estimate_num_insns: /* Our cost must be kept in sync with cgraph_estimate_size_after_inlining that does use function declaration to figure out the arguments. */ if (decl && DECL_ARGUMENTS (decl)) { tree arg; for (arg = DECL_ARGUMENTS (decl); arg; arg = TREE_CHAIN (arg)) if (!VOID_TYPE_P (TREE_TYPE (arg))) cost += estimate_move_cost (TREE_TYPE (arg)); } ... My code did trigger gcc_assert (size >= 0); in cgraph_estimate_size_after_inlining which I believe might be related to the above described. -- Summary: cgraph_estimate_size_after_inlining missmatch Product: gcc Version: 4.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: sergei_lus at yahoo dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40223