From: Jan Hubicka Date: Mon, 31 Oct 2005 21:07:29 +0000 (+0100) Subject: re PR middle-end/24093 (cgraph exhausts virtual memory building 197.parser with ... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d63f0fe58ad1702b1efbf8bafa83266755c889aa;p=gcc.git 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 --- 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 + 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,