Commit bd85fcee by Jan Hubicka Committed by Jan Hubicka

cgraphunit.c (record_cdtor_fn): Declare all cdtors always inlined.


	* cgraphunit.c (record_cdtor_fn): Declare all cdtors always inlined.
	(cgraph_process_new_functions): Honor previous value of
	disregard_inline_limits.
	* ipa-inline.c (compute_inline_parameters): Likewise.

From-SVN: r127365
parent 2b840e50
2007-08-11 Jan Hubicka <jh@suse.cz>
* cgraphunit.c (record_cdtor_fn): Declare all cdtors always inlined.
(cgraph_process_new_functions): Honor previous value of
disregard_inline_limits.
* ipa-inline.c (compute_inline_parameters): Likewise.
2007-08-11 Ian Lance Taylor <iant@google.com> 2007-08-11 Ian Lance Taylor <iant@google.com>
* alias.h (alias_set_type): Define new type. * alias.h (alias_set_type): Define new type.
......
...@@ -180,21 +180,26 @@ static GTY (()) tree static_dtors; ...@@ -180,21 +180,26 @@ static GTY (()) tree static_dtors;
static void static void
record_cdtor_fn (tree fndecl) record_cdtor_fn (tree fndecl)
{ {
if (targetm.have_ctors_dtors) struct cgraph_node *node;
if (targetm.have_ctors_dtors
|| (!DECL_STATIC_CONSTRUCTOR (fndecl)
&& !DECL_STATIC_DESTRUCTOR (fndecl)))
return; return;
if (DECL_STATIC_CONSTRUCTOR (fndecl)) if (DECL_STATIC_CONSTRUCTOR (fndecl))
{ {
static_ctors = tree_cons (NULL_TREE, fndecl, static_ctors); static_ctors = tree_cons (NULL_TREE, fndecl, static_ctors);
DECL_STATIC_CONSTRUCTOR (fndecl) = 0; DECL_STATIC_CONSTRUCTOR (fndecl) = 0;
cgraph_mark_reachable_node (cgraph_node (fndecl));
} }
if (DECL_STATIC_DESTRUCTOR (fndecl)) if (DECL_STATIC_DESTRUCTOR (fndecl))
{ {
static_dtors = tree_cons (NULL_TREE, fndecl, static_dtors); static_dtors = tree_cons (NULL_TREE, fndecl, static_dtors);
DECL_STATIC_DESTRUCTOR (fndecl) = 0; DECL_STATIC_DESTRUCTOR (fndecl) = 0;
cgraph_mark_reachable_node (cgraph_node (fndecl));
} }
DECL_INLINE (fndecl) = 1;
node = cgraph_node (fndecl);
node->local.disregard_inline_limits = 1;
cgraph_mark_reachable_node (node);
} }
/* Synthesize a function which calls all the global ctors or global /* Synthesize a function which calls all the global ctors or global
...@@ -376,7 +381,7 @@ cgraph_process_new_functions (void) ...@@ -376,7 +381,7 @@ cgraph_process_new_functions (void)
node->local.self_insns = estimate_num_insns (fndecl, node->local.self_insns = estimate_num_insns (fndecl,
&eni_inlining_weights); &eni_inlining_weights);
node->local.disregard_inline_limits node->local.disregard_inline_limits
= lang_hooks.tree_inlining.disregard_inline_limits (fndecl); |= lang_hooks.tree_inlining.disregard_inline_limits (fndecl);
/* Inlining characteristics are maintained by the /* Inlining characteristics are maintained by the
cgraph_mark_inline. */ cgraph_mark_inline. */
node->global.insns = node->local.self_insns; node->global.insns = node->local.self_insns;
......
...@@ -1527,7 +1527,7 @@ compute_inline_parameters (void) ...@@ -1527,7 +1527,7 @@ compute_inline_parameters (void)
node->local.inlinable = tree_inlinable_function_p (current_function_decl); node->local.inlinable = tree_inlinable_function_p (current_function_decl);
node->local.self_insns = estimate_num_insns (current_function_decl, node->local.self_insns = estimate_num_insns (current_function_decl,
&eni_inlining_weights); &eni_inlining_weights);
if (node->local.inlinable) if (node->local.inlinable && !node->local.disregard_inline_limits)
node->local.disregard_inline_limits node->local.disregard_inline_limits
= lang_hooks.tree_inlining.disregard_inline_limits (current_function_decl); = lang_hooks.tree_inlining.disregard_inline_limits (current_function_decl);
if (flag_really_no_inline && !node->local.disregard_inline_limits) if (flag_really_no_inline && !node->local.disregard_inline_limits)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment