Mark Mitchell [Tue, 7 Sep 1999 15:20:58 +0000 (15:20 +0000)]
emit-rtl.c (free_emit_status): Take decl as a parameter.
* emit-rtl.c (free_emit_status): Take decl as a parameter.
(init_emit_once): Add more GC roots.
* except.c (mark_func_eh_entry): New function.
(mark_eh_node): Mark false_label and rethrow_label.
(init_eh): Add more GC roots.
* function.c (free_after_compilation): Take decl as a paramter.
Call free_stmt_status.
(mark_function_state): Don't assume x_parm_reg_stack_loc is
non-NULL.
* function.h (free_after_compilation): Change prototype.
(free_varasm_status): Likewise.
(free_emit_status): Likewise.
(free_stmt_status): New function.
* ggc-simple.c (rtx, vecs, trees, strings, bytes_alloced_since_gc):
Remove, replacing with ...
(ggc_status): New structure.
(ggc_chain): New variable.
(init_gcc): Define.
(ggc_push_context): New function.
(ggc_pop_context): Likewise.
(ggc_alloc_rtx): Adjust for use of ggc_chain.
(ggc_alloc_rtvec): Likewise.
(ggc_alloc_tree): Likewise.
(ggc_alloc_string): Likewise.
(ggc_mark_rtx): Mark NOTE_SOURCE_FILE and NOTE_RANGE_INFO.
(ggc_mark_tree): Give language-dependent code a chance to mark
`x' nodes.
(ggc_mark_tree_varray): Handle empty arrays.
(ggc_collect): Adjust for use of ggc_chain. Clear
bytes_alloced_since_last_gc.
* ggc.h (ggc_pop_context): New function.
(ggc_push_context): Likewise.
* print-tree.c (print_node): Don't print obstacks when GC'ing.
* stmt.c (free_stmt_status): New function.
(init_stmt_for_function): Clear last_expr_value.
* toplev.c (rest_of_compilation): Always call free_after_compilation.
Conditionalize call to ggc_collect.
(main): Call init_ggc.
* tree.c (push_obstacks): Do the push, even when GC'ing.
(push_obstacks_nochange): Likewise.
(pop_obstacks): Liekwise.
* varasm.c (free_varasm_status): Take decl as a parameter.
* config/mips/mips.h (MULTILIB_ENDIAN_DEFAULT) : New macro.
(MULTILIB_ENDIAN_DEFAULT) : Use the new macro.
* config/mips/elf64.h (MULTILIB_DEFAULTS) : Use the new macro.
* config/mips/r3900.h (MULTILIB_DEFAULTS) : Use the new macro.
* config/mips/mips.h (MULTILIB_ENDIAN_DEFAULT) : New macro.
(MULTILIB_ENDIAN_DEFAULT) : Use the new macro.
* config/mips/elf64.h (MULTILIB_DEFAULTS) : Use the new macro.
* config/mips/r3900.h (MULTILIB_DEFAULTS) : Use the new macro.
* cccp.c (my_strerror): Likewise. All callers changed to use
xstrerror instead.
(do_include): Call xstrdup, not xmalloc/strcpy.
(grow_outbuf): Don't check if xrealloc returns NULL, it can't.
(xmalloc, xrealloc, xcalloc, xstrdup): Don't define.
* collect2.c (my_strsignal): Likewise. All callers changed to use
strsignal instead.
(locatelib): Call xstrdup, not xmalloc/strcpy.
* 1750a.h (ASM_OUTPUT_INTERNAL_LABEL): Call xmalloc, not malloc.
* dsp16xx.c (override_options): Call xstrdup, not xmalloc/strcpy.
* i370.h (ASM_DECLARE_FUNCTION_NAME): Call xmalloc, not malloc.
* mips.c (build_mips16_call_stub): Call xstrdup, not xmalloc/strcpy.
* cppinit.c (cpp_options_init): Call xcalloc, not xmalloc/bzero.
* dwarfout.c (dwarfout_init): Call concat, not xmalloc/strcpy/...
* except.c (new_eh_region_entry): Call xmalloc/xrealloc, not
malloc/realloc.
(find_all_handler_type_matches): Likewise. Don't check return
value.
(get_new_handler, init_insn_eh_region, process_nestinfo): Call
xmalloc, not malloc.
(init_eh_nesting_info): Likewise. Call xcalloc, not xmalloc/bzero.
* gcc.c (xstrerror, xmalloc, xrealloc): Don't define.
(init_spec): Call xcalloc, not xmalloc/bzero.
(set_spec): Call xstrdup, not save_string.
(record_temp_file): Call xstrdup, not xmalloc/strcpy.
(find_a_file): Call xstrdup, not xmalloc/strcpy.
(process_command): Call xstrdup, not save_string.
(main): Call xcalloc, not xmalloc/bzero.
* gcov.c (xmalloc): Don't define.
(create_program_flow_graph): Call xcalloc, not xmalloc/bzero.
(scan_for_source_files): Call xstrdup, not xmalloc/strcpy.
(output_data): Call xcalloc, not xmalloc/bzero.
* haifa-sched.c (schedule_insns): Call xcalloc, not xmalloc/bzero.
* mips-tdump.c (xmalloc): Don't define.
(print_symbol): Call xmalloc, not malloc.
(read_tfile): Call xcalloc, not calloc.
* mips-tfile.c (xfree, my_strsignal, xmalloc, xcalloc, xrealloc):
Don't define. All callers of xfree/my_strsignal changed to use
free/strsignal instead.
(allocate_cluster): Call xcalloc, not calloc.
* Makefile.in (C_AND_OBJC_OBJS): Remove ggc-callbacks.o.
(c-parse.o, c-decl.o, c-lang.o, c-lex.o, c-common.o,
$(out_object_file)): Depend on ggc.h.
* c-common.c: Include "ggc.h".
(combine_strings): If doing GC, use ggc_alloc_string.
* c-decl.c: Include "ggc.h".
(ggc_p): Define with value 0.
(mark_binding_level): New function.
(init_decl_processing): Add GC roots.
(mark_c_function_context): New function.
(lang_mark_false_label_stack): New function.
(lang_mark_tree): New function.
(lang_cleanup_tree): New function.
* c-lang.c: Include "ggc.h".
(lang_init): Call c_parse_init.
* c-lex.c: Include "ggc.h".
(check_linenum): If doing GC, don't copy filenames to permanent
obstack.
* c-parse.in: Include "ggc.h".
(c_parse_init): New function.
* c-tree.h (c_parse_init, mark_c_function_context): Declare.
* objc/Make-lang.in (objc-parse.o): Depend on ggc.h.
* except.c (mark_eh_state): Mark more state.
* function.c (mark_function_state): Likewise.
* ggc-simple.c (ggc_alloc_rtvec): Bring in sync with non-gc version.
(ggc_alloc_string) [GGC_DUMP]: Fix typo.
* toplev.c (mark_file_stack): New function.
(compile_file): If doing GC, use ggc_alloc_string on input filename.
(main): Add root for input_file_stack.
* i386.c: Include "ggc.h".
(ix86_mark_machine_status): New function.
(override_options): Set mark_machine_status.
* Makefile.in (C_AND_OBJC_OBJS): Remove ggc-callbacks.o.
(c-parse.o, c-decl.o, c-lang.o, c-lex.o, c-common.o,
$(out_object_file)): Depend on ggc.h.
* c-common.c: Include "ggc.h".
(combine_strings): If doing GC, use ggc_alloc_string.
* c-decl.c: Include "ggc.h".
(ggc_p): Define with value 0.
(mark_binding_level): New function.
(init_decl_processing): Add GC roots.
(mark_c_function_context): New function.
(lang_mark_false_label_stack): New function.
(lang_mark_tree): New function.
(lang_cleanup_tree): New function.
* c-lang.c: Include "ggc.h".
(lang_init): Call c_parse_init.
* c-lex.c: Include "ggc.h".
(check_linenum): If doing GC, don't copy filenames to permanent
obstack.
* c-parse.in: Include "ggc.h".
(c_parse_init): New function.
* c-tree.h (c_parse_init, mark_c_function_context): Declare.
* objc/Make-lang.in (objc-parse.o): Depend on ggc.h.
* except.c (mark_eh_state): Mark more state.
* function.c (mark_function_state): Likewise.
* ggc-simple.c (ggc_alloc_rtvec): Bring in sync with non-gc version.
(ggc_alloc_string) [GGC_DUMP]: Fix typo.
* toplev.c (mark_file_stack): New function.
(compile_file): If doing GC, use ggc_alloc_string on input filename.
(main): Add root for input_file_stack.
* i386.c: Include "ggc.h".
(ix86_mark_machine_status): New function.
(override_options): Set mark_machine_status.
Mark Mitchell [Sun, 5 Sep 1999 19:54:38 +0000 (19:54 +0000)]
Makefile.in (ggc-simple.o): Depend on varray.h.
* Makefile.in (ggc-simple.o): Depend on varray.h.
(rtl.o): Depend on ggc.h.
(genattrtab.o): Depend on ggc.h.
(print-tree.o): Likewise.
(fold-const.o): Likewise.
* emit-rtl.c (sequence_element_free_list): Remove, and all references.
(make_insn_raw): Don't cache insns when GC'ing.
(emit_insn_before): Likewise.
(emit_insn_after): Likewise.
(emit_insn): Likewise.
(start_sequence): Use xmalloc to allocate the sequence_stack.
(end_sequence): Add free to free it.
(gen_sequence): Don't cache insns when GC'ing.
(clear_emit_caches): Don't use sequence_element_free_list.
(init_emit): Use xcalloc, not xmalloc+bzero.
* fold-const.c (size_int_wide): Kill the cache, when GC'ing.
* function.c (pop_function_context_from): Use free to free the
fixup_var_refs_queue.
(put_reg_into_stack): Allocate it with xmalloc.
* genattrtab.c: Include ggc.h.
(operate_exp): Don't use obstack_free when GC'ing.
(simplify_cond): Likewise.
(simplify_text_exp): Likewise.
(optimize_attrs): Likewise.
* gengenrtl.c (gendef): Use ggc_alloc_rtx to allocate RTL, when
GC'ing.
(gencode): Generate a #include for ggc.h.
* ggc-callbacks.c (ggc_p): Define it to zero.
* ggc-none.c (ggc_p): Likewise.
* ggc-simple.c: Include varray.h.
(ggc_mark_tree_varray): New function.
(ggc_add_tree_varray_root): Likewise.
(ggc_mark_tree_varray_ptr): Likewise.
* ggc.h (ggc_p): Declare.
(varray_head_tag): Likewise.
(ggc_add_tree_varray_root): Declare.
* print-tree.c (print_node): Don't check for TREE_PERMANENT
inconsistencies when GC'ing.
* rtl.c: Include ggc.h.
(rtvec_alloc): Use ggc_alloc_rtvec when GC'ing.
(rtx_alloc): Use ggc_alloc_rtx when GC'ing.
(rtx_free): Don't call obstack_free when GC'ing.
* toplev.c (rest_of_compilation): Call ggc_collect after every
pass, if GC'ing.
* tree.c (push_obstacks): Do nothing, if GC'ing.
(pop_obstacks_nochange): Likewise.
(pop_obstacks): Likewise.
(make_node): Use ggc_alloc_tree when GC'ing.
(copy_node): Likewise.
(get_identifier): Use ggc_alloc_string when GC'ing.
(build_string): Likewise.
(make_tree_vec): Use ggc_alloc_tree when GC'ing.
(tree_cons): Likewise.
(build1): Likewise.
(type_hash_canon): Don't call obstack_free when GC'ing.
* Makefile.in (ggc-simple.o): Depend on varray.h.
(rtl.o): Depend on ggc.h.
(genattrtab.o): Depend on ggc.h.
(print-tree.o): Likewise.
(fold-const.o): Likewise.
* emit-rtl.c (sequence_element_free_list): Remove, and all references.
(make_insn_raw): Don't cache insns when GC'ing.
(emit_insn_before): Likewise.
(emit_insn_after): Likewise.
(emit_insn): Likewise.
(start_sequence): Use xmalloc to allocate the sequence_stack.
(end_sequence): Add free to free it.
(gen_sequence): Don't cache insns when GC'ing.
(clear_emit_caches): Don't use sequence_element_free_list.
(init_emit): Use xcalloc, not xmalloc+bzero.
* fold-const.c (size_int_wide): Kill the cache, when GC'ing.
* function.c (pop_function_context_from): Use free to free the
fixup_var_refs_queue.
(put_reg_into_stack): Allocate it with xmalloc.
* genattrtab.c: Include ggc.h.
(operate_exp): Don't use obstack_free when GC'ing.
(simplify_cond): Likewise.
(simplify_text_exp): Likewise.
(optimize_attrs): Likewise.
* gengentrtl.c (gendef): Use ggc_alloc_rtx to allocate RTL, when
GC'ing.
(gencode): Generate a #include for ggc.h.
* ggc-callbacks.c (ggc_p): Define it to zero.
* ggc-none.c (ggc_p): Likewise.
* ggc-simple.c: Include varray.h.
(ggc_mark_tree_varray): New function.
(ggc_add_tree_varray_root): Likewise.
(ggc_mark_tree_varray_ptr): Likewise.
* ggc.h (ggc_p): Declare.
(varray_head_tag): Likewise.
(ggc_add_tree_varray_root): Declare.
* print-tree.c (print_node): Don't check for TREE_PERMANENT
inconsistencies when GC'ing.
* rtl.c: Include ggc.h.
(rtvec_alloc): Use ggc_alloc_rtvec when GC'ing.
(rtx_alloc): Use ggc_alloc_rtx when GC'ing.
(rtx_free): Don't call obstack_free when GC'ing.
* toplev.c (rest_of_compilation): Call ggc_collect after every
pass, if GC'ing.
* tree.c (push_obstacks): Do nothing, if GC'ing.
(pop_obstacks_nochange): Likewise.
(pop_obstacks): Likewise.
(make_node): Use ggc_alloc_tree when GC'ing.
(copy_node): Likewise.
(get_identifier): Use ggc_alloc_string when GC'ing.
(build_string): Likewise.
(make_tree_vec): Use ggc_alloc_tree when GC'ing.
(tree_cons): Likewise.
(build1): Likewise.
(type_hash_canon): Don't call obstack_free when GC'ing.
Co-Authored-By: Bernd Schmidt <bernds@cygnus.co.uk> Co-Authored-By: Mark Mitchell <mark@codesourcery.com>
From-SVN: r29125
* Makefile.in (stor-layout.o): Depend on ggc.h.
(expr.o): Depend on ggc.h.
(profile.o): Depend on ggc.h.
(stor-layout.o): Depend on ggc.h.
* emit-rtl.c (init_emit_once): Add gc roots.
* expr.c: Include ggc.h.
(emit_block_move): Add gc roots.
(clear_storage): Likewise.
* expr.h (init_stor_layout_once): New function.
* profile.c: Include ggc.h.
(init_arc_profiler): profiler_label is a root.
* scan.c (make_sstring_space): Trust xrealloc to function
correctly with first parameter NULL.
* stor-layout.c: Include ggc.h.
(set_sizetype): Add gc root.
(init_stor_layout_once): New function.
* toplev.c (compile_file): Call it.
Co-Authored-By: Bernd Schmidt <bernds@cygnus.co.uk> Co-Authored-By: Mark Mitchell <mark@codesourcery.com>
From-SVN: r29122
c-decl.c (struct language_function): Renamed from struct c_function.
* c-decl.c (struct language_function): Renamed from struct c_function.
Delete elt NEXT.
(c_function_chain): Delete.
(push_c_function_context): New arg F. Don't warn about nested
functions here. Fill LANGUAGE elt of F. Delete code to update
c_function_chain. Don't call push_function_context.
(pop_c_function_context): New arg F. Restore from there instead of
from c_function_chain. Don't call pop_function_context. Clear out
LANGUAGE field of F when done.
* c-lang.c: Include "function.h"
(lang_init): Initialize save_lang_status and restore_lang_status.
* c-parse.in (nested_function, nested_function_notype): Warn about
nested functions. Call push_function_context/pop_function_context
instead of the _c_ variants.
* c-tree.h (push_c_function_context, pop_c_function_context): Update
prototype.
* Makefile.in (c-lang.o): Update dependencies.
* emit-rtl.c (init_emit): Use xmalloc to allocate regno_reg_rtx,
regno_pointer_flag, regno_pointer_align.
(gen_reg_rtx): Use xrealloc to enlarge them.
(free_emit_status): New function.
* function.c (mark_machine_status, mark_lang_status): New variables.
(assign_stack_local_1): Renamed from assign_outer_stack_local. Merge
in some bits from assign_stack_local. All callers changed to use new
name.
(assign_stack_local): Just call assign_stack_local_1.
(free_after_compilation): New function.
(put_reg_into_stack): Simplify to always call assign_stack_local_1.
(trampoline_address): Likewise.
(assign_parms): Use xcalloc/xrealloc to allocate parm_reg_stack_loc.
(prepare_function_start): Explicitly clear some more variables.
* function.h (struct function): New elt can_garbage_collect.
(mark_machine_status, mark_lang_status): Declare variables.
(free_after_compilation, free_emit_status, free_varasm_status,
init_varasm_status): Declare functions.
* toplev.c (rest_of_compilation): Call free_after_compilation when
done with the current function.
* varasm.c (free_varasm_status): New function.
Michael Hayes [Sat, 4 Sep 1999 05:13:53 +0000 (05:13 +0000)]
c4x.md (rptb_init): Renamed from *rptb_init.
Sat Sep 4 16:56:28 1999 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* config/c4x/c4x.md (rptb_init): Renamed from *rptb_init.
(doloop_begin): Simplify pattern and use emit_jump_insn.
(doloop_end): Simplify pattern, switch operand order,
and use emit_jump_insn.
Mark Mitchell [Sat, 4 Sep 1999 02:19:29 +0000 (02:19 +0000)]
Makefile.in (CXX_TREE_H): Include function.h.
* Makefile.in (CXX_TREE_H): Include function.h.
(decl.o): Don't depend on function.h.
(decl2.o): Likewise.
(typeck.o): Likewise.
(init.o): Likewise.
(method.o): Likewise.
* cp-tree.h: Include function.h.
(cp_function): Rename to language_function. Remove next.
(cp_function_chain): Make it a macro, not a variable.
(push_cp_function_context): Don't declare.
(pop_cp_function_context): Likewise.
* decl.c: Don't include function.h.
(push_cp_function_context): Make it static. Make it suitable for
a save_lang_status callback.
(pop_cp_function_context): Likewise.
(maybe_push_to_top_level): Call push_function_context_to, not
push_cp_function_context.
(pop_from_top_level): Call pop_function_context_from, not
pop_cp_function_context.
(init_decl_processing): Set save_lang_status and
restore_lang_status. Call push_function_context_to, not
push_cp_function_context.
(cp_function_chain): Remove.
* decl2.c: Don't include function.h.
* except.c: Don't include function.h.
(start_anon_func): Call push_function_context_to, not
push_cp_function_context.
(end_anon_func): Call pop_function_context_from, not
pop_cp_function_context.
* init.c: Don't include function.h.
* lex.c (begin_definition_of_inclass_inline): Call
push_function_context_to, not push_cp_function_context.
(process_next_inline): Call pop_function_context_from, not
pop_cp_function_context.
* method.c: Don't include function.h.
(synthesize_method): Call push_function_context_to, not
push_cp_function_context. Call pop_function_context_from, not
pop_cp_function_context.
* typeck.c: Don't include function.h.
Michael Hayes [Fri, 3 Sep 1999 23:58:44 +0000 (23:58 +0000)]
c4x.c (c4x_emit_move_sequence): Do not force large constants into memory.
Sat Sep 4 11:37:15 1999 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* config/c4x/c4x.c (c4x_emit_move_sequence): Do not force large
constants into memory.
(c4x_shiftable_constant): New function.
* config/c4x/c4x.c (LEGITIMATE_CONSTANT_P): Allow any CONST_INT.
(c4x_shiftable_constant): Declare.
* config/c4x/c4x.md (loadqi_big_constant, loadhi_big_constant,
ashlqi3_noclobber): Add new patterns and associated splitters.
Andrew Haley [Fri, 3 Sep 1999 17:10:48 +0000 (17:10 +0000)]
m68kelf.h: Set USE_GAS...
Fri Sep 3 18:09:24 1999 Andrew Haley <aph@cygnus.com>
* config/m68k/m68kelf.h: Set USE_GAS; this makes gcc generate jbsr
(relative) rather than jsr (absolute) subroutine call insns.
* config/m68k/m68k-coff.h: Ditto.
arm.c (note_invalid_constants): No need to ignore ASMs, we can now rework these too.
* arm.c (note_invalid_constants): No need to ignore ASMs, we can
now rework these too.
(arm_reorg): If an insn can't reach the end of the current pool,
ensure that we emit that pool before the insn.
Jeffrey A Law [Thu, 2 Sep 1999 23:55:52 +0000 (23:55 +0000)]
powerset.h (SET_WORD, [...]): Do not redefine based on USE_CHAR.
* powerset.h (SET_WORD, SET_SHORT, SET_CHAR): Do not redefine based
on USE_CHAR.
(USE_CHAR): No longer define.
* eqps.c ffsetclrps.c flsetclrps.c: Remove !USE_CHARS support.
* genemit.c (gen_expand): Only emit `operands[N]' decl if there
is special code to run.
(main): Don't define operands to emit_operand.
* genrecog.c (main): Don't emit an empty peephole2_insn function.
Alex Samuel [Thu, 2 Sep 1999 17:29:11 +0000 (17:29 +0000)]
decl2.c (arg_assoc_template_arg): New prototype.
* decl2.c (arg_assoc_template_arg): New prototype. New function.
(arg_assoc_class): Use arg_assoc_template_arg for template
arguments.
(arg_assoc): Likewise.
* pt.c (mangle_class_name_for_template): Allow member template
template arguments.
c-parse.in (compstmt_primary_start): New, broken out of first part of compstmt handling in primary.
* c-parse.in (compstmt_primary_start): New, broken out of first
part of compstmt handling in primary.
(primary): Use it. Add an error clause.
(compstmt_nostart): Renamed from compstmt; remove all
initial invocations of compstmt_start.
(compstmt): New.