summaryrefslogtreecommitdiff
path: root/gcc/cgraph.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-10-09 15:21:54 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-10-09 15:21:54 +0000
commit27e0321aadb8c2c656af795612836cf896f0557d (patch)
tree7624fc2d71c047c04fe2c3c927b645f19760fdee /gcc/cgraph.c
parentcf4848768d6fbbbaec367eb8107504f1803091e2 (diff)
downloadgcc-27e0321aadb8c2c656af795612836cf896f0557d.tar.gz
2009-10-09 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 152583 after the LTO merge inside trunk. [during merge with trunk 152583 the version information from GCC is used, not the checksum of the executable!] * gcc/melt-runtime.h (melt_gccversionstr): added extern declaration. * gcc/melt-runtime.c: Moved the #include before everything else. Updated comment NOTE about gengtype - which is now compatible with the trunk's. (melt_gccversionstr): added declaration. (load_checked_dynamic_module_index): use a gcc version string in modules, not a checksum of the executable. (melt_really_initialize): get a second argument for the gcc version string. Initialize melt_gccversionstr with it. (plugin_init): Build the gccversionstr out of gcc_version structure. (melt_initialize): calls melt_really_initialize with version_string. (melt_output_cfile_decl_impl): generates a genversionstr_melt instead of a genchecksum_melt. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@152591 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r--gcc/cgraph.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 15dd60a7ee4..01fbb9a85d7 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -802,7 +802,7 @@ initialize_inline_failed (struct cgraph_edge *e)
e->inline_failed = CIF_REDEFINED_EXTERN_INLINE;
else if (!callee->local.inlinable)
e->inline_failed = CIF_FUNCTION_NOT_INLINABLE;
- else if (gimple_call_cannot_inline_p (e->call_stmt))
+ else if (e->call_stmt && gimple_call_cannot_inline_p (e->call_stmt))
e->inline_failed = CIF_MISMATCHED_ARGUMENTS;
else
e->inline_failed = CIF_FUNCTION_NOT_CONSIDERED;
@@ -816,13 +816,19 @@ cgraph_create_edge (struct cgraph_node *caller, struct cgraph_node *callee,
{
struct cgraph_edge *edge;
+
+ /* LTO does not actually have access to the call_stmt since these
+ have not been loaded yet. */
+ if (call_stmt)
+ {
#ifdef ENABLE_CHECKING
/* This is rather pricely check possibly trigerring construction of call stmt
hashtable. */
gcc_assert (!cgraph_edge (caller, call_stmt));
#endif
- gcc_assert (is_gimple_call (call_stmt));
+ gcc_assert (is_gimple_call (call_stmt));
+ }
if (free_edges)
{
@@ -860,7 +866,9 @@ cgraph_create_edge (struct cgraph_node *caller, struct cgraph_node *callee,
gcc_assert (freq <= CGRAPH_FREQ_MAX);
edge->loop_nest = nest;
edge->indirect_call = 0;
- if (caller->call_site_hash)
+ edge->call_stmt_cannot_inline_p =
+ (call_stmt ? gimple_call_cannot_inline_p (call_stmt) : false);
+ if (call_stmt && caller->call_site_hash)
{
void **slot;
slot = htab_find_slot_with_hash (caller->call_site_hash,
@@ -1351,6 +1359,7 @@ void
cgraph_mark_needed_node (struct cgraph_node *node)
{
node->needed = 1;
+ gcc_assert (!node->global.inlined_to);
cgraph_mark_reachable_node (node);
}
@@ -1624,8 +1633,8 @@ cgraph_function_possibly_inlined_p (tree decl)
/* Create clone of E in the node N represented by CALL_EXPR the callgraph. */
struct cgraph_edge *
cgraph_clone_edge (struct cgraph_edge *e, struct cgraph_node *n,
- gimple call_stmt, gcov_type count_scale, int freq_scale,
- int loop_nest, bool update_original)
+ gimple call_stmt, unsigned stmt_uid, gcov_type count_scale,
+ int freq_scale, int loop_nest, bool update_original)
{
struct cgraph_edge *new_edge;
gcov_type count = e->count * count_scale / REG_BR_PROB_BASE;
@@ -1638,6 +1647,7 @@ cgraph_clone_edge (struct cgraph_edge *e, struct cgraph_node *n,
new_edge->inline_failed = e->inline_failed;
new_edge->indirect_call = e->indirect_call;
+ new_edge->lto_stmt_uid = stmt_uid;
if (update_original)
{
e->count -= new_edge->count;
@@ -1673,6 +1683,7 @@ cgraph_clone_node (struct cgraph_node *n, gcov_type count, int freq,
}
new_node->analyzed = n->analyzed;
new_node->local = n->local;
+ new_node->local.externally_visible = false;
new_node->global = n->global;
new_node->rtl = n->rtl;
new_node->count = count;
@@ -1702,8 +1713,8 @@ cgraph_clone_node (struct cgraph_node *n, gcov_type count, int freq,
for (e = n->callees;e; e=e->next_callee)
- cgraph_clone_edge (e, new_node, e->call_stmt, count_scale, freq, loop_nest,
- update_original);
+ cgraph_clone_edge (e, new_node, e->call_stmt, e->lto_stmt_uid,
+ count_scale, freq, loop_nest, update_original);
new_node->next_sibling_clone = n->clones;
if (n->clones)
@@ -1972,7 +1983,8 @@ cgraph_add_new_function (tree fndecl, bool lowered)
bool
cgraph_node_can_be_local_p (struct cgraph_node *node)
{
- return !node->needed;
+ return (!node->needed
+ && (DECL_COMDAT (node->decl) || !node->local.externally_visible));
}
/* Bring NODE local. */