aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2009-05-10 13:36:11 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2009-05-10 11:36:11 +0000
commit4b685e144da6c5a196714ba7ef2fdae1fdf140e2 (patch)
tree91f699aef787d7d4ddaf57b0ac4ea331b8a1dd61 /gcc/tree-inline.c
parent51e61d333a020e331fdd9a690815045a3600ab62 (diff)
downloadgcc-4b685e144da6c5a196714ba7ef2fdae1fdf140e2.zip
gcc-4b685e144da6c5a196714ba7ef2fdae1fdf140e2.tar.gz
gcc-4b685e144da6c5a196714ba7ef2fdae1fdf140e2.tar.bz2
re PR middle-end/40084 (Revision 147294 failed 483.xalancbmk in SPEC CPU 2006 at -O3)
PR middle-end/40084 * cgraph.c (cgraph_update_edges_for_call_stmt_node): Take old_call argument; rewrite. (cgraph_update_edges_for_call_stmt): Take old_decl argument. * cgraph.h (cgraph_update_edges_for_call_stmt): Update prototype. * tree-inline.c (copy_bb): Set frequency correctly. (fold_marked_statements): Update call of cgraph_update_edges_for_call_stmt. From-SVN: r147337
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 0a383768..403b5a0 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -1522,7 +1522,8 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale,
gcc_assert (dest->needed || !dest->analyzed);
if (id->transform_call_graph_edges == CB_CGE_MOVE_CLONES)
cgraph_create_edge_including_clones (id->dst_node, dest, stmt,
- bb->count, CGRAPH_FREQ_BASE,
+ bb->count,
+ compute_call_stmt_bb_frequency (id->dst_node->decl, bb),
bb->loop_depth,
CIF_ORIGINALLY_INDIRECT_CALL);
else
@@ -3542,6 +3543,7 @@ fold_marked_statements (int first, struct pointer_set_t *statements)
if (pointer_set_contains (statements, gsi_stmt (gsi)))
{
gimple old_stmt = gsi_stmt (gsi);
+ tree old_decl = is_gimple_call (old_stmt) ? gimple_call_fndecl (old_stmt) : 0;
if (fold_stmt (&gsi))
{
@@ -3550,8 +3552,9 @@ fold_marked_statements (int first, struct pointer_set_t *statements)
gimple new_stmt = gsi_stmt (gsi);
update_stmt (new_stmt);
- if (is_gimple_call (old_stmt))
- cgraph_update_edges_for_call_stmt (old_stmt, new_stmt);
+ if (is_gimple_call (old_stmt)
+ || is_gimple_call (new_stmt))
+ cgraph_update_edges_for_call_stmt (old_stmt, old_decl, new_stmt);
if (maybe_clean_or_replace_eh_stmt (old_stmt, new_stmt))
gimple_purge_dead_eh_edges (BASIC_BLOCK (first));