]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Index: ChangeLog
authorGeoffrey Keating <geoffk@redhat.com>
Sun, 4 Aug 2002 22:45:31 +0000 (22:45 +0000)
committerGeoffrey Keating <geoffk@gcc.gnu.org>
Sun, 4 Aug 2002 22:45:31 +0000 (22:45 +0000)
2002-08-04  Geoffrey Keating  <geoffk@redhat.com>

* Makefile.in (sdbout.o): Doesn't need $(OBSTACK_H).
* collect2.h (permanent_obstack): Delete declaration.
* collect2.c (permanent_obstack): Delete definition.
(main): Don't initialise permanent_obstack.  Use xstrdup instead.
* expr.c: Don't include obstack.h.
(permanent_obstack): Delete declaration.
* function.c: Don't include obstack.h.
(permanent_obstack): Delete declaration.
* integrate.c: Don't include obstack.h.
(function_maybepermanent_obstack): Delete declaration.
* print-tree.c (debug_tree): Use x*alloc not permalloc.
* sdbout.c (gen_fake_label): Use x*alloc not permalloc.
* tlink.c (pfgets): Use xstrdup not permanent_obstack.
* toplev.c (lang_independent_init): Rename init_obstacks to init_ttree.
* tree.h: Rename init_obstacks to init_ttree.  Remove declarations
of permalloc, expralloc, perm_calloc.
* tree.c (permanent_obstack): Delete definition.
(init_ttree): Rename from init_obstacks.
(permalloc): Delete.
(perm_calloc): Delete.
(dump_tree_statistics): Don't print information about
permanent_obstack.
* varasm.c (assemble_start_function): Use xstrdup instead of
permalloc/strcpy.
(assemble_variable): Likewise.
* config/alpha/alpha.c (unicosmk_need_dex): Use xmalloc instead of
permalloc.
(unicosmk_add_extern): Likewise.
* config/c4x/c4x.c (c4x_external_ref): Likewise.
(c4x_global_label): Likewise.
* config/frv/frv.c (frv_encode_section_info): Likewise.
* config/i386/winnt.c (i386_pe_record_external_function): Likewise.
(i386_pe_record_exported_symbol): Likewise.
* config/mips/mips.c (mips_output_external): Likewise.
(mips_output_external_libcall): Likewise.
* config/pa/pa.c: (permanent_obstack): Delete declaration.
(output_call): Use ggc_strdup instead of allocating on
permanent_obstack.
* config/romp/romp.c: Include ggc.h.
(get_symref): Don't declare permanent_obstack, use ggc_strdup
intead of permanent_obstack.
* config/rs6000/aix31.h (ASM_OUTPUT_EXTERNAL): Use concat
instead of permalloc.
* config/rs6000/rs6000.c (rs6000_gen_section_name): Use xmalloc
instead of permalloc
* config/rs6000/xcoff.h (ASM_OUTPUT_EXTERNAL): Use concat
instead of permalloc.
* config/vax/vax.c (vms_check_external): Use xmalloc instead of
permalloc.

Index: cp/ChangeLog
2002-08-04  Geoffrey Keating  <geoffk@redhat.com>

* cvt.c (ocp_convert): Delete obsolete code.
* parse.y (permanent_obstack): Delete declaration.
* pt.c (permanent_obstack): Delete declaration.
* repo.c (permanent_obstack): Delete declaration.
(open_repo_file): Use xmalloc instead of permanent_obstack.
(init_repo): Use xstrdup instead of permanent_obstack.

Index: java/ChangeLog
2002-08-04  Geoffrey Keating  <geoffk@redhat.com>

* class.c: (permanent_obstack): Delete declaration.
* constants.c: (permanent_obstack): Delete declaration.
* except.c: (permanent_obstack): Delete declaration.
* expr.c: (permanent_obstack): Delete declaration.
* jcf-parse.c: (permanent_obstack): Delete declaration.
(saveable_obstack): Delete declaration.
* parse.h: (permanent_obstack): Delete declaration.
* typeck.c: (permanent_obstack): Delete declaration.

From-SVN: r56035

38 files changed:
gcc/ChangeLog
gcc/Makefile.in
gcc/collect2.c
gcc/collect2.h
gcc/config/alpha/alpha.c
gcc/config/c4x/c4x.c
gcc/config/frv/frv.c
gcc/config/i386/winnt.c
gcc/config/mips/mips.c
gcc/config/pa/pa.c
gcc/config/romp/romp.c
gcc/config/rs6000/aix31.h
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/xcoff.h
gcc/config/vax/vax.c
gcc/cp/ChangeLog
gcc/cp/cvt.c
gcc/cp/parse.y
gcc/cp/pt.c
gcc/cp/repo.c
gcc/expr.c
gcc/function.c
gcc/integrate.c
gcc/java/ChangeLog
gcc/java/class.c
gcc/java/constants.c
gcc/java/except.c
gcc/java/expr.c
gcc/java/jcf-parse.c
gcc/java/parse.h
gcc/java/typeck.c
gcc/print-tree.c
gcc/sdbout.c
gcc/tlink.c
gcc/toplev.c
gcc/tree.c
gcc/tree.h
gcc/varasm.c

