]> gcc.gnu.org Git - gcc.git/commitdiff
re PR middle-end/24093 (cgraph exhausts virtual memory building 197.parser with ... r278977.309/tags/gomp-merge-20051031
authorJan Hubicka <jh@suse.cz>
Mon, 31 Oct 2005 21:07:29 +0000 (22:07 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Mon, 31 Oct 2005 21:07:29 +0000 (21:07 +0000)
PR middle-end/24093
* cgraph.c (cgraph_clone_edge, cgraph_clone_node): Watch negative

From-SVN: r106291

gcc/ChangeLog
gcc/cgraph.c

index 7f69964ea4c39c7eb286825db2accde28b6bc175..17a48a278a5027a685cd1dc4b9dde31d18856316 100644 (file)
@@ -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.
 
index 32fbe3097391878eb90dd88f9a0c5e3dff92914d..33eb1fe7d2f3f6d7e1dddd3a0d5f5d05c192921b 100644 (file)
@@ -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,
This page took 0.076937 seconds and 5 git commands to generate.