Commit Graph

196 Commits

Author SHA1 Message Date
Nick Clifton
4798472070 Move RTL checking code into make_insn_raw
From-SVN: r32010
2000-02-16 17:56:21 +00:00
Richard Henderson
69732dcb9c flow.c (flow_delete_insn, [...]): Export.
* flow.c (flow_delete_insn, make_edge, remove_edge): Export.
        * basic-block.h: Declare them.
        * emit-rtl.h (active_insn_p): New.
        (next_active_insn, prev_active_insn): Use it.
        * rtl.h: Declare it.
        * function.c (emit_return_into_block): New.
        (thread_prologue_and_epilogue_insns): Insert return insns instead
        of epilogues when possible.
        * jump.c (jump_optimize_1): Remove code to insert a return insn
        on the fallthru to the exit block.

From-SVN: r31826
2000-02-06 05:01:03 -08:00
Geoff Keating
d1b8177961 emit-rtl.c (unshare_all_rtl): Unshare virtual parameters too.
* emit-rtl.c (unshare_all_rtl): Unshare virtual parameters too.
Use unshare_all_rtl_1.
(unshare_all_rtl_again): New function.
(unshare_all_rtl_1): New function split out of unshare_all_rtl.

* function.c (purge_addressof_1): Use unshare_all_rtl_again
rather than resetting the 'used' flags ourself.

* toplev.c (rest_of_compilation): Add current_function_decl
to the unshare_all_rtl call.
* tree.h: Prototype unshare_all_rtl.
* rtl.h: Prototype unshare_all_rtl_again here.

From-SVN: r31651
2000-01-27 20:46:26 +00:00
Nick Clifton
78340c9f9f Only check machine class insns for improper emission of a RETURN
From-SVN: r31623
2000-01-26 01:23:26 +00:00
Richard Henderson
5495cc558b osf.h (TARGET_HAS_XFLOATING_LIBS): Define.
* alpha/osf.h (TARGET_HAS_XFLOATING_LIBS): Define.
        * alpha/osf5.h: New file.
        * configure.in (alpha-*-osf5): Add it to tm_file.

        * emit-rtl.c (operand_subword): Support TFmode on a 64-bit target.

        * alpha-protos.h (alpha_emit_xfloating_arith): Declare.
        (alpha_emit_xfloating_cvt, function_arg): Declare.
        * alpha.c (alpha_emit_conditional_branch): Call
        alpha_emit_xfloating_compare for TFmode compares.
        (alpha_lookup_xfloating_lib_func): New.
        (alpha_compute_xfloating_mode_arg): New.
        (alpha_emit_xfloating_libcall): New.
        (alpha_emit_xfloating_arith): New.
        (alpha_emit_xfloating_compare): New.
        (alpha_emit_xfloating_cvt): New.
        (print_operand): Add default abort case.
        (function_arg): Mind FUNCTION_ARG_PASS_BY_REFERENCE.
        * alpha.h (TARGET_HAS_XFLOATING_LIBS): New.
        (BIGGEST_ALIGNMENT): Increase to 128 bits.
        (RETURN_IN_MEMORY): True for TF/TCmode.
        (ALPHA_ARG_SIZE): TF/TCmode is passed indirect.
        (FUNCTION_ARG): Move to function_arg.
        (FUNCTION_ARG_PASS_BY_REFERENCE): New.
        (ASM_OUTPUT_LONG_DOUBLE): New.
        (ASM_OUTPUT_DOUBLE): Always output bits.
        * alpha.md (addtf3, divtf3, multf3, subtf3, cmptf): New.
        (fix_trunctfdi2, floatditf2, floatunsditf2): New.
        (extenddftf2, trunctfdf2): New.

From-SVN: r31579
2000-01-23 20:02:40 -08:00
Clinton Popetz
ba52f355e3 emit-rtl.c (try_split): Return last_insn if we split the last_insn.
* emit-rtl.c (try_split): Return last_insn if we split the
	last_insn.

From-SVN: r31530
2000-01-19 19:41:52 -05:00
Nick Clifton
06be917325 If RTL checking is enabled, make sure that emit_insn is not used to emit a
jump insn.

From-SVN: r31420
2000-01-14 20:51:04 +00:00
Kaveh R. Ghazi
711d877c9e eh-common.h: PROTO -> PARAMS.
* eh-common.h: PROTO -> PARAMS.
	* emit-rtl.c: Likewise.
	* errors.c: Likewise.
	* errors.h: Likewise.
	* except.c: Likewise.
	* except.h: Likewise.
	* explow.c: Likewise.
	* expmed.c: Likewise.
	* expr.c: Likewise.
	* expr.h: Likewise.
	* final.c: Likewise.
	* fix-header.c: Likewise.
	* flow.c: Likewise.
	* fold-const.c: Likewise.
	* function.c: Likewise.
	* function.h: Likewise.
	* gcc.c: Likewise.
	* gcov-io.h: Likewise.
	* gcov.c: Likewise.
	* gcse.c: Likewise.

From-SVN: r31419
2000-01-14 17:14:43 +00:00
Kaveh R. Ghazi
272df862c2 Makefile.in (toplev.o): Depend on loop.h.
* Makefile.in (toplev.o): Depend on loop.h.

	* dwarfout.c: Include tm_p.h.

	* emit-rtl.c (restore_emit_status): Mark parameter with
	ATTRIBUTE_UNUSED.

	* final.c (final_scan_insn): Likewise.

	* flow.c (flow_nodes_print, flow_exits_print, flow_loops_cfg_dump,
	flow_loop_nested_p, flow_loop_exits_find, flow_loop_nodes_find,
	flow_depth_first_order_compute, flow_loop_pre_header_find,
	flow_loop_tree_node_add, flow_loops_tree_build,
	flow_loop_level_compute, flow_loops_level_compute,
	flow_loop_outside_edge_p): Add prototypes.
	(recompute_reg_usage): Mark parameters with ATTRIBUTE_UNUSED.

	* ggc-callbacks.c (lang_mark_tree, lang_mark_false_label_stack):
	Mark with ATTRIBUTE_NORETURN.

	* hash.c (hash_newfunc): Mark parameter with ATTRIBUTE_UNUSED.

	* local-alloc.c (no_conflict_p): Likewise.

	* loop.c (insert_bct): Hide definitions of variables with hidden
	usage.
	(note_reg_stored): Mark parameter with ATTRIBUTE_UNUSED.

	* regclass.c (memory_move_secondary_cost): Mark variable `mem'
	with ATTRIBUTE_UNUSED.
	(record_reg_classes): Mark parameter with ATTRIBUTE_UNUSED.
	(reg_scan): Likewise.

	* reload.c (find_reloads): Remove unused variables `changed'.

	* reload1.c (reload_reg_class_lower): Don't unnecessarily cast
	away const-ness.
	(allocate_reload_reg): Mark parameter with ATTRIBUTE_UNUSED.
	Remove unused variable `insn'.

	* toplev.c: Include loop.h.
	(report_file_and_line): Remove unnecessary prototype.

	* tree.c (build_block): Mark parameter with ATTRIBUTE_UNUSED.

	* unroll.c (biv_total_increment): Likewise.

From-SVN: r31085
1999-12-24 14:04:54 +00:00
Bernd Schmidt
01d939e8fb current_function -> cfun
From-SVN: r31033
1999-12-20 13:18:17 +00:00
Kaveh R. Ghazi
4a71b24ff9 combine.c (record_promoted_value): Remove unused variable `links2'.
* combine.c (record_promoted_value): Remove unused variable
	`links2'.

	* emit-rtl.c (renumber_insns): Likewise for `old_max_uid'.

	* global.c (record_conflicts): Likewise for `j'.

	* genoutput.c (output_insn_data): Don't unnecessarily cast away
	const-ness.

From-SVN: r30870
1999-12-12 01:34:39 +00:00
Andrew Haley
ee265800a5 emit-rtl.c (gen_sequence): Only return the pattern of an insn if its code is INSN and it has no notes.
Fri Nov 12 14:08:40 1999  Andrew Haley  <aph@cygnus.com>

	* emit-rtl.c (gen_sequence): Only return the pattern of an insn if
	its code is INSN and it has no notes.

From-SVN: r30612
1999-11-22 14:53:20 +00:00
Mark Mitchell
673b5311a9 flags.h (flag_renumber_insns): Declare.
* flags.h (flag_renumber_insns): Declare.
	* emit-rtl.c (renumber_insns): Check flag_renumber_insns.  Print
	renumbering table.
	* rtl.h (renumber_insns): Change prototype.
	* toplev.c (flag_renumber_insns): Define.
	(rest_of_compilation): Pass rtl_dump_file to flag_renumber_insns.

From-SVN: r30388
1999-11-04 07:23:58 +00:00
Mark Mitchell
aeeeda0391 rtl.h (renumber_insns): New function.
* rtl.h (renumber_insns): New function.
	(remove_unnecessary_notes): Likewise.
	* emit-rtl.c (renumber_insns): Define.
	(remove_unncessary_notes): Likewise.
	* toplev.c (rest_of_compilation): Remove dead code.
	Use renumber_insns and remove_unncessary_notes.

From-SVN: r30385
1999-11-03 23:18:57 +00:00
Catherine Moore
8cd0faaf32 defaults.h (ASM_OUTPUT_ALTERNATE_LABEL_NAME): Provide default.
* defaults.h (ASM_OUTPUT_ALTERNATE_LABEL_NAME): Provide default.
        * emit-rtl.c (gen_label_rtx): Support LABEL_ALTERNATE_NAME.
        * final.c (final_scan_insn): Emit LABEL_ALTERNATE_NAME.
        * ggc-common.c (ggc_mark_rtx_children): Mark LABEL_ALTERNATE_NAME.
        * jump.c (delete_unreferenced_labels): Don't delete if
        LABEL_ALTERNATE_NAME is set.
        * print-rtl.c (print_rtx): Dump alternate name.
        * rtl.def (CODE_LABEL): Change format to "iuuis00s".
        * rtl.h (LABEL_ALTERNATE_NAME): Define.
        * rtl.texi (LABEL_ALTERNATE_NAME): Document.
        * tm.texi (ASM_OUTPUT_ALTERNATE_LABEL_NAME): Document.

From-SVN: r30382
1999-11-03 16:55:51 -05:00
Jan Hubicka
a05924f91b Reorg reg-stack to use the standard CFG.
Co-Authored-By: Richard Henderson <rth@cygnus.com>

From-SVN: r30201
1999-10-26 18:25:13 -07:00
Bernd Schmidt
e63db8f67d Bring copy_insn_1 and copy_rtx in sync and simplify them
From-SVN: r29902
1999-10-11 18:42:36 +00:00
Bernd Schmidt
4724334af7 Fix a warning in copy_insn_1
From-SVN: r29889
1999-10-10 12:06:33 +00:00
Bernd Schmidt
da43a810ca Add functions copy_insn/copy_insn_1; use them in jump.c
From-SVN: r29870
1999-10-08 17:39:10 +00:00
Alex Samuel
43fa63024d Fix PA problem in order of initializations.
* emit-rtl.c (init_emit_once): Initialize modes first.

        Also add missing ChangeLog entry.

From-SVN: r29635
1999-09-23 20:34:19 +00:00
Alexandre Oliva
a7e1e2acfd emit-rtl.c (init_emit_once): Initialize const_int_rtx before other initializations that may use it for...
* emit-rtl.c (init_emit_once): Initialize const_int_rtx before
other initializations that may use it for relative offsets.

From-SVN: r29535
1999-09-21 04:04:16 +00:00
Bernd Schmidt
6baf1cc8f8 Make it possible to prototype port-specific functions (and convert i386 to use this)
From-SVN: r29514
1999-09-20 10:00:03 +00:00
Alex Samuel
5da077de9b rtl.h (global_rtx_index): New enum.
* rtl.h (global_rtx_index): New enum.
        (global_rtl): Change to array of rtx.
        (pc_rtx, cc0_rtx): Redefine accordingly.
        (cc0_rtx, stack_pointer_rtx, frame_pointer_rtx): Likewise.
        (hard_frame_pointer_rtx, arg_pointer_rtx): Likewise.
        (virtual_incoming_args_rtx, virtual_stack_vars_rtx): Likewise.
        (virtual_outgoing_args_rtx, virtual_cfa): Likewise.
        (const_int_rtx): Change to array of rtx.
        (const0_rtx, const1_rtx, const2_rtx, constm1_rtx): Redefine
        accordingly.
        * emit-rtl.c (global_rtl): Change to array of rtx.
        (const_int_rtx): Change to aray of rtx.
        (gen_rtx_CONST_INT): Redefine accordingly.
        (init_emit_once): Allocate and initialize global_rtl.  Likewise
        for const_int_rtx.  Add both as GC roots.
        * genattrtab.c (global_rtl): Update declaration.

From-SVN: r29500
1999-09-18 11:16:44 -07:00
Richard Henderson
fa51b01b55 emit-rtl.c (free_emit_status): Don't check DECL_DEFER_OUTPUT.
* emit-rtl.c (free_emit_status): Don't check DECL_DEFER_OUTPUT.
        Free the struct.
        (mark_emit_status): Renamed from mark_emit_state.
        * except.c (mark_eh_status): Renamed from mark_eh_state.
        Check not null before marking.
        (free_eh_status): New.
        * expr.c (mark_expr_status, free_expr_status): New.
        * function.c (free_machine_status): New.
        (free_after_parsing): New.
        (free_after_compilation): Move bits to free_after_parsing; call
        free_eh_status, free_expr_status; zero the marked members of the
        function state.
        (prepare_function_start): No can_garbage_collect.
        Call init_eh_for_function.
        (expand_dummy_function_end): Free up current_function state.
        (mark_function_status): Renamed from mark_function_state.
        (mark_function_chain): No can_garbage_collect.  Call mark_expr_status.
        * function.h (struct function): No can_garbage_collect.
        (free_machine_status, free_after_parsing): Declare.
        (free_eh_status, free_expr_status): Declare.
        * ggc.h (mark_expr_status): Declare.
        * stmt.c (free_stmt_status): Free the struct.
        (mark_stmt_status): Renamed from mark_stmt_state.
        (init_stmt): Don't call init_eh.
        (init_stmt_for_function): Don't call init_eh_for_function.
        * toplev.c (compile_file): Call init_eh.
        (rest_of_compilation): Free basic block info before ggc_collect.
        Call free_after_parsing; conditionally call free_after_compilation.
        * varasm.c (mark_varasm_status): Renamed from mark_varasm_state.
        Check not null before marking.

From-SVN: r29448
1999-09-15 18:12:25 -07:00
Bernd Schmidt
bcb3399464 Undo bogus changes from gcc2 merge
From-SVN: r29407
1999-09-14 14:37:12 +00:00
Mark Mitchell
0a8a198ceb function.h (free_after_compilation): Remove decl parameter.
* function.h (free_after_compilation): Remove decl parameter.
	(free_varasm_status0: Likewise.
	(free_emit_status): Likewise.
	(free_stmt_status): Likewise.
	(free_after_compilation): Likewise.
	(init_lang_status): New variable.
	(free_lang_status): Likewise.
	* emit-rtl.c (free_emit_status): Make decl parameter implicit.
	* function.c (init_lang_status): New variable.
	(free_lang_status): Likewise.
	(push_function_context_to): Don't set function::decl here.
	(free_after_copmilation): Make decl parameter implicit.  Call
	free_lang_status if defined.
	(prepare_function_start): Call init_lang_status if defined.
	(init_function_start): Set function::decl here.
	* profile.c (output_func_start_profiler): Don't call pushdecl
	until we've actually started the function.
	* stmt.c (free_stmt_status): Make decl parameter implicit.
	* toplev.c (rest_of_compilation): Don't pass decl to
	free_after_compilation.
	* varasm.c (free_varasm_status): Likewise.

From-SVN: r29239
1999-09-09 18:55:37 +00:00
Mark Mitchell
21cd906efe 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.

From-SVN: r29170
1999-09-07 15:20:58 +00:00
Jeff Law
c5c7673583 Merge in gcc2-ss-010999
From-SVN: r29150
1999-09-06 23:49:18 -06:00
Richard Henderson
a3770a8130 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.
	* 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
1999-09-05 16:08:20 +00:00
Richard Henderson
d7db664650 Makefile.in (stor-layout.o): Depend on ggc.h.
* 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
1999-09-05 03:49:52 +00:00
Richard Henderson
87ff9c8e4b Makefile.in (tree.o): Depend on ggc.h.
* Makefile.in (tree.o): Depend on ggc.h.
	(varasm.o): Likewise.
	(function.o): Likewise.
	(stmt.o): Likewise.
	(except.o): Likewise.
	(optabs.o): Likewise.
	(emit-rtl.o): Likewise.
	* emit-rtl.c: Include ggc.h.
	(sequence_element_free_list): Remove, and all references.
	(mark_sequence): New functions.
	(mark_emit_state): New function.
	* except.c: Include ggc.h.
	(mark_eh_node, mark_eh_stack, mark_eh_queue): New functions.
	(mark_tree_label_node): New functions.
	(mark_eh_state): New function.
	* function.c: Include ggc.h.
	(mark_temp_slot, mark_function_chain): New functions.
	(mark_function_state): New function.
	(init_function_once): New function.
	* function.h (init_function_once): New function.
	* ggc-callbacks.c (lang_mark_false_label_stack): New function.
	* ggc.h (label_node): Declare.
	(eh_status, emit_status, stmt_status, varasm_status): Likewise.
	(lang_mark_false_label_stack): New function.
	(mark_temp_slot): Remove declaration.
	(mark_function_chain): Likewise.
	(mark_eh_state): Adjust prototype.
	(mark_stmt_state, mark_emit_state, mark_varasm_state, mark_optab):
	Likewise.
	* optabs.c: Include ggc.h.
	(mark_optab): New function.
	(init_optabs): Add gc roots.
	* stmt.c: Include ggc.h.
	(mark_cond_nesting, mark_loop_nesting): New functions.
	(mark_block_nesting, mark_case_nesting, mark_goto_fixup): Likewise.
	(mark_stmt_state): New function.
	* toplev.c (compile_file): Call init_function_once.
	* tree.c: Include ggc.h.
	(type_hash): Move declaration earlier in file.
	(TYPE_HASH_SIZE, type_hash_table): Likewise.
	(init_obstacks): Add gc roots.
	(mark_type_hash): New function.
	* varasm.c: Include ggc.h.
	(mark_pool_constant): New function.
	(mark_varasm_state): New function.

Co-Authored-By: Bernd Schmidt <bernds@cygnus.co.uk>
Co-Authored-By: Mark Mitchell <mark@codesourcery.com>

From-SVN: r29119
1999-09-05 02:41:35 +00:00
Bernd Schmidt
e2ecd91c7b 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.

From-SVN: r29117
1999-09-05 01:06:48 +00:00
Richard Henderson
0a25f1f5e2 Makefile.in (GGC, GGC_LIB): New.
* Makefile.in (GGC, GGC_LIB): New.
	(HOST_RTL): Include ggc-none.o.
	(ggc-simple.o): New target.
	(ggc-none.o): Likewise.
	* tree.h (tree_common): Add gc_mark.
	* rtl.h (struct rtx_def): Steal a bit from code to make gc_mark.
	(struct rtvec_def): Add gc_mark.
	* emit-rtl.c (global_rtl): Update static initializers to contain
	enough initializers.
	* ggc.h, ggc-none.c, ggc-simple.c: New files.
	* toplev.c (gc_time): New variable.
	(all_time): New variable.
	(compile_file): Print gc time.
	(print_time): Calculate percentage of the whole.

From-SVN: r29106
1999-09-04 18:25:41 +00:00
Richard Henderson
aea87e88e1 emit-rtl.c (init_emit_once): Don't use GET_MODE_WIDER_MODE to step through CC modes.
* emit-rtl.c (init_emit_once): Don't use GET_MODE_WIDER_MODE
        to step through CC modes.

From-SVN: r29041
1999-09-01 18:22:31 -07:00
Zack Weinberg
ef178af3a4 rtl.h (RTL_CHECK1, RTL_CHECK2): New macros which type- and bounds- check RTL accesses if --enable-checking.
1999-08-31 12:20 -0700 Zack Weinberg <zack@bitmover.com>

	* rtl.h (RTL_CHECK1, RTL_CHECK2): New macros which type- and
	bounds- check RTL accesses if --enable-checking.
	(RTVEC_ELT): Bounds check if --enable-checking.
	(XWINT, XINT, XSTR, XEXP, XVEC, XMODE, XBITMAP, XTREE,
	XBBDEF): Use RTL_CHECK1/RTL_CHECK2 as appropriate.
	(XVECEXP, XVECLEN): Define in terms of XVEC, RTVEC_ELT, and
	GET_NUM_ELEM.
	(X0WINT, X0INT, X0STR, X0EXP, X0VEC, X0MODE, X0BITMAP, X0TREE,
	X0BBDEF, X0ADVFLAGS):  New macros for accessing '0' slots of RTXes.

	(ADDR_DIFF_VEC_FLAGS): Use X0ADVFLAGS.
	(NOTE_SOURCE_FILE): Use X0STR.
	(NOTE_BLOCK_NUMBER, NOTE_EH_HANDLER, LABEL_NUSES,
	MEM_ALIAS_SET): Use X0INT.
	(NOTE_RANGE_INFO, NOTE_LIVE_INFO, NOTE_BASIC_BLOCK,
	JUMP_LABEL, LABEL_REFS, LABEL_NEXTREF, CONTAINING_INSN):
	Use X0EXP.
	* real.h (CONST_DOUBLE_CHAIN): Use X0EXP.
	* rtl.c (copy_rtx, copy_most_rtx): Copy '0' slots with X0WINT.
	(rtl_check_failed_bounds, rtl_check_failed_type1,
	rtl_check_failed_type2, rtvec_check_failed_bounds): New
	functions.
	(fancy_abort): Fix comment.

	* cse.c (canon_hash): Read CONST_DOUBLE data slots with XWINT.
	(cse_insn): Decrement LABEL_NUSES for jump target before
	deleting jump insn.
	* emit-rtl.c (gen_rtx_CONST_DOUBLE): Use X0EXP for slot 1.
	* final.c (alter_subreg): Compute regno before changing x to
	REG; set REGNO(x) after changing it.
	* flow.c (count_basic_blocks): Use XWINT to inspect EH_REGION
	notes containing CONST_INTs.
	(delete_eh_regions): Use NOTE_EH_HANDLER.
	* function.c (put_reg_into_stack): Make reg a MEM before
	initializing it.
	(fixup_var_refs_insns):  Save REG_NOTES (insn) in case we
	delete insn.
	(gen_mem_addressof): Make reg a MEM before initializing it.
	* integrate.c (copy_rtx_and_substitute): Copy '0' slots with
	X0WINT.
	* local-alloc.c (update_equiv_regs): Zap REG_NOTES before
	deleting an insn, not after.
	(block_alloc): Only look at PATTERN(insn) if we have to, and
	only if it's format class 'i'.
	* loop.c (check_dbra_loop): Check bl->biv->add_val is a
	CONST_INT before using its INTVAL.
	* print-rtl.c (print_rtx): Use X0STR.
	* regmove.c (fixup_match_1): Don't look at PATTERN of
	non-class-'i' insn chain elements.
	* reload.c (loc_mentioned_in_p): Take address of
	in->fld[1].rtx directly.
	* reload1.c (reload): Change reg to a MEM before initializing
	it.
	* varasm.c (mark_constant_pool): Skip CONST_DOUBLES, which
	have no names.
	* config/i386/i386.md (decrement_and_branch_if_zero): Fix typo.

From-SVN: r29008
1999-08-31 19:39:10 +00:00
Jeff Law
6f573a73b3 Fix thinko in last change.
From-SVN: r29002
1999-08-31 01:02:46 -06:00
Jeffrey A Law
835126657b emit-rtl.c (copy_rtx_if_shared): A MEM which references virtual_stack_vars_rtx or virtual_incoming_args_rtx can...
* emit-rtl.c (copy_rtx_if_shared): A MEM which references
        virtual_stack_vars_rtx or virtual_incoming_args_rtx can not
        be shared.

From-SVN: r29001
1999-08-31 00:28:16 -06:00
Bernd Schmidt
bf6bb899e1 Fix more problems from GC diffs
From-SVN: r28820
1999-08-24 12:05:09 +00:00
Kaveh R. Ghazi
6f7d635c0e rtl.h (rtx_format): Constify a char*.
* rtl.h (rtx_format): Constify a char*.

	* rtl.c (rtx_format): Likewise.
	(copy_rtx, copy_most_rtx, read_rtx): Likewise.
	(init_rtl): Use accessor macro, not `rtx_format'.

	* alias.c (rtx_equal_for_memref_p, find_symbolic_term): Constify a
	char*.

	* caller-save.c (mark_referenced_regs): Likewise.

	* combine.c (subst, make_compound_operation, known_cond,
	gen_rtx_combine, update_table_tick, get_last_value_validate,
	use_crosses_set_p, mark_used_regs_combine, move_deaths): Likewise.

	* cse.c (rtx_cost, mention_regs, canon_hash, exp_equiv_p,
	refers_to_p, canon_reg, fold_rtx, cse_process_notes,
	count_reg_usage): Likewise.

	* emit-rtl.c (gen_rtx, copy_rtx_if_shared, reset_used_flags):
	Likewise.

	* final.c (leaf_renumber_regs_insn): Likewise.

	* flow.c (mark_used_regs, find_use_as_address, dump_flow_info,
	dump_edge_info, count_reg_references): Likewise.

	* function.c (fixup_var_refs_1, walk_fixup_memory_subreg,
	fixup_stack_1, purge_addressof_1, instantiate_virtual_regs_1):
	Likewise.

	* gcse.c (oprs_unchanged_p, hash_expr_1, expr_equiv_p,
	oprs_not_set_p, expr_killed_p, compute_transp, find_used_regs,
	add_label_notes): Likewise.

	* genattrtab.c (attr_rtx, attr_copy_rtx, encode_units_mask,
	clear_struct_flag, count_sub_rtxs, count_alternatives,
	compares_alternatives_p, contained_in_p, walk_attr_value,
	write_expr_attr_cache): Likewise.

	* genconfig.c (walk_insn_part): Likewise.

	* genemit.c (max_operand_1, gen_exp): Likewise.

	* genextract.c (walk_rtx): Likewise.

	* genflags.c (num_operands): Likewise.

	* genoutput.c (scan_operands): Likewise.

	* genpeep.c (match_rtx): Likewise.

	* genrecog.c (add_to_sequence): Likewise.

	* haifa-sched.c (may_trap_exp, sched_analyze_2, attach_deaths):
	Likewise.

	* integrate.c (save_constants, copy_for_inline,
	copy_rtx_and_substitute, subst_constants, restore_constants):
	Likewise.

	* jump.c  (mark_jump_label, invert_exp, redirect_exp,
	rtx_renumbered_equal_p, rtx_equal_for_thread_p): Likewise.

	* local-alloc.c (contains_replace_regs, memref_referenced_p):
	Likewise.

	* loop.c (record_excess_regs, rtx_equal_for_loop_p,
	add_label_notes, replace_call_address, count_nonfixed_reads,
	invariant_p, find_single_use_in_loop, find_mem_givs,
	find_life_end, maybe_eliminate_biv_1, update_reg_last_use):
	Likewise.

	* print-rtl.c (reg_names, print_rtx): Likewise.

	* recog.c (validate_replace_rtx_1, find_single_use_1): Likewise.

	* reg-stack.c (stack_regs_mentioned_p, record_label_references,
	record_reg_life_pat, swap_rtx_condition, goto_block_pat,
	print_blocks): Likewise.

	* regclass.c (fix_register, record_address_regs,
	reg_scan_mark_refs): Likewise.

	* regmove.c (stable_but_for_p): Likewise.

	* reload.c (loc_mentioned_in_p, operands_match_p,
	find_reloads_toplevsubst_reg_equivs, find_reloads_address_1,
	copy_replacements, refers_to_regno_for_reload_p,
	refers_to_mem_for_reload_p, find_inc_amount, regno_clobbered_p,
	reload_when_needed_name, reg_class_names, debug_reload_to_stream):
	Likewise.

	* reload1.c (eliminate_regs, scan_paradoxical_subregs,
	delete_address_reloads_1, count_occurrences,
	reload_cse_mem_conflict_p, reload_combine_note_use,
	add_auto_inc_notes): Likewise.

	* resource.c (mark_referenced_resources, mark_set_resources):
	Likewise.

	* rtlanal.c (rtx_unstable_p, rtx_varies_p, rtx_addr_varies_p,
	reg_mentioned_p, regs_set_between_p, modified_between_p,
	modified_in_p, refers_to_regno_p, reg_overlap_mentioned_p,
	rtx_equal_p, volatile_insn_p, volatile_refs_p, side_effects_p,
	may_trap_p, inequality_comparisons_p, replace_rtx, replace_regs,
	jmp_uses_reg_or_mem, for_each_rtx, regno_use_in): Likewise.

	* sched.c (sched_analyze_2, attach_deaths): Likewise.

	* stupid.c (stupid_mark_refs): Likewise.

	* unroll.c (remap_split_bivs): Likewise.

	* varasm.c (mark_constants): Likewise.

	* a29k/a29k.c (uses_local_reg_p): Likewise.

	* alpha/alpha.c (summarize_insn): Likewise.

	* arm/arm.c (symbol_mentioned_p, label_mentioned_p,
	eliminate_lr2ip): Likewise.

	* arm/thumb.c (symbol_mentioned_p, label_mentioned_p): Likewise.

	* i386/i386.c (symbolic_reference_mentioned_p, copy_all_rtx,
	reg_mentioned_in_mem): Likewise.

	* ns32k/ns32k.c (global_symbolic_reference_mentioned_p,
	symbolic_reference_mentioned_p): Likewise.

	* romp/romp.c (unsigned_comparisons_p, hash_rtx): Likewise.

	* sh/sh.c (regs_used, mark_use): Likewise.

	* vax/vax.c (vax_rtx_cost): Likewise.

From-SVN: r28784
1999-08-20 23:05:25 +00:00
Zack Weinberg
8f985ec4c7 rtl.def (NOTE): Change format to "iuu0n".
1999-08-19 14:44 -0700  Zack Weinberg  <zack@bitmover.com>

	* rtl.def (NOTE): Change format to "iuu0n".
	(ADDR_DIFF_VEC): Change format to "eEee0".
	(ADDRESSOF): Change format to "eit".

	* rtl.h (rtvec): Make "elem" an array of rtx, not rtunion.
	(RTVEC_ELT): Change to match.
	(XVECEXP): Use XVEC and RTVEC_ELT.
	(INSN_UID, INSN_CODE, CODE_LABEL_NUMBER, NOTE_LINE_NUMBER,
	ADDRESSOF_REGNO, REGNO, SUBREG_WORD): Use XINT.
	(PREV_INSN, NEXT_INSN, PATTERN, REG_NOTES,
	CALL_INSN_FUNCTION_USAGE, SUBREG_REG, SET_SRC, SET_DEST,
	TRAP_CONDITION, TRAP_CODE): Use XEXP.
	(INTVAL): Use XWINT.
	(ADDRESSOF_DECL): Use XTREE.
	(SET_ADDRESSOF_DECL): Delete.
	(NOTE_DECL_NAME, NOTE_DECL_CODE, NOTE_DECL_RTL,
	NOTE_DECL_IDENTIFIER, NOTE_DECL_TYPE): Kill.  These have been
	ifdefed out since 2.6 at least.
	(gen_rtvec_vv): Delete prototype.

	* rtl.h (rtvec_alloc): rt->elem is now an array of rtx,
	not rtunion.
	(copy_most_rtx): Handle 't' format letter.
	* emit-rtl.c (gen_rtvec_v): rt_val->elem is an array of rtx.
	(gen_rtvec_vv): Delete function.  All callers changed to use
	gen_rtvec_v instead.
	* print-rtl.c (print_rtx): Move special casing of NOTEs to
	the '0' format letter.

	* function.c (gen_mem_addressof): Don't use
	SET_ADDRESSOF_DECL; provide `decl' to gen_rtx_ADDRESSOF
	instead.
	* integrate.c (copy_rtx_and_substitute): Likewise.
	Copy 't' slots with XTREE.
	(subst_constants): Treat 't' slots like '[swi]' slots.
	* cse.c (canon_hash, exp_equiv_p): Treat 't' slots like	'0' slots.
	* jump.c (rtx_equal_for_thread_p): Likewise.
	* rtlanal.c (rtx_equal_p): Likewise.
	* stmt.c (expand_end_case): gen_rtx_ADDR_DIFF_VEC now takes
	only four arguments.
	* gengenrtl.c (type_from_format): Provide correct types for
	'b' and 't' slots.


	* tree.h [ENABLE_CHECKING] (TREE_CHECK, TREE_CLASS_CHECK):
	If a recent gcc is in use (always in stage2 and beyond), use
	statement expressions, so we don't make a function call unless
	the check fails.  Evaluate arguments exactly once.
	(CHAIN_CHECK, DO_CHECK, DO_CHECK1, TREE_CHECK1,
	TREE_CLASS_CHECK1, TYPE_CHECK1, DECL_CHECK1, CST_CHECK1):
	Delete.
	(CST_OR_CONSTRUCTOR_CHECK, EXPR_CHECK): Redefine such that
	they evaluate their arguments exactly once, irrespective of
	the compiler in use.

	* tree.c [ENABLE_CHECKING]: Define whichever set of functions
	is used by the currently-enabled check macros.  This is:
	(tree_check_failed, tree_class_check_failed): For gcc.
	(tree_check, tree_class_check, cst_or_constructor_check,
	expr_check): For other compilers.

	* gencheck.c: Do not define any *_CHECK1 macros.

From-SVN: r28769
1999-08-19 22:33:38 +00:00
Richard Earnshaw
00995e782e emit-rtl.c (mark_reg_pointer): Don't increase the alignment of a register that is already known to be a pointer.
* emit-rtl.c (mark_reg_pointer): Don't increase the alignment of
        a register that is already known to be a pointer.

From-SVN: r28664
1999-08-11 01:47:51 -06:00
Bernd Schmidt
49ad7cfa7a Include function.h in most files.
Include function.h in most files.  Remove most of the global variables
duplicated in function.h.  Add accessor macros for them which access
current_function.  Delete INLINE_HEADER rtx and related code, replace
with code using struct function to store inlining related data.

From-SVN: r28626
1999-08-09 14:00:21 +00:00
Kaveh R. Ghazi
cbbfcb3b23 Warning fixes:
* builtins.c (expand_builtin_memcmp, expand_builtin_strcmp): Wrap
	prototypes in macro HAVE_cmpstrsi.

	* cpplib.c (cpp_get_token): Remove unused label `op3'.

	* emit-rtl.c (operand_subword): Remove unused variable
	`bits_per_word'.

	* rtl.c (shallow_copy_rtx): Remove unused variable `format_ptr'.

	* tree.c (chainon): Wrap variable `t2' in macro ENABLE_CHECKING.

From-SVN: r28514
1999-08-04 20:47:45 +00:00
Bernd Schmidt
3f1d071b7b Backport of GC branch patches part 2: kill stmt status saving.
From-SVN: r28374
1999-08-01 12:07:41 +00:00
Bernd Schmidt
b384405b34 Backport of GC branch patches part 1: kill eh status saving.
From-SVN: r28357
1999-07-31 12:46:53 +00:00
Richard Henderson
d3707adb79 builtins.c (expand_builtin_saveregs): Remove static, remove exp and ignore arguments, bail if no EXPAND_BUILTIN_SAVEREGS.
* builtins.c (expand_builtin_saveregs): Remove static, remove exp
        and ignore arguments, bail if no EXPAND_BUILTIN_SAVEREGS.
        (expand_builtin_next_arg): Accept ARGLIST not EXP.
        (stabilize_va_list): New function.
        (std_expand_builtin_va_start): New function.
        (expand_builtin_va_start): New function.
        (get_varargs_alias_set): New function.
        (std_expand_builtin_va_arg): New function.
        (expand_builtin_va_arg): New function.
        (expand_builtin_va_end): New function.
        (expand_builtin_va_copy): New function.
        (expand_builtin): Call them.
        * c-common.c (c_common_nodes_and_builtins): Build __builtin_va_list,
        __builtin_{varargs_start,stdarg_start,end,copy}.
        (build_va_arg): New function.
        * c-common.h (CTI_PTR_TYPE, ptr_type_node): Delete.
        (build_va_arg): Declare.
        * c-decl.c (ptr_type_node, va_list_type_node): New.
        * c-parse.gperf (__builtin_va_arg): New.
        * c-parse.in (VA_ARG): New token.
        (unary_expr): Recognize it.
        * expr.c (expand_expr): Expand VA_ARG_EXPR.
        * expr.h (std_expand_builtin_va_start): Declare.
        (std_expand_builtin_va_arg): Declare.
        (expand_builtin_va_arg): Declare.
        (get_varargs_alias_set): Declare.
        * tree.def (VA_ARG_EXPR): New.
        * tree.h (BUILT_IN_VARARGS_START): New.
        (BUILT_IN_STDARG_START, BUILT_IN_VA_END): New.
        (ptr_type_node, va_list_type_node): Declare.
        * tm.texi (EXPAND_BUILTIN_SAVEREGS): Kill unused ARGLIST argument.
        * m32r.h (EXPAND_BUILTIN_SAVEREGS): Likewise.
        * m88k.h, m88k.c: Likewise.
        * mn10300.h, mn10300.c: Likewise.
        * pa.h, pa.c: Likewise.
        * rs6000.h, rs6000.c: Likewise.
        * sh.h, sh.c: Likewise.
        * sparc.h, sparc.c: Likewise.

        * emit-rtl.c (operand_subword): Copy alias set.
        (change_address): Likewise.

From-SVN: r28243
1999-07-25 18:21:03 -07:00
Richard Henderson
7e4ce834b2 explow.c (trunc_int_for_mode): New function.
* explow.c (trunc_int_for_mode): New function.
        (plus_constant_wide): Use it.
        * combine.c (simplify_and_const_int): Likewise.
        (merge_outer_ops): Likewise.
        (simplify_shift_const): Likewise.
        * cse.c (simplify_unary_operation): Likewise.
        (simplify_binary_operation): Likewise.
        * emit-rtl.c (operand_subword): Likewise.
        * rtl.h: Declare it.

From-SVN: r28222
1999-07-22 18:21:31 -07:00
Jeffrey A Law
40c0c3cf73 emit-rtl.c (gen_realpart): Issue an error for cases GCC can not handle at this time instead of silently...
* emit-rtl.c (gen_realpart): Issue an error for cases GCC can not
        handle at this time instead of silently generating incorrect code.
        (gen_imagpart): Likewise.

From-SVN: r28105
1999-07-14 17:04:45 -06:00
Jakub Jelinek
8fc4af0f11 Jakub Jelinek <jj@ultra.linux.cz>
Jakub Jelinek  <jj@ultra.linux.cz>
        * real.c (ereal_from_double): Fix for 64-bit big endian hosts.
        * emit-rtl.c (gen_lowpart_common): Add case for hosts where double
        fits in HOST_WIDE_INT and one uses union to access a long constant
        as double.

From-SVN: r27675
1999-06-21 10:52:47 -07:00
Jeffrey A Law
227d6ce040 emit-rtl.c (operand_subword): Tighten checks for when it is safe to safe to extract a subword out of a REG.
* emit-rtl.c (operand_subword): Tighten checks for when it is safe
        to safe to extract a subword out of a REG.

From-SVN: r27564
1999-06-16 19:56:31 -06:00