This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PR debug/13367
- From: Jan Hubicka <jh at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org, rth at redhat dot com
- Date: Mon, 29 Dec 2003 14:28:45 +0100
- Subject: PR debug/13367
Hi,
the problem is caused by fact that we inline even tought we are not supposed to
inline at all in non-optimizing compilation. Fixed and I've also added few work
limiting checks.
Diego: this patch will completely conflict in next tree-ssa merge. I will prepare
tree-ssa version now, so you can safely skip the changes.
Honza
typedef union tree_node *tree;
typedef struct c_pretty_print_info c_pretty_printer;
void pp_c_string_literal (c_pretty_printer *, tree);
static __inline__ __attribute__((always_inline)) void
pp_c_shift_expression (c_pretty_printer *pp, tree e)
{
pp_c_shift_expression (pp,e);
}
static void
pp_c_relational_expression (c_pretty_printer *pp, tree e)
{
pp_c_shift_expression (pp, e);
}
PR debug/13367
* cgraphunit.c (cgraph_finalize_function): Decide inlining only when
!flag_really_no_inline.
(cgraph_analyze_function): Do not compute inlining parameters when not
inlining.
(cgraph_optimize): Likewise.
(cgraph_optimize_function): Do not inlinine when there is nothing
to inline.
Index: cgraphunit.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cgraphunit.c,v
retrieving revision 1.39
diff -c -3 -p -r1.39 cgraphunit.c
*** cgraphunit.c 21 Nov 2003 06:52:22 -0000 1.39
--- cgraphunit.c 29 Dec 2003 10:37:30 -0000
*************** cgraph_finalize_function (tree decl, boo
*** 209,215 ****
if (!flag_unit_at_a_time)
{
cgraph_analyze_function (node);
! cgraph_decide_inlining_incrementally (node);
}
if (decide_is_function_needed (node, decl))
--- 209,216 ----
if (!flag_unit_at_a_time)
{
cgraph_analyze_function (node);
! if (!flag_really_no_inline)
! cgraph_decide_inlining_incrementally (node);
}
if (decide_is_function_needed (node, decl))
*************** cgraph_analyze_function (struct cgraph_n
*** 317,337 ****
/* First kill forward declaration so reverse inlining works properly. */
cgraph_create_edges (decl, DECL_SAVED_TREE (decl));
! node->local.inlinable = tree_inlinable_function_p (decl);
! if (!DECL_ESTIMATED_INSNS (decl))
! DECL_ESTIMATED_INSNS (decl)
! = (*lang_hooks.tree_inlining.estimate_num_insns) (decl);
! node->local.self_insns = DECL_ESTIMATED_INSNS (decl);
! if (node->local.inlinable)
! node->local.disregard_inline_limits
! = (*lang_hooks.tree_inlining.disregard_inline_limits) (decl);
!
! /* Inlining characteristics are maintained by the cgraph_mark_inline. */
! node->global.insns = node->local.self_insns;
! if (!DECL_EXTERNAL (decl))
{
! node->global.cloned_times = 1;
! node->global.will_be_output = true;
}
node->analyzed = true;
--- 318,343 ----
/* First kill forward declaration so reverse inlining works properly. */
cgraph_create_edges (decl, DECL_SAVED_TREE (decl));
! if (flag_really_no_inline)
! node->local.inlinable = false;
! else
{
! node->local.inlinable = tree_inlinable_function_p (decl);
! if (!DECL_ESTIMATED_INSNS (decl))
! DECL_ESTIMATED_INSNS (decl)
! = (*lang_hooks.tree_inlining.estimate_num_insns) (decl);
! node->local.self_insns = DECL_ESTIMATED_INSNS (decl);
! if (node->local.inlinable)
! node->local.disregard_inline_limits
! = (*lang_hooks.tree_inlining.disregard_inline_limits) (decl);
!
! /* Inlining characteristics are maintained by the cgraph_mark_inline. */
! node->global.insns = node->local.self_insns;
! if (!DECL_EXTERNAL (decl))
! {
! node->global.cloned_times = 1;
! node->global.will_be_output = true;
! }
}
node->analyzed = true;
*************** cgraph_optimize_function (struct cgraph_
*** 470,477 ****
timevar_push (TV_INTEGRATION);
/* optimize_inline_calls avoids inlining of current_function_decl. */
current_function_decl = decl;
! if (flag_inline_trees)
! optimize_inline_calls (decl);
if (node->nested)
{
for (node = node->nested; node; node = node->next_nested)
--- 476,492 ----
timevar_push (TV_INTEGRATION);
/* optimize_inline_calls avoids inlining of current_function_decl. */
current_function_decl = decl;
! if (flag_inline_trees && !flag_really_no_inline)
! {
! struct cgraph_edge *e;
!
! /* Short circuit when there is nothing to inline. */
! for (e = node->callees; e; e = e->next_callee)
! if (e->inline_call)
! break;
! if (e)
! optimize_inline_calls (decl);
! }
if (node->nested)
{
for (node = node->nested; node; node = node->next_nested)
*************** cgraph_optimize (void)
*** 1366,1372 ****
dump_cgraph (cgraph_dump_file);
}
! cgraph_decide_inlining ();
cgraph_global_info_ready = true;
if (cgraph_dump_file)
{
--- 1381,1388 ----
dump_cgraph (cgraph_dump_file);
}
! if (!flag_really_no_inline)
! cgraph_decide_inlining ();
cgraph_global_info_ready = true;
if (cgraph_dump_file)
{