Commit 95c755e9 by Jan Hubicka Committed by Jan Hubicka

cgraph.c (create_edge): Use local.redefined_extern_inline.


	* cgraph.c (create_edge): Use local.redefined_extern_inline.
	* cgraph.h (cgraph_local_info): Sort fields by size; add
	redefined_extern_inline
	(cgraph_global_info): Sort fields by size.
	(cgraph_node): Likewise.
	* cgraphunit.c (cgraph_finalize_function): Se
	local.redefined_extern_inline on redefinition.
	(cgraph_analyze_function): Use it; fix formating.

From-SVN: r75890
parent 092b50e2
2004-01-14 Jan Hubicka <jh@suse.cz> 2004-01-14 Jan Hubicka <jh@suse.cz>
* cgraph.c (create_edge): Use local.redefined_extern_inline.
* cgraph.h (cgraph_local_info): Sort fields by size; add
redefined_extern_inline
(cgraph_global_info): Sort fields by size.
(cgraph_node): Likewise.
* cgraphunit.c (cgraph_finalize_function): Se
local.redefined_extern_inline on redefinition.
(cgraph_analyze_function): Use it; fix formating.
2004-01-14 Jan Hubicka <jh@suse.cz>
PR c++/10776 PR c++/10776
* sched-deps.c (trye_dependency_cache, anti_dependency_cache, * sched-deps.c (trye_dependency_cache, anti_dependency_cache,
outptu_dependency_cache, forward_dependency_cahe): Trun to vectors of outptu_dependency_cache, forward_dependency_cahe): Trun to vectors of
......
...@@ -159,6 +159,9 @@ create_edge (struct cgraph_node *caller, struct cgraph_node *callee) ...@@ -159,6 +159,9 @@ create_edge (struct cgraph_node *caller, struct cgraph_node *callee)
if (!DECL_SAVED_TREE (callee->decl)) if (!DECL_SAVED_TREE (callee->decl))
edge->inline_failed = N_("function body not available"); edge->inline_failed = N_("function body not available");
else if (callee->local.redefined_extern_inline)
edge->inline_failed = N_("redefined extern inline functions are not "
"considered for inlining");
else if (callee->local.inlinable) else if (callee->local.inlinable)
edge->inline_failed = N_("function not considered for inlining"); edge->inline_failed = N_("function not considered for inlining");
else else
......
...@@ -27,6 +27,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -27,6 +27,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
struct cgraph_local_info GTY(()) struct cgraph_local_info GTY(())
{ {
/* Size of the function before inlining. */
int self_insns;
/* Set when function function is visible in current compilation unit only /* Set when function function is visible in current compilation unit only
and it's address is never taken. */ and it's address is never taken. */
bool local; bool local;
...@@ -37,8 +40,9 @@ struct cgraph_local_info GTY(()) ...@@ -37,8 +40,9 @@ struct cgraph_local_info GTY(())
bool inlinable; bool inlinable;
/* True when function should be inlined independently on it's size. */ /* True when function should be inlined independently on it's size. */
bool disregard_inline_limits; bool disregard_inline_limits;
/* Size of the function before inlining. */ /* True when the function has been originally extern inline, but it is
int self_insns; redefined now. */
bool redefined_extern_inline;
}; };
/* Information about the function that needs to be computed globally /* Information about the function that needs to be computed globally
...@@ -46,15 +50,15 @@ struct cgraph_local_info GTY(()) ...@@ -46,15 +50,15 @@ struct cgraph_local_info GTY(())
struct cgraph_global_info GTY(()) struct cgraph_global_info GTY(())
{ {
/* Set when the function will be inlined exactly once. */
bool inline_once;
/* Estimated size of the function after inlining. */ /* Estimated size of the function after inlining. */
int insns; int insns;
/* Number of times given function will be cloned during output. */ /* Number of times given function will be cloned during output. */
int cloned_times; int cloned_times;
/* Set when the function will be inlined exactly once. */
bool inline_once;
/* Set to true for all reachable functions before inlining is decided. /* Set to true for all reachable functions before inlining is decided.
Once we inline all calls to the function and the function is local, Once we inline all calls to the function and the function is local,
it is set to false. */ it is set to false. */
...@@ -93,10 +97,13 @@ struct cgraph_node GTY((chain_next ("%h.next"), chain_prev ("%h.previous"))) ...@@ -93,10 +97,13 @@ struct cgraph_node GTY((chain_next ("%h.next"), chain_prev ("%h.previous")))
struct cgraph_node *next_nested; struct cgraph_node *next_nested;
/* Pointer to the next function in cgraph_nodes_queue. */ /* Pointer to the next function in cgraph_nodes_queue. */
struct cgraph_node *next_needed; struct cgraph_node *next_needed;
/* Unique id of the node. */
int uid;
PTR GTY ((skip (""))) aux; PTR GTY ((skip (""))) aux;
struct cgraph_local_info local;
struct cgraph_global_info global;
struct cgraph_rtl_info rtl;
/* Unique id of the node. */
int uid;
/* Set when function must be output - it is externally visible /* Set when function must be output - it is externally visible
or it's address is taken. */ or it's address is taken. */
bool needed; bool needed;
...@@ -108,9 +115,6 @@ struct cgraph_node GTY((chain_next ("%h.next"), chain_prev ("%h.previous"))) ...@@ -108,9 +115,6 @@ struct cgraph_node GTY((chain_next ("%h.next"), chain_prev ("%h.previous")))
bool analyzed; bool analyzed;
/* Set when function is scheduled to be assembled. */ /* Set when function is scheduled to be assembled. */
bool output; bool output;
struct cgraph_local_info local;
struct cgraph_global_info global;
struct cgraph_rtl_info rtl;
}; };
struct cgraph_edge GTY(()) struct cgraph_edge GTY(())
......
...@@ -184,6 +184,7 @@ cgraph_finalize_function (tree decl, bool nested) ...@@ -184,6 +184,7 @@ cgraph_finalize_function (tree decl, bool nested)
memset (&node->global, 0, sizeof (node->global)); memset (&node->global, 0, sizeof (node->global));
memset (&node->rtl, 0, sizeof (node->rtl)); memset (&node->rtl, 0, sizeof (node->rtl));
node->analyzed = false; node->analyzed = false;
node->local.redefined_extern_inline = true;
while (node->callees) while (node->callees)
cgraph_remove_edge (node, node->callees->callee); cgraph_remove_edge (node, node->callees->callee);
...@@ -330,8 +331,15 @@ cgraph_analyze_function (struct cgraph_node *node) ...@@ -330,8 +331,15 @@ cgraph_analyze_function (struct cgraph_node *node)
= (*lang_hooks.tree_inlining.disregard_inline_limits) (decl); = (*lang_hooks.tree_inlining.disregard_inline_limits) (decl);
for (e = node->callers; e; e = e->next_caller) for (e = node->callers; e; e = e->next_caller)
if (e->inline_failed) if (e->inline_failed)
e->inline_failed = (!node->local.inlinable ? N_("function not inlinable") {
: N_("function not considered for inlining")); if (node->local.redefined_extern_inline)
e->inline_failed = N_("redefined extern inline functions are not "
"considered for inlining");
else if (!node->local.inlinable)
e->inline_failed = N_("function not inlinable");
else
e->inline_failed = N_("function not considered for inlining");
}
if (flag_really_no_inline && !node->local.disregard_inline_limits) if (flag_really_no_inline && !node->local.disregard_inline_limits)
node->local.inlinable = 0; node->local.inlinable = 0;
/* Inlining characteristics are maintained by the cgraph_mark_inline. */ /* Inlining characteristics are maintained by the cgraph_mark_inline. */
......
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