index bf0c62312b22ca5ddebeae4ce6845bcd6fe3333e..bc20197df6a1cc7310ae3c8ddf0e28c0eaf35cf9 100644 (file)
@@ -1,3 +1,55 @@
+2002-08-04  Geoffrey Keating  <geoffk@redhat.com>
+
+       * Makefile.in (sdbout.o): Doesn't need $(OBSTACK_H).
+       * collect2.h (permanent_obstack): Delete declaration.
+       * collect2.c (permanent_obstack): Delete definition.
+       (main): Don't initialise permanent_obstack.  Use xstrdup instead.
+       * expr.c: Don't include obstack.h.
+       (permanent_obstack): Delete declaration.
+       * function.c: Don't include obstack.h.
+       (permanent_obstack): Delete declaration.
+       * integrate.c: Don't include obstack.h.
+       (function_maybepermanent_obstack): Delete declaration.
+       * print-tree.c (debug_tree): Use x*alloc not permalloc.
+       * sdbout.c (gen_fake_label): Use x*alloc not permalloc.
+       * tlink.c (pfgets): Use xstrdup not permanent_obstack.
+       * toplev.c (lang_independent_init): Rename init_obstacks to init_ttree.
+       * tree.h: Rename init_obstacks to init_ttree.  Remove declarations
+       of permalloc, expralloc, perm_calloc.
+       * tree.c (permanent_obstack): Delete definition.
+       (init_ttree): Rename from init_obstacks.
+       (permalloc): Delete.
+       (perm_calloc): Delete.
+       (dump_tree_statistics): Don't print information about
+       permanent_obstack.
+       * varasm.c (assemble_start_function): Use xstrdup instead of
+       permalloc/strcpy.
+       (assemble_variable): Likewise.
+       * config/alpha/alpha.c (unicosmk_need_dex): Use xmalloc instead of
+       permalloc.
+       (unicosmk_add_extern): Likewise.
+       * config/c4x/c4x.c (c4x_external_ref): Likewise.
+       (c4x_global_label): Likewise.
+       * config/frv/frv.c (frv_encode_section_info): Likewise.
+       * config/i386/winnt.c (i386_pe_record_external_function): Likewise.
+       (i386_pe_record_exported_symbol): Likewise.
+       * config/mips/mips.c (mips_output_external): Likewise.
+       (mips_output_external_libcall): Likewise.
+       * config/pa/pa.c: (permanent_obstack): Delete declaration.
+       (output_call): Use ggc_strdup instead of allocating on
+       permanent_obstack.
+       * config/romp/romp.c: Include ggc.h.
+       (get_symref): Don't declare permanent_obstack, use ggc_strdup
+       intead of permanent_obstack.
+       * config/rs6000/aix31.h (ASM_OUTPUT_EXTERNAL): Use concat
+       instead of permalloc.
+       * config/rs6000/rs6000.c (rs6000_gen_section_name): Use xmalloc
+       instead of permalloc
+       * config/rs6000/xcoff.h (ASM_OUTPUT_EXTERNAL): Use concat
+       instead of permalloc.
+       * config/vax/vax.c (vms_check_external): Use xmalloc instead of
+       permalloc.
+
 2002-08-04  Bernd Schmidt  <bernds@redhat.com>
 
        Contribute a port developed primarily by Michael Meissner,
index 8647b702229c8f3b907b36226d4e9dcb09ca21ef..b9fc3648180ec3983cdaade6a9d55ebced58864a 100644 (file)
@@ -1446,7 +1446,7 @@ dbxout.o : dbxout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) flags.h \
 debug.o : debug.c debug.h $(CONFIG_H) $(SYSTEM_H)
 sdbout.o : sdbout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) flags.h \
    function.h $(EXPR_H) output.h hard-reg-set.h $(REGS_H) real.h \
-   insn-config.h $(OBSTACK_H) xcoffout.h c-pragma.h ggc.h \
+   insn-config.h xcoffout.h c-pragma.h ggc.h \
    sdbout.h toplev.h $(TM_P_H) except.h debug.h langhooks.h gt-sdbout.h
 dwarfout.o : dwarfout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) dwarf.h \
    flags.h insn-config.h reload.h output.h toplev.h $(TM_P_H) \
index 0bf1608460bc2ee4a9af9fb11b604f1c85a2a837..c9b8865e62780caf5220482108d86d53e142cf2c 100644 (file)
@@ -231,7 +231,6 @@ static struct head exports;         /* list of exported symbols */
 static struct head frame_tables;       /* list of frame unwind info tables */
 
 struct obstack temporary_obstack;
-struct obstack permanent_obstack;
 char * temporary_firstobj;
 
 /* Holds the return value of pexecute.  */
@@ -916,7 +915,6 @@ main (argc, argv)
 #endif
 
   obstack_begin (&temporary_obstack, 0);
-  obstack_begin (&permanent_obstack, 0);
   temporary_firstobj = (char *) obstack_alloc (&temporary_obstack, 0);
 
   current_demangling_style = auto_demangling;
