]> gcc.gnu.org Git - gcc.git/commitdiff
tree.c (save_tree_status): Revert 10 Sep change.
authorRichard Henderson <rth@cygnus.com>
Sun, 12 Sep 1999 06:30:39 +0000 (23:30 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Sun, 12 Sep 1999 06:30:39 +0000 (23:30 -0700)
        * tree.c (save_tree_status): Revert 10 Sep change.
        (restore_tree_status): Likewise.  Call obstack_free with NULL
        before freeing the obstack proper.

From-SVN: r29355

gcc/ChangeLog
gcc/tree.c

index c050d119ff9632b129fada803e26ed8674604b88..da73161fe1b9a844e00437e4a9b1c287e7558a13 100644 (file)
@@ -1,3 +1,9 @@
+Sat Sep 11 23:28:33 1999  Richard Henderson  <rth@cygnus.com>
+
+       * tree.c (save_tree_status): Revert 10 Sep change.
+       (restore_tree_status): Likewise.  Call obstack_free with NULL 
+       before freeing the obstack proper.
+
 Sat Sep 11 23:23:46 1999  Richard Henderson  <rth@cygnus.com>
 
        * cse.c (cse_main): If gc'ing, collect around cse_basic_block.
index b9da51bd5a583db452a0a2c134951fcacf84b96a..ca471a92bc681478eb0c9cd671e1a3483dfd2faf 100644 (file)
@@ -365,7 +365,8 @@ save_tree_status (p)
   function_maybepermanent_obstack
     = (struct obstack *) xmalloc (sizeof (struct obstack));
   gcc_obstack_init (function_maybepermanent_obstack);
-  maybepermanent_firstobj = NULL;
+  maybepermanent_firstobj
+    = (char *) obstack_finish (function_maybepermanent_obstack);
 
   function_obstack = (struct obstack *) xmalloc (sizeof (struct obstack));
   gcc_obstack_init (function_obstack);
@@ -394,14 +395,16 @@ restore_tree_status (p)
   /* Free saveable storage used by the function just compiled and not
      saved.  */
   obstack_free (function_maybepermanent_obstack, maybepermanent_firstobj);
+  if (obstack_empty_p (function_maybepermanent_obstack))
+    {
+      obstack_free (function_maybepermanent_obstack, NULL);
+      free (function_maybepermanent_obstack);
+    }
 
   obstack_free (&temporary_obstack, temporary_firstobj);
   obstack_free (&momentary_obstack, momentary_function_firstobj);
 
   obstack_free (function_obstack, NULL);
-
-  if (maybepermanent_firstobj == NULL)
-    free (function_maybepermanent_obstack);
   free (function_obstack);
 
   temporary_firstobj = p->temporary_firstobj;
This page took 0.078147 seconds and 5 git commands to generate.