aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2005-10-31 22:07:29 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2005-10-31 21:07:29 +0000
commitd63f0fe58ad1702b1efbf8bafa83266755c889aa (patch)
tree1e17724d87d080db88e0016e2e0095626d4d8cfd /gcc
parentd8ff1871ed565ca7213f577ebff1618e5ae872c3 (diff)
downloadgcc-d63f0fe58ad1702b1efbf8bafa83266755c889aa.zip
gcc-d63f0fe58ad1702b1efbf8bafa83266755c889aa.tar.gz
gcc-d63f0fe58ad1702b1efbf8bafa83266755c889aa.tar.bz2
re PR middle-end/24093 (cgraph exhausts virtual memory building 197.parser with -profile-use -O3)
PR middle-end/24093 * cgraph.c (cgraph_clone_edge, cgraph_clone_node): Watch negative From-SVN: r106291
Diffstat (limited to 'gcc')
-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 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,