@@ -1076,18 +1074,18 @@ main (argc, argv)
     {
       const char *q = extract_string (&p);
       if (*q == '-' && (q[1] == 'm' || q[1] == 'f'))
-       *c_ptr++ = obstack_copy0 (&permanent_obstack, q, strlen (q));
+       *c_ptr++ = xstrdup (q);
       if (strcmp (q, "-EL") == 0 || strcmp (q, "-EB") == 0)
-       *c_ptr++ = obstack_copy0 (&permanent_obstack, q, strlen (q));
+       *c_ptr++ = xstrdup (q);
       if (strcmp (q, "-shared") == 0)
        shared_obj = 1;
       if (*q == '-' && q[1] == 'B')
        {
-         *c_ptr++ = obstack_copy0 (&permanent_obstack, q, strlen (q));
+         *c_ptr++ = xstrdup (q);
          if (q[2] == 0)
            {
              q = extract_string (&p);
-             *c_ptr++ = obstack_copy0 (&permanent_obstack, q, strlen (q));
+             *c_ptr++ = xstrdup (q);
            }
        }
     }
index 2a65836fd8d17133759369bbacf64f6a0a3203b8..f67882025391b5e39a3cfc036cf66458a514d99d 100644 (file)
@@ -36,7 +36,6 @@ extern int file_exists PARAMS ((const char *));
 extern const char *ldout;
 extern const char *c_file_name;
 extern struct obstack temporary_obstack;
-extern struct obstack permanent_obstack;
 extern char *temporary_firstobj;
 extern int vflag, debug;
 
index ce9c6cd1c6273c60a718da9b3a5aef882c054563..9b6f02669e5a04226bb20cef8a889e637503e3a6 100644 (file)
@@ -9824,7 +9824,7 @@ unicosmk_add_extern (name)
   struct unicosmk_extern_list *p;
 
   p = (struct unicosmk_extern_list *)
-       permalloc (sizeof (struct unicosmk_extern_list));
+       xmalloc (sizeof (struct unicosmk_extern_list));
   p->next = unicosmk_extern_head;
   p->name = name;
   unicosmk_extern_head = p;
@@ -9906,7 +9906,7 @@ unicosmk_need_dex (x)
       --i;
     }
       
-  dex = (struct unicosmk_dex *) permalloc (sizeof (struct unicosmk_dex));
+  dex = (struct unicosmk_dex *) xmalloc (sizeof (struct unicosmk_dex));
   dex->name = name;
   dex->next = unicosmk_dex_list;
   unicosmk_dex_list = dex;
index 44c916f78d9b854598a3345c640e32c833542895..f5c987c6d4a034788e9baaee900b45feb4a78bc8 100644 (file)
@@ -4497,7 +4497,7 @@ c4x_global_label (name)
        return;
       p = p->next;
     }
-  p = (struct name_list *) permalloc (sizeof *p);
+  p = (struct name_list *) xmalloc (sizeof *p);
   p->next = global_head;
   p->name = name;
   global_head = p;
@@ -4546,7 +4546,7 @@ c4x_external_ref (name)
        return;
       p = p->next;
     }
-  p = (struct name_list *) permalloc (sizeof *p);
+  p = (struct name_list *) xmalloc (sizeof *p);
   p->next = extern_head;
   p->name = name;
   extern_head = p;
index b4e3346fcceff7ad6f887908cd607c86a80a62bb..11b3674fee8db4e8e8737d6b793103d5bdd15be4 100644 (file)
@@ -748,7 +748,7 @@ frv_encode_section_info (decl)
       if (is_small)
        {
          rtx sym_ref = XEXP (DECL_RTL (decl), 0);
-         char * str = permalloc (2 + strlen (XSTR (sym_ref, 0)));
+         char * str = xmalloc (2 + strlen (XSTR (sym_ref, 0)));
 
          str[0] = SDATA_FLAG_CHAR;
          strcpy (&str[1], XSTR (sym_ref, 0));
index 066b4d22f3a276d04a906fec6fcf358e4f274e9d..f629d35570b6f33a92c8a0d1a25d74126efafcc6 100644 (file)
@@ -622,7 +622,7 @@ i386_pe_record_external_function (name)
 {
   struct extern_list *p;
 
-  p = (struct extern_list *) permalloc (sizeof *p);
+  p = (struct extern_list *) xmalloc (sizeof *p);
   p->next = extern_head;
   p->name = name;
   extern_head = p;
@@ -652,7 +652,7 @@ i386_pe_record_exported_symbol (name, is_data)
 {
   struct export_list *p;
 
-  p = (struct export_list *) permalloc (sizeof *p);
+  p = (struct export_list *) xmalloc (sizeof *p);
   p->next = export_head;
   p->name = name;
   p->is_data = is_data;
index c0795dc6cb49c75086eba95ad9c6a3aa6a0dfcf6..31cd0d04ba05bf7b31bd954ad7ab85aa17d1ee54 100644 (file)
@@ -6044,7 +6044,7 @@ mips_output_external (file, decl, name)
          || strcmp (TREE_STRING_POINTER (section_name), ".sbss") == 0
          || strcmp (TREE_STRING_POINTER (section_name), ".sdata") == 0))
     {
-      p = (struct extern_list *) permalloc (sizeof (struct extern_list));
+      p = (struct extern_list *) xmalloc (sizeof (struct extern_list));
       p->next = extern_head;
       p->name = name;
       p->size = len;
@@ -6060,7 +6060,7 @@ mips_output_external (file, decl, name)
         bootstrap under Irix 5.1.  */
       && strcmp (name, "__builtin_next_arg"))
     {
-      p = (struct extern_list *) permalloc (sizeof (struct extern_list));
+      p = (struct extern_list *) xmalloc (sizeof (struct extern_list));
       p->next = extern_head;
       p->name = name;
       p->size = -1;
@@ -6079,7 +6079,7 @@ mips_output_external_libcall (file, name)
 {
   register struct extern_list *p;
 
-  p = (struct extern_list *) permalloc (sizeof (struct extern_list));
+  p = (struct extern_list *) xmalloc (sizeof (struct extern_list));
   p->next = extern_head;
   p->name = name;
   p->size = -1;
index aa7e0eff552ae46cc731c4ceb644073f79feba5c..7b5e7af178b1f8ac938f2203c49401daff77f614 100644 (file)
@@ -6168,8 +6168,6 @@ output_millicode_call (insn, call_dest)
   return "";
 }
 
-extern struct obstack permanent_obstack;
-
 /* INSN is either a function call.  It may have an unconditional jump
    in its delay slot.
 
@@ -6298,9 +6296,7 @@ output_call (insn, call_dest, sibcall)
 
              i = n_deferred_plabels++;
              deferred_plabels[i].internal_label = gen_label_rtx ();
-             deferred_plabels[i].name = obstack_alloc (&permanent_obstack,
-                                                       strlen (name) + 1);
-             strcpy (deferred_plabels[i].name, name);
+             deferred_plabels[i].name = ggc_strdup (name);
 
              /* Gross.  We have just implicitly taken the address of this
                 function, mark it as such.  */
index f60fcde56883d50ee686037a59b926ec18c3bb12..c01ab051f99cec7cb747a232d178efcbb7b157a2 100644 (file)
@@ -37,6 +37,7 @@ Boston, MA 02111-1307, USA.  */
 #include "tree.h"
 #include "function.h"
 #include "expr.h"
+#include "ggc.h"
 #include "toplev.h"
 #include "tm_p.h"
 #include "target.h"
@@ -1345,7 +1346,6 @@ rtx
 get_symref (name)
      register const char *name;
 {
-  extern struct obstack permanent_obstack;
   register const char *sp = name;
   unsigned int hash = 0;
   struct symref_hashent *p, **last_p;
@@ -1367,10 +1367,8 @@ get_symref (name)
     {
       /* Ensure SYMBOL_REF will stay around.  */
       p = *last_p = (struct symref_hashent *)
-                       permalloc (sizeof (struct symref_hashent));
-      p->symref = gen_rtx_SYMBOL_REF (Pmode,
-                                     obstack_copy0 (&permanent_obstack,
-                                                    name, strlen (name)));
+                       xmalloc (sizeof (struct symref_hashent));
+      p->symref = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (name));
       p->next = 0;
     }
 
index f390addb6e7568494c5bd4bc4a8efae36a83ca2f..7379a34178519faa8e731146821e6fec2b790d39 100644 (file)
@@ -29,25 +29,25 @@ Boston, MA 02111-1307, USA.  */
    where we can't, it gets stripped off.  */
 
 #undef ASM_OUTPUT_EXTERNAL
-#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME)  \
-{ rtx _symref = XEXP (DECL_RTL (DECL), 0);     \
-  if ((TREE_CODE (DECL) == VAR_DECL            \
-       || TREE_CODE (DECL) == FUNCTION_DECL)   \
-      && (NAME)[strlen (NAME) - 1] != ']')     \
-    {                                          \
-      char *_name = (char *) permalloc (strlen (XSTR (_symref, 0)) + 5); \
-      strcpy (_name, XSTR (_symref, 0));       \
-      strcat (_name, TREE_CODE (DECL) == FUNCTION_DECL ? "[DS]" : "[RW]"); \
-      XSTR (_symref, 0) = _name;               \
-    }                                          \
-  fputs ("\t.extern ", FILE);                  \
-  assemble_name (FILE, XSTR (_symref, 0));     \
-  if (TREE_CODE (DECL) == FUNCTION_DECL)       \
-    {                                          \
-      fputs ("\n\t.extern .", FILE);           \
-      RS6000_OUTPUT_BASENAME (FILE, XSTR (_symref, 0));        \
-    }                                          \
-  putc ('\n', FILE);                           \
+#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME)                          \
+{ rtx _symref = XEXP (DECL_RTL (DECL), 0);                             \
+  if ((TREE_CODE (DECL) == VAR_DECL                                    \
+       || TREE_CODE (DECL) == FUNCTION_DECL)                           \
+      && (NAME)[strlen (NAME) - 1] != ']')                             \
+    {                                                                  \
+      XSTR (_symref, 0) = concat (XSTR (_symref, 0),                   \
+                                 (TREE_CODE (DECL) == FUNCTION_DECL    \
+                                  ? "[DS]" : "[RW]"),                  \
+                                 NULL);                                \
+    }                                                                  \
+  fputs ("\t.extern ", FILE);                                          \
+  assemble_name (FILE, XSTR (_symref, 0));                             \
+  if (TREE_CODE (DECL) == FUNCTION_DECL)                               \
+    {                                                                  \
+      fputs ("\n\t.extern .", FILE);                                   \
+      RS6000_OUTPUT_BASENAME (FILE, XSTR (_symref, 0));                        \
+    }                                                                  \
+  putc ('\n', FILE);                                                   \
 }
 
 /* Similar, but for libcall.  We only have to worry about the function name,
index 026e30f2c042ea01002813e92e1cf06e52294dd7..3e6a9a9359975dc977acf60ad5d15a67e673dd1c 100644 (file)
@@ -11874,7 +11874,7 @@ rs6000_gen_section_name (buf, filename, section_desc)
     }
 
   len = strlen (after_last_slash) + strlen (section_desc) + 2;
-  *buf = (char *) permalloc (len);
+  *buf = (char *) xmalloc (len);
 
   p = *buf;
   *p++ = '_';
index 6f968805083c12475a93aff145e337437621325d..1e53a0c4e4a6a37f21e10287c86089837861cf9d 100644 (file)
@@ -306,17 +306,17 @@ toc_section ()                                            \
 /* This says how to output an external.  */
 
 #undef ASM_OUTPUT_EXTERNAL
-#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME)  \
-{ rtx _symref = XEXP (DECL_RTL (DECL), 0);     \
-  if ((TREE_CODE (DECL) == VAR_DECL            \
-       || TREE_CODE (DECL) == FUNCTION_DECL)   \
-      && (NAME)[strlen (NAME) - 1] != ']')     \
-    {                                          \
-      char *_name = (char *) permalloc (strlen (XSTR (_symref, 0)) + 5); \
-      strcpy (_name, XSTR (_symref, 0));       \
-      strcat (_name, TREE_CODE (DECL) == FUNCTION_DECL ? "[DS]" : "[RW]"); \
-      XSTR (_symref, 0) = _name;               \
-    }                                          \
+#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME)                          \
+{ rtx _symref = XEXP (DECL_RTL (DECL), 0);                             \
+  if ((TREE_CODE (DECL) == VAR_DECL                                    \
+       || TREE_CODE (DECL) == FUNCTION_DECL)                           \
+      && (NAME)[strlen (NAME) - 1] != ']')                             \
+    {                                                                  \
+      XSTR (_symref, 0) = concat (XSTR (_symref, 0),                   \
+                                 (TREE_CODE (DECL) == FUNCTION_DECL    \
+                                  ? "[DS]" : "[RW]"),                  \
+                                 NULL);                                \
+    }                                                                  \
 }
 
 /* This is how to output an internal numbered label where
index 2114281f13b21132357432dae0e8c1d995c5328e..0cca78c769cd8f971f11caf9ee3d641842460761 100644 (file)
@@ -810,7 +810,7 @@ vms_check_external (decl, name, pending)
       }
 
   /* Not previously seen; create a new list entry.  */
-  p = (struct extern_list *)permalloc ((long) sizeof (struct extern_list));
+  p = (struct extern_list *) xmalloc (sizeof (struct extern_list));
   p->name = name;
 
   if (pending)
index ee0a612c1b37b113174edd8df4dfd4cbacc870ff..4001a17557cb4aec5f5e763a12330c15c3b15a40 100644 (file)
@@ -1,3 +1,12 @@
+2002-08-04  Geoffrey Keating  <geoffk@redhat.com>
+
+       * cvt.c (ocp_convert): Delete obsolete code.
+       * parse.y (permanent_obstack): Delete declaration.
+       * pt.c (permanent_obstack): Delete declaration.
+       * repo.c (permanent_obstack): Delete declaration.
+       (open_repo_file): Use xmalloc instead of permanent_obstack.
+       (init_repo): Use xstrdup instead of permanent_obstack.
+
 2002-08-04  Nathan Sidwell  <nathan@codesourcery.com>
 
        * cp-tree.h (VF_DERIVED_VALUE): Remove.
index ee01a31a5668c4efe7b347382e30bbeb24fa6d46..fd4b6b96757ec49d2680209d45087b3944c8e055 100644 (file)
@@ -779,14 +779,6 @@ ocp_convert (type, expr, convtype, flags)
        return build_cplus_new (type, ctor);
     }
 
-  /* If TYPE or TREE_TYPE (E) is not on the permanent_obstack,
-     then it won't be hashed and hence compare as not equal,
-     even when it is.  */
-  if (code == ARRAY_TYPE
-      && TREE_TYPE (TREE_TYPE (e)) == TREE_TYPE (type)
-      && index_type_equal (TYPE_DOMAIN (TREE_TYPE (e)), TYPE_DOMAIN (type)))
-    return e;
-
   if (flags & LOOKUP_COMPLAIN)
     error ("conversion from `%T' to non-scalar type `%T' requested",
              TREE_TYPE (expr), type);
index 0fa97743734d5faf1298e08c0680f2c577906429..b7b9d30c236c57ea5aea713cfcc20d8d34b852a1 100644 (file)
@@ -44,8 +44,6 @@ Boston, MA 02111-1307, USA.  */
 #include "toplev.h"
 #include "ggc.h"
 
-extern struct obstack permanent_obstack;
-
 /* Like YYERROR but do call yyerror.  */
 #define YYERROR1 { yyerror ("syntax error"); YYERROR; }
 
index d279ed0a72db2fcfeceaf6dfe62b31da0caea69b..406e54aa1b8c165df1947217b036c445f5d60211 100644 (file)
@@ -47,8 +47,6 @@ Boston, MA 02111-1307, USA.  */
    returning an int.  */
 typedef int (*tree_fn_t) PARAMS ((tree, void*));
 
-extern struct obstack permanent_obstack;
-
 /* The PENDING_TEMPLATES is a TREE_LIST of templates whose
    instantiations have been deferred, either because their definitions
    were not yet available, or because we were putting off doing the
index 6aacebfdd604171b5e65d3628a76b5caaeeb1ed8..e27d8c2199e97d1eadbe72db462d5101229c2946 100644 (file)
@@ -50,7 +50,6 @@ static FILE *repo_file;
 static char *old_args, *old_dir, *old_main;
 
 static struct obstack temporary_obstack;
-extern struct obstack permanent_obstack;
 
 #define IDENTIFIER_REPO_USED(NODE)   (TREE_LANG_FLAG_3 (NODE))
 #define IDENTIFIER_REPO_CHOSEN(NODE) (TREE_LANG_FLAG_4 (NODE))
@@ -292,8 +291,9 @@ open_repo_file (filename)
   if (! p)
     p = s + strlen (s);
 
-  obstack_grow (&permanent_obstack, s, p - s);
-  repo_name = obstack_copy0 (&permanent_obstack, ".rpo", 4);
+  repo_name = xmalloc (p - s + 5);
+  memcpy (repo_name, s, p - s);
+  memcpy (repo_name + (p - s), ".rpo", 5);
 
   repo_file = fopen (repo_name, "r");
 }
@@ -332,16 +332,13 @@ init_repo (filename)
       switch (buf[0])
        {
        case 'A':
-         old_args = obstack_copy0 (&permanent_obstack, buf + 2,
-                                   strlen (buf + 2));
+         old_args = ggc_strdup (buf + 2);
          break;
        case 'D':
-         old_dir = obstack_copy0 (&permanent_obstack, buf + 2,
-                                  strlen (buf + 2));
+         old_dir = ggc_strdup (buf + 2);
          break;
        case 'M':
-         old_main = obstack_copy0 (&permanent_obstack, buf + 2,
-                                   strlen (buf + 2));
+         old_main = ggc_strdup (buf + 2);
          break;
        case 'C':
        case 'O':
index 4591af434e63b2fed947885298bf3fbd77dbf2b7..5ee1ef36752a55ded17507810e55b9d462c7bcb9 100644 (file)
@@ -25,7 +25,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "real.h"
 #include "rtl.h"
 #include "tree.h"
-#include "obstack.h"
 #include "flags.h"
 #include "regs.h"
 #include "hard-reg-set.h"
@@ -118,8 +117,6 @@ struct store_by_pieces
   int reverse;
 };
 
-extern struct obstack permanent_obstack;
-
 static rtx enqueue_insn                PARAMS ((rtx, rtx));
 static unsigned HOST_WIDE_INT move_by_pieces_ninsns
                                PARAMS ((unsigned HOST_WIDE_INT,
index 98c1965870846f7e5b64afa32064578f45955756..47fa24de05a56ff66a93bd3d3643af90dadf8b1d 100644 (file)
@@ -53,7 +53,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "recog.h"
 #include "output.h"
 #include "basic-block.h"
-#include "obstack.h"
 #include "toplev.h"
 #include "hashtab.h"
 #include "ggc.h"
@@ -6421,8 +6420,6 @@ expand_main_function ()
 #endif
 }
 \f
-extern struct obstack permanent_obstack;
-
 /* The PENDING_SIZES represent the sizes of variable-sized types.
    Create RTL for the various sizes now (using temporary variables),
    so that we can refer to the sizes from the RTL we are generating
index 253d25414eb01fb585e5b698ae7ac7597a818449..8d23ae9d754b4ac2696343b784ca7f709ad5d4e6 100644 (file)
@@ -45,10 +45,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "target.h"
 #include "langhooks.h"
 
-#include "obstack.h"
-
-extern struct obstack *function_maybepermanent_obstack;
-
 /* Similar, but round to the next highest integer that meets the
    alignment.  */
 #define CEIL_ROUND(VALUE,ALIGN)        (((VALUE) + (ALIGN) - 1) & ~((ALIGN)- 1))
index 4393d5cef7ce1efa6d4e71e6736f18d8fe007bc0..b0469aec3513ef09cd6509e709adbf11649234bb 100644 (file)
@@ -1,3 +1,14 @@
+2002-08-04  Geoffrey Keating  <geoffk@redhat.com>
+
+       * class.c: (permanent_obstack): Delete declaration.
+       * constants.c: (permanent_obstack): Delete declaration.
+       * except.c: (permanent_obstack): Delete declaration.
+       * expr.c: (permanent_obstack): Delete declaration.
+       * jcf-parse.c: (permanent_obstack): Delete declaration.
+       (saveable_obstack): Delete declaration.
+       * parse.h: (permanent_obstack): Delete declaration.
+       * typeck.c: (permanent_obstack): Delete declaration.
+
 2002-08-04  Joseph S. Myers  <jsm@polyomino.org.uk>
 
        * gcj.texi (version-gcc): Increase to 3.3.
index f5c55979cd8237850e3f7deb3335961ac68725b4..e167e0d0f86aa9f067255921060d9d6049cd7281 100644 (file)
@@ -60,7 +60,6 @@ static tree build_method_symbols_entry PARAMS ((tree));
 static GTY(()) rtx registerClass_libfunc;
 static GTY(()) rtx registerResource_libfunc;
 
-extern struct obstack permanent_obstack;
 struct obstack temporary_obstack;
 
 /* The compiler generates different code depending on whether or not
index e3642d5d67dfa01aedf77eb527bf7c1361676de6..83c2e5528d6ca0cc5a58521379c8e7f72e294c70 100644 (file)
@@ -29,8 +29,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc.  */
 #include "toplev.h"
 #include "ggc.h"
 
-extern struct obstack permanent_obstack;
-
 static void set_constant_entry PARAMS ((CPool *, int, int, jword));
 static int find_class_or_string_constant PARAMS ((CPool *, int, tree));
 static int find_name_and_type_constant PARAMS ((CPool *, tree, tree));
index 5b315185807aa3d425ba08dcbad7be3d6246302c..ef773e4a6b32456c907e8e14fafa9bc4acd81838 100644 (file)
@@ -44,8 +44,6 @@ static void link_handler PARAMS ((struct eh_range *, struct eh_range *));
 static void check_start_handlers PARAMS ((struct eh_range *, int));
 static void free_eh_ranges PARAMS ((struct eh_range *range));
 
-extern struct obstack permanent_obstack;
-
 struct eh_range *current_method_handlers;
 
 struct eh_range *current_try_block = NULL;
index 3b765e43412cf59053ad2d4cf88b5943287b76f9..133fa039b45617b2befb9b438d0b7e57b405b8f1 100644 (file)
@@ -86,7 +86,6 @@ static int emit_init_test_initialization PARAMS ((void **entry,
 static int get_offset_table_index PARAMS ((tree));
 
 static GTY(()) tree operand_type[59];
-extern struct obstack permanent_obstack;
 
 static GTY(()) tree methods_ident;
 static GTY(()) tree ncode_ident;
index 3b1f5d6c91c24fb9f7d496f2f384a7e7575a4c3d..fc755f0ce711003b67ab18d2ea9012b416b8f224 100644 (file)
@@ -66,9 +66,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc.  */
 
 #include "jcf.h"
 
-extern struct obstack *saveable_obstack;
 extern struct obstack temporary_obstack;
-extern struct obstack permanent_obstack;
 
 /* Set to non-zero value in order to emit class initilization code
    before static field references.  */
index 4a15cf1792dcffa7781a9930a3a25491866d9245..9d7b30ae9d5b19c17985056302ef0e1cf56398c6 100644 (file)
@@ -31,7 +31,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc.  */
 /* Extern global variable declarations */
 extern int java_error_count;
 extern struct obstack temporary_obstack;
-extern struct obstack permanent_obstack;
 extern int quiet_flag;
 
 #ifndef JC1_LITE
index 86bc024b4b8e792565786a64d021af39ad11fc03..4a1894f641e60e77338d828da386a3078e22b368 100644 (file)
@@ -44,7 +44,6 @@ static tree lookup_do PARAMS ((tree, tree, tree, tree, tree (*)(tree)));
 static tree build_null_signature PARAMS ((tree));
 
 tree * type_map;
-extern struct obstack permanent_obstack;
 
 /* Set the type of the local variable with index SLOT to TYPE. */
 
index fb285d6fbc673724991d9d8cdc1f9893e4d2dccb..3104f1be214820fc8d33ad05e1f17ea8e8f97bb0 100644 (file)
@@ -48,8 +48,7 @@ void
 debug_tree (node)
      tree node;
 {
-  table = (struct bucket **) permalloc (HASH_SIZE * sizeof (struct bucket *));
-  memset ((char *) table, 0, HASH_SIZE * sizeof (struct bucket *));
+  table = (struct bucket **) xcalloc (HASH_SIZE, sizeof (struct bucket *));
   print_node (stderr, "", node, 0);
   table = 0;
   fprintf (stderr, "\n");
@@ -213,7 +212,7 @@ print_node (file, prefix, node, indent)
       }
 
   /* Add this node to the table.  */
-  b = (struct bucket *) permalloc (sizeof (struct bucket));
+  b = (struct bucket *) xmalloc (sizeof (struct bucket));
   b->node = node;
   b->next = table[hash];
   table[hash] = b;
index 0ec5abb5631cb3b8a16caacd35e60ddc262bf912..aa928de13419cf4bfe63e8270e0a41d1cccf4d9c 100644 (file)
@@ -361,8 +361,7 @@ gen_fake_label ()
   char *labelstr;
   SDB_GENERATE_FAKE (label, unnamed_struct_number);
   unnamed_struct_number++;
-  labelstr = (char *) permalloc (strlen (label) + 1);
-  strcpy (labelstr, label);
+  labelstr = xstrdup (label);
   return labelstr;
 }
 \f
index 555deb65b032fe8d935b23e3b9ef4ab73133e8bb..21d82f75ffe0633d882a14aed6feed2b32ed0c04 100644 (file)
@@ -334,7 +334,7 @@ static char *
 pfgets (stream)
      FILE *stream;
 {
-  return obstack_fgets (stream, &permanent_obstack);
+  return xstrdup (tfgets (stream));
 }
 \f
 /* Real tlink code.  */
index 719b48d3df961bcbc03206b61e46a723f6c0e4a9..5717507f37041d70d3a6c83d40b1a61985ba515f 100644 (file)
@@ -5161,7 +5161,7 @@ lang_independent_init (no_backend)
   init_ggc ();
 
   init_stringpool ();
-  init_obstacks ();
+  init_ttree ();
 
   if (no_backend)
     return;
index 1ff2e98e06513f40f23fb7fa33e1dd0eda107204..9e725db7958d28519261ed7a1c339d23560c3a47 100644 (file)
@@ -27,11 +27,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
    nodes of that code.
 
    It is intended to be language-independent, but occasionally
-   calls language-dependent routines defined (for C) in typecheck.c.
-
-   The low-level allocation routines oballoc and permalloc
-   are used also for allocating many other kinds of objects
-   by all passes of the compiler.  */
+   calls language-dependent routines defined (for C) in typecheck.c.  */
 
 #include "config.h"
 #include "system.h"
@@ -51,10 +47,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 /* obstack.[ch] explicitly declined to prototype this.  */
 extern int _obstack_allocated_p PARAMS ((struct obstack *h, PTR obj));
 
-/* Objects allocated on this obstack last forever.  */
-
-struct obstack permanent_obstack;
-
 #ifdef GATHER_STATISTICS
 /* Statistics-gathering stuff.  */
 typedef enum
@@ -136,43 +128,17 @@ static int type_hash_marked_p PARAMS ((const void *));
 tree global_trees[TI_MAX];
 tree integer_types[itk_none];
 \f
-/* Init the principal obstacks.  */
+/* Init tree.c.  */
 
 void
-init_obstacks ()
+init_ttree ()
 {
-  gcc_obstack_init (&permanent_obstack);
-
   /* Initialize the hash table of types.  */
   type_hash_table = htab_create (TYPE_HASH_INITIAL_SIZE, type_hash_hash,
                                 type_hash_eq, 0);
 }
 
 \f
-/* Allocate SIZE bytes in the permanent obstack
-   and return a pointer to them.  */
-
-char *
-permalloc (size)
-     int size;
-{
-  return (char *) obstack_alloc (&permanent_obstack, size);
-}
-
-/* Allocate NELEM items of SIZE bytes in the permanent obstack
-   and return a pointer to them.  The storage is cleared before
-   returning the value.  */
-
-char *
-perm_calloc (nelem, size)
-     int nelem;
-     long size;
-{
-  char *rval = (char *) obstack_alloc (&permanent_obstack, nelem * size);
-  memset (rval, 0, nelem * size);
-  return rval;
-}
-
 /* The name of the object as the assembler will see it (but before any
    translations made by ASM_OUTPUT_LABELREF).  Often this is the same
    as DECL_NAME.  It is an IDENTIFIER_NODE.  */
@@ -4359,7 +4325,6 @@ dump_tree_statistics ()
 #else
   fprintf (stderr, "(No per-node statistics)\n");
 #endif
-  print_obstack_statistics ("permanent_obstack", &permanent_obstack);
   print_type_hash_statistics ();
   (*lang_hooks.print_statistics) ();
 }
index 7f8c04970f02dfdb53157a021ef6ce4f03cdc2ab..fd8a5596488374a31dffc0a6befad3f816062708 100644 (file)
@@ -2103,8 +2103,6 @@ extern GTY(()) tree integer_types[itk_none];
    statistical reports, not code generation.  */
 extern double approx_sqrt              PARAMS ((double));
 
-extern char *permalloc                 PARAMS ((int));
-extern char *expralloc                 PARAMS ((int));
 extern tree decl_assembler_name                PARAMS ((tree));
 
 /* Compute the number of bytes occupied by 'node'.  This routine only
@@ -2730,7 +2728,6 @@ extern tree builtin_function              PARAMS ((const char *, tree, int,
                                               const char *, tree));
 \f
 /* In tree.c */
-extern char *perm_calloc                       PARAMS ((int, long));
 extern void clean_symbol_name                  PARAMS ((char *));
 extern tree get_file_function_name_long        PARAMS ((const char *));
 extern tree get_set_constructor_bits           PARAMS ((tree, char *, int));
@@ -2891,7 +2888,7 @@ extern int real_onep                      PARAMS ((tree));
 extern int real_twop                   PARAMS ((tree));
 extern int real_minus_onep             PARAMS ((tree));
 extern void gcc_obstack_init           PARAMS ((struct obstack *));
-extern void init_obstacks              PARAMS ((void));
+extern void init_ttree                 PARAMS ((void));
 extern void build_common_tree_nodes    PARAMS ((int));
 extern void build_common_tree_nodes_2  PARAMS ((int));
 
index 71ab7b6b6b8d0e28c267fcd1e2a8d0ad40724d86..3b250ac51a83dc0cf1ecf28ebd5430aecf0706c5 100644 (file)
@@ -1205,8 +1205,7 @@ assemble_start_function (decl, fnname)
          char *name;
 
          p = (* targetm.strip_name_encoding) (fnname);
-         name = permalloc (strlen (p) + 1);
-         strcpy (name, p);
+         name = xstrdup (p);
 
          if (! DECL_WEAK (decl) && ! DECL_ONE_ONLY (decl))
            first_global_object_name = name;
@@ -1529,8 +1528,7 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
       char *xname;
 
       p = (* targetm.strip_name_encoding) (name);
-      xname = permalloc (strlen (p) + 1);
-      strcpy (xname, p);
+      xname = xstrdup (p);
       first_global_object_name = xname;
     }