aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhubicka <>2005-10-31 21:07:29 +0000
committerhubicka <>2005-10-31 21:07:29 +0000
commita86d72dd5f327f50b340ae3d0439d60a2b5193b9 (patch)
tree1e17724d87d080db88e0016e2e0095626d4d8cfd
parent4a8ee263da650096e9d0015e8b8fb7985a3cb330 (diff)
PR middle-end/24093gomp-merge-20051031
* cgraph.c (cgraph_clone_edge, cgraph_clone_node): Watch negative
-rw-r--r--gcc/ChangeLog3
-rw-r--r--gcc/cgraph.c12
2 files changed, 13 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7f69964ea4c..17a48a278a5 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 32fbe309739..33eb1fe7d2f 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,