diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cgraph.c | 12 |
2 files changed, 13 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7f69964..17a48a2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,8 @@ 2005-10-31 Jan Hubicka <jh@suse.cz> + PR middle-end/24093 + * cgraph.c (cgraph_clone_edge, cgraph_clone_node): Watch negative + PR target/20928 * i386.c (legitimize_pic_address): Deal with large immediates. diff --git a/gcc/cgraph.c b/gcc/cgraph.c index 32fbe30..33eb1fe 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -895,7 +895,11 @@ cgraph_clone_edge (struct cgraph_edge *e, struct cgraph_node *n, new->inline_failed = e->inline_failed; if (update_original) - e->count -= new->count; + { + e->count -= new->count; + if (e->count < 0) + e->count = 0; + } return new; } @@ -931,7 +935,11 @@ cgraph_clone_node (struct cgraph_node *n, gcov_type count, int loop_nest, else count_scale = 0; if (update_original) - n->count -= count; + { + n->count -= count; + if (n->count < 0) + n->count = 0; + } for (e = n->callees;e; e=e->next_callee) cgraph_clone_edge (e, new, e->call_stmt, count_scale, loop_nest, |