diff options
38 files changed, 140 insertions, 154 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bf0c623..bc20197 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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, diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 8647b70..b9fc364 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -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) \ diff --git a/gcc/collect2.c b/gcc/collect2.c index 0bf1608..c9b8865 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -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); } } } diff --git a/gcc/collect2.h b/gcc/collect2.h index 2a65836..f678820 100644 --- a/gcc/collect2.h +++ b/gcc/collect2.h @@ -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; diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index ce9c6cd..9b6f026 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -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; diff --git a/gcc/config/c4x/c4x.c b/gcc/config/c4x/c4x.c index 44c916f..f5c987c 100644 --- a/gcc/config/c4x/c4x.c +++ b/gcc/config/c4x/c4x.c @@ -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; diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c index b4e3346..11b3674 100644 --- a/gcc/config/frv/frv.c +++ b/gcc/config/frv/frv.c @@ -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)); diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c index 066b4d2..f629d35 100644 --- a/gcc/config/i386/winnt.c +++ b/gcc/config/i386/winnt.c @@ -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; diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index c0795dc..31cd0d0 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -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; diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index aa7e0ef..7b5e7af 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -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. */ diff --git a/gcc/config/romp/romp.c b/gcc/config/romp/romp.c index f60fcde..c01ab05 100644 --- a/gcc/config/romp/romp.c +++ b/gcc/config/romp/romp.c @@ -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; } diff --git a/gcc/config/rs6000/aix31.h b/gcc/config/rs6000/aix31.h index f390add..7379a34 100644 --- a/gcc/config/rs6000/aix31.h +++ b/gcc/config/rs6000/aix31.h @@ -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, diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 026e30f..3e6a9a9 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -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++ = '_'; diff --git a/gcc/config/rs6000/xcoff.h b/gcc/config/rs6000/xcoff.h index 6f96880..1e53a0c 100644 --- a/gcc/config/rs6000/xcoff.h +++ b/gcc/config/rs6000/xcoff.h @@ -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 diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c index 2114281..0cca78c 100644 --- a/gcc/config/vax/vax.c +++ b/gcc/config/vax/vax.c @@ -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) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ee0a612..4001a17 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index ee01a31..fd4b6b9 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -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); diff --git a/gcc/cp/parse.y b/gcc/cp/parse.y index 0fa9774..b7b9d30 100644 --- a/gcc/cp/parse.y +++ b/gcc/cp/parse.y @@ -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; } diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index d279ed0..406e54a 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -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 diff --git a/gcc/cp/repo.c b/gcc/cp/repo.c index 6aacebf..e27d8c2 100644 --- a/gcc/cp/repo.c +++ b/gcc/cp/repo.c @@ -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': @@ -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, diff --git a/gcc/function.c b/gcc/function.c index 98c1965..47fa24d 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -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 } -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 diff --git a/gcc/integrate.c b/gcc/integrate.c index 253d254..8d23ae9 100644 --- a/gcc/integrate.c +++ b/gcc/integrate.c @@ -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)) diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 4393d5c..b0469ae 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -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. diff --git a/gcc/java/class.c b/gcc/java/class.c index f5c5597..e167e0d 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -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 diff --git a/gcc/java/constants.c b/gcc/java/constants.c index e3642d5..83c2e55 100644 --- a/gcc/java/constants.c +++ b/gcc/java/constants.c @@ -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)); diff --git a/gcc/java/except.c b/gcc/java/except.c index 5b31518..ef773e4 100644 --- a/gcc/java/except.c +++ b/gcc/java/except.c @@ -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; diff --git a/gcc/java/expr.c b/gcc/java/expr.c index 3b765e4..133fa03 100644 --- a/gcc/java/expr.c +++ b/gcc/java/expr.c @@ -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; diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c index 3b1f5d6..fc755f0 100644 --- a/gcc/java/jcf-parse.c +++ b/gcc/java/jcf-parse.c @@ -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. */ diff --git a/gcc/java/parse.h b/gcc/java/parse.h index 4a15cf1..9d7b30a 100644 --- a/gcc/java/parse.h +++ b/gcc/java/parse.h @@ -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 diff --git a/gcc/java/typeck.c b/gcc/java/typeck.c index 86bc024..4a1894f 100644 --- a/gcc/java/typeck.c +++ b/gcc/java/typeck.c @@ -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. */ diff --git a/gcc/print-tree.c b/gcc/print-tree.c index fb285d6..3104f1b 100644 --- a/gcc/print-tree.c +++ b/gcc/print-tree.c @@ -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; diff --git a/gcc/sdbout.c b/gcc/sdbout.c index 0ec5abb..aa928de 100644 --- a/gcc/sdbout.c +++ b/gcc/sdbout.c @@ -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; } diff --git a/gcc/tlink.c b/gcc/tlink.c index 555deb6..21d82f75 100644 --- a/gcc/tlink.c +++ b/gcc/tlink.c @@ -334,7 +334,7 @@ static char * pfgets (stream) FILE *stream; { - return obstack_fgets (stream, &permanent_obstack); + return xstrdup (tfgets (stream)); } /* Real tlink code. */ diff --git a/gcc/toplev.c b/gcc/toplev.c index 719b48d..5717507 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -5161,7 +5161,7 @@ lang_independent_init (no_backend) init_ggc (); init_stringpool (); - init_obstacks (); + init_ttree (); if (no_backend) return; @@ -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]; -/* 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); } -/* 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) (); } @@ -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)); /* 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)); diff --git a/gcc/varasm.c b/gcc/varasm.c index 71ab7b6..3b250ac 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -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; } |