aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-inline.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2012-10-28 13:00:32 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2012-10-28 12:00:32 +0000
commitbf3f651054fdf0fdd672ffe344b0886e74f20098 (patch)
treebb44264423c65bd2e325dd7398d14e341c3b013a /gcc/ipa-inline.c
parent5d517141037264e94ae503a0f883f074aad2b8fb (diff)
downloadgcc-bf3f651054fdf0fdd672ffe344b0886e74f20098.zip
gcc-bf3f651054fdf0fdd672ffe344b0886e74f20098.tar.gz
gcc-bf3f651054fdf0fdd672ffe344b0886e74f20098.tar.bz2
inlinehint-3.c: New testcase.
* gcc.dg/ipa/inlinehint-3.c: New testcase. * ipa-inline.c (edge_badness): Fix overflow. (inline_small_functions): Initialize SCCs correctly. (do_estimate_edge_time, do_estimate_edge_hints): Skip self recursive functions in SCC hints. From-SVN: r192891
Diffstat (limited to 'gcc/ipa-inline.c')
-rw-r--r--gcc/ipa-inline.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index 39e450d..6d5b252 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -861,9 +861,9 @@ edge_badness (struct cgraph_edge *edge, bool dump)
We might mix the valud into the fraction by taking into account
relative growth of the unit, but for now just add the number
into resulting fraction. */
- if (badness > INT_MAX / 4)
+ if (badness > INT_MAX / 8)
{
- badness = INT_MAX / 4;
+ badness = INT_MAX / 8;
if (dump)
fprintf (dump_file, "Badness overflow\n");
}
@@ -1360,8 +1360,19 @@ inline_small_functions (void)
if (!DECL_EXTERNAL (node->symbol.decl))
initial_size += info->size;
- info->scc_no = (dfs && dfs->next_cycle && dfs->next_cycle != node
- ? dfs->scc_no + 1 : 0);
+ if (dfs && dfs->next_cycle)
+ {
+ struct cgraph_node *n2;
+ int id = dfs->scc_no + 1;
+ for (n2 = node; n2;
+ n2 = ((struct ipa_dfs_info *) node->symbol.aux)->next_cycle)
+ {
+ struct inline_summary *info2 = inline_summary (n2);
+ if (info2->scc_no)
+ break;
+ info2->scc_no = id;
+ }
+ }
}
for (edge = node->callers; edge; edge = edge->next_caller)