Commit Graph

37 Commits

Author SHA1 Message Date
Alexandre Oliva 1d2215feb9 resource.c (mark_referenced_resources): Abort() before attempting to mark a pseudo register.
* resource.c (mark_referenced_resources): Abort() before
attempting to mark a pseudo register.
(mark_set_resources): Likewise.

From-SVN: r38581
2001-01-01 00:43:16 +00:00
Michael Hayes 1fb9c5cd12 resource.c (mark_set_resources): Use MARK_SRC_DEST for PRE_MODIFY and POST_MODIFY cases.
* resource.c (mark_set_resources): Use MARK_SRC_DEST for
	PRE_MODIFY and POST_MODIFY cases.

	* rtlanal.c (side_effects_p): Handle PRE_MODIFY and POST_MODIFY.

From-SVN: r38429
2000-12-21 22:15:22 +00:00
Mark Mitchell 1f8f4a0b31 Remove obstacks.
* Makefile.in (ggc-callbacks.o): Remove target.
	(flow.o): Depend on GGC_H.
	* alias.c (init_alias_analysis):
	Remove ggc_p conditionals.
	(end_alias_analysis): Likewise.
	* basic-block.h (init_flow): New function.
	(allocate_reg_life_data): Declare.
	* bb-reorder.c	(function_obstack): Replace with ...
	(flow_obstack): ... new variable.
	(fixup_reorder_chain): Use it.
	* c-decl.c (ggc_p): Remove.
	(caller-save.c): Don't call oballoc/obfree.
	* combine.c (struct
	undobuf): Remove storage.
	(try_combine): Don't call oballoc.
	(undo_all): Don't call obfree.
	* cse.c (insert): Use xmalloc, not
	oballoc.
	(cse_main): Adjust accordingly.
	* dwarf2out.c (save_rtx): Remove
	obstack code.
	(dwarf2out_init): Remove ggc_p conditionals.
	* emit-rtl.c (rtl_obstack): Remove.
	(gen_rtx_CONST_INT): Remove ggc_p conditionals.
	(make_insn_raw): Likewise.
	(emit_insn_before): Likewise.
	(emit_insn_after): Likewise.
	(emit_insn): Likewise.
	(gen_sequence): Likewise.
	(copy_insn_1): Remove handling of `b' RTL components.
	(init_emit_once): Remove ggc_p conditionals.
	* except.c (create_rethrow_ref): Don't fool with obstacks.
	(add_partial_entry): Likewise.
	(call_get_eh_context): Likewise.
	(begin_protect_partials): Likewise.
	(protect_with_terminate): Likewise.
	* explow.c
	(plus_constant_wide): Likewise.
	* expr.c (init_expr_once):
	Likewise.
	(emit_block_move): Likewise.
	(clear_storage): Likewise.
	(expand_expr): Likewise.
	* flow.c (function_obstack): Remove.
	(flow_obstack): New variable.
	(flow_firstobj): Likewise.
	(create_base_block): Use the flow_obstack.
	(split_block): Likewise.
	(split_edge): Likewise.
	(calculate_global_regs_live): Likewise.
	(allocate_bb_life_data): Make it static.  Likewiwse.
	(init_flow): New function.
	(size_int_type_wide): Remove ggc_p conditionals.
	* function.c
	(push_function_context_to): Don't call save_tree_status.
	(pop_function_context_from): Or restore_tree_status.
	(assign_stack_local_1): Don't call push_obstacks.
	(find_fixup_replacement): Use xmalloc.
	(fixup_var_refs_insns): Free the storage.
	(insns_for_mem_walk): Don't mess with obstacks.
	(instantiate_decls): Likewise.
	(trampoline_address): Likewise.
	(expand_function_end): Likewise.
	* function.h (sturct function):
	Remove obstack-related variables.
	(save_tree_status): Don't declare.
	(restore_tree_status): Likewise.
	* gcse.c (compute_can_copy):
	Don't call oballoc/obfree.
	* genattrtab.c (operate_exp): Remove
	ggc_p conditionals.
	(simplify_cond): Likewise.
	(simplify_test_exp): Don't mess with obstacks.
	(optimize_attrs): Likewise.
	* gengenrtl.c (gendef): Don't include
	ggc_p conditionals.
	* ggc-callbacks.c (ggc_p): Remove.
	* ggc-none.c (ggc_p): Remove.
	* ggc.h (ggc_p): Don't declare.
	* integrate.c (save_for_inline): Don't mess with obstacks.
	(integrate_decl_tree): Likewise.
	(output_inline_function): Likewise.
	* lists.c
	(init_EXPR_INSN_LIST_cache): Likewise.
	* loop.c (temp_obstack):
	Remove.
	(rtl_obstack): Likewise.
	(init_loop): Don't mess with obstacks.
	(reg_address_cost): Free BIVs and GIVs.
	(check_insns_for_bivs): Use xmalloc, not oballoc.
	(find_mem_givs): Likewise.
	(record_biv): Likewise.
	(general_induction_var): Likewise.
	(product_cheap_p): Likewse.
	* optabs.c (init_one_libfunc): Remove
	ggc_p conditional.
	* print-tree.c (debug_tree): Don't use
	oballoc/obfree.
	(print_node): Likewise.
	* profile.c (output_func_start_profiler):
	Remove call to temporary_allocation.
	* reload1.c
	(eliminate_regs_in_insn): Don't mess with obstacks.
	* resource.c
	(mark_target_live_regs): Use xmalloc.
	(free_resource_info): Free the memory.
	* rtl.c (rtl_obstack):
	Remove.
	(rtvec_alloc): Don't mess with obstacks.
	(rtx_alloc): Likewise.
	(rtx_free): Remove.
	(copy_rtx): Don't handle `b' cases.
	(read_rtx): Use a local rtl_obstack.
	* rtl.h (oballoc): Remove.
	(obfree): Likewise.
	(pop_obstacks): Likewise.
	(push_obstacks): Likewise.
	(allocate_bb_life_data): Likewise.
	(allocate_reg_life_data): Likewise.
	(rtx_free): Likewise.
	* sdbout.c (sdbout_queue_anonymous_type):
	Use tree_cons, not saveable_tree_cons.
	* simplify-rtx.c
	(cselib_init): Don't mess with obstacks.
	* stmt.c
	(mark_block_nesting): Mark the label_chain.
	(epxand_label): Use ggc_alloc, not oballoc.
	(clear_last_expr): Don't mess with obstacks.
	(expand_decl_cleanup): Likewise.
	(expand_dcc_cleanup): Likewise.
	(expand_dhc_cleanup): Likewise.
	(expand_anon_union_decl): Likewise.
	(add_case_node): Use xmalloc, not oballoc.
	(free_case_nodes): New function.
	(expand_end_case): Call it.
	* stor-layout.c (layout_type): Don't
	mess with obstacks.
	(layout_type): Likewise.
	* toplev.c (wrapup_global_declarations):
	Likewise.
	(compile_file): Remove ggc_p conditionals.
	(rest_of_compilation): Call init_flow.  Remove ggc_p conditionals.
	(decode_f_option): Remove ggc_p conditionals.
	* tree.c
	(function_maybepermanent_obstack): Remove.
	(maybepermanent_obstack): Likewise.
	(function_obstack): Likewise.
	(tmeporary_obstack): Likewise.
	(momentary_obstack): Likewise.
	(temp_decl_obstack): Likewise.
	(saveable_obstack): Likewise.
	(rtl_obstack): Likewise.
	(current_obstack): Likewise.
	(expression_obstack): Likewise.
	(struct obstack_stack): Likewise.
	(obstack_stack): Likewise.
	(obstack_stack_obstack): Likewise.
	(maybepermanent_firstobj): Likewise.
	(temporary_firstobj): Likewise.
	(momentary_firstobj): Likewise.
	(temp_decl_firstobj): Likewise.
	(momentary_function_firstobj): Likewise.
	(all_types_permanent): Likewise.
	(struct momentary_level): Likewise.
	(momentary_stack): Likewise.
	(init_obstacks): Remove initialization of removed obstacks.
	(save_tree_status): Remove.
	(restore_tree_status): Likewise.
	(temporary_allocation): Liekwise.
	(end_temporary_allocation): Liekwise.
	(resume_temporary_allocation): Likewise.
	(saveable_allocation): Likewise.
	(push_obstacks): Likewise.
	(push_obstacks_nochange): Likewise.
	(pop_obstacks): Likewise.
	(allocation_temporary_p): Likewise.
	(permanent_allocation): Likewise.
	(preserve_data): Likewise.
	(preserve_initializer): Likewise.
	(rtl_in_current_obstack): Likewise.
	(rtl_in_saveable_obstack): Likewise.
	(oballoc): Likewise.
	(obfree): Likewise.
	(savealloc): Likewise.
	(expralloc): Likewise.
	(print_obstack_name): Likewise.
	(debug_obstack): Likewise.
	(object_permanent_p): Likewise.
	(push_momentary): Likewise.
	(perserve_momentary): Likewise.
	(clear_momentary): Likewise.
	(pop_momentary): Likewise.
	(pop_momentary_nofree): Likewise.
	(suspend_momentary): Likewise.
	(resume_momentary): Likewise.
	(make_node): Don't set TREE_PERMANENT.
	(copy_node): Remove ggc_p conditionals.  Don't set TYPE_OBSTACK.
	Don't set TREE_PERMANENT.
	(get_identifier): Remove ggc_p conditionals.
	(build_string): Likewise.
	(make_tree_vec): Likewise.
	(build_decl_list): Remove.
	(build_expr_list): Likewise.
	(tree_cons): Remove ggc_p conditionals.
	(decl_tree_cons): Remove.
	(expr_tree_cons): Likewise.
	(perm_tree_cons): Likewise.
	(temp_tree_cons): Likewise.
	(saveable_tree_cons): Likewise.
	(build1): Remove ggc_p conditionals.
	(build_parse_node): Likewise.
	(build_type_attribute_variant): Don't mess with obstacks.
	(build_type_copy): Likewise.
	(type_hash_canon): Likewise.
	(build_pointer_type): Likewise.
	(build_reference_type): Likewise.
	(build_index_type): Likewise.
	(build_range_type): Likewise.
	(dump_tree_statistics): Don't print obstack information.
	* tree.h
	(struct tree_common): Remove permanent_flag.
	(TREE_PERMANENT): Remove.
	(TREE_SET_PERMANENT): Likewise.
	(TYPE_OBSTACK): Likewise.
	(struct tree_type): Remove obstack.
	(oballoc): Remove.
	(savealloc): Likewise.
	(build_decl_list): Likewise.
	(build_expr_list): Likewise.
	(perm_tree_cons): Likewise.
	(temp_tree_cons): Likewise.
	(saveable_tree_cons): Likewise.
	(decl_tree_cons): Likewise.
	(expr_tree_cons): Likewise.
	(suspend_momentary): Likewise.
	(allocation_temporary_p): Likewise.
	(resume_momentary): Likewise.
	(push_obstacks_nochange): Likewise.
	(permanent_allocation): Likewise.
	(push_momentary): Likewise.
	(clear_momentary): Likewise.
	(pop_momentary): Likewise.
	(end_temporary_allocation): Likewise.
	(pop_obstacks): Likewise.
	(push_obstacks): Likewise.
	(pop_momentary_nofree): LIkewise.
	(preserve_momentary): Likewise.
	(saveable_allocation): Likewise.
	(temporary_allocation): Likewise.
	(resume_temporary_allocation): Likewise.
	(perserve_initializer): Likewise.
	(debug_obstack): Likewise.
	(rtl_in_current_obstack): Likewise.
	(rtl_in_saveable_obstack): Likewise.
	(obfree): Likewise.
	* varasm.c (current_obstack): Remove.
	(saveable_obstack): Remove.
	(rtl_obstack): Remove.
	(immed_double_const): Don't mess with obstacks.
	(immed_real_cons): Likewise.
	(output_constant_def): Likewise.
	(init_varasm_status): Use xcalloc.
	(mark_pool_constant): Mark the pool constant itself.
	(free_varasm_status): Free memory.
	(decode_rtx_const): Call bzero directly, rather than expanding it
	inline.
	(record_rtx_const): Don't mess with obstacks.
	(force_const_mem): Likewise.
	* config/arm/arm.c (arm_encode_call_attribute): Remove ggc_p
	conditionals.
	(aof_pic_entry): Likewise.
	* config/ia64/ia64.c (ia64_encode_section_info): Likewise.
	* config/m32r/m32r.c (m32r_encode_section_info): Likewise.
	* config/pa/pa.c (saveable_obstack): Remove.
	(rtl_obstack): Likewise.
	(current_obstack): Likewise.
	(output_call): Don't mess with obstacks.
	(hppa_encode_label): Remove ggc_p conditionals.
	* config/romp/romp.c (get_symref): Don't mess with obstacks.
	* config/rs6000/rs6000.c (output_toc): Remove ggc_p conditional.
	(rs6000_encode_section_info): Likewise.
	* config/sh/sh.c (get_fpscr_rtx): Likewise.

From-SVN: r36856
2000-10-13 06:26:46 +00:00
Rodney Brown 2c3c49dec3 alias.c (mark_constant_function): Use INSN_P.
* alias.c (mark_constant_function): Use INSN_P.
	(init_alias_analysis): Likewise.
	* combine.c (combine_instructions): Use INSN_P.
	(can_combine_p): Likewise.
	(try_combine): Likewise.
	(distribute_notes): Likewise.
	(distribute_links): Likewise.
	* cse.c (cse_around_loop): Use INSN_P.
	(invalidate_skipped_block): Likewise.
	(cse_set_around_loop): Likewise.
	(cse_end_of_basic_block): Likewise.
	(delete_trivially_dead_insns): Likewise.
	* emit-rtl.c (unshare_all_rtl_again): Use INSN_P.
	(unshare_all_rtl_1): Likewise.
	(next_cc0_user): Likewise.
	(try_split make_insn_raw): Likewise.
	(remove_unnecessary_notes): Likewise.
	* final.c (shorten_branches): Use INSN_P.
	(leaf_renumber_regs): Likewise.
	(leaf_renumber_regs_insn): Likewise.
	* flow.c (find_label_refs): Use INSN_P.
	(verify_wide_reg): Likewise.
	(notice_stack_pointer_modification): Likewise.
	(count_or_remove_death_notes): Likewise.
	(verify_flow_info): Likewise.
	(clear_log_links): Likewise.
	* function.c (fixup_var_refs_insns): Use INSN_P.
	(compute_insns_for_mem): Likewise.
	* gcse.c (alloc_gcse_mem): Use INSN_P.
	(compute_sets): Likewise.
	(compute_hash_table): Likewise.
	(classic_gcse): Likewise.
	(cprop): Likewise.
	(insert_insn_end_bb): Likewise.
	(delete_null_pointer_checks_1): Likewise.
	* global.c (expand_preferences): Use INSN_P.
	(build_insn_chain): Likewise.
	* graph.c (node_data): Use INSN_P.
	* haifa-sched.c (priority): Use INSN_P.
	(rm_line_notes): Likewise.
	(rm_other_notes): Likewise.
	(find_insn_reg_weight): Likewise.
	(init_target_units): Likewise.
	(schedule_block): Likewise.
	(compute_block_forward_dependences): Likewise.
	(debug_dependencies): Likewise.
	(set_priorities): Likewise.
	* integrate.c (function_cannot_inline_p): Use INSN_P.
	(save_parm_insns): Likewise.
	(copy_insn_list): Likewise.
	* jump.c (mark_all_labels): Use INSN_P.
	(never_reached_warning): Likewise.
	* lcm.c (optimize_mode_switching): Use INSN_P.
	* local-alloc.c (validate_equiv_mem): Use INSN_P.
	(memref_used_between_p): Likewise.
	(update_equiv_regs): Likewise.
	(block_alloc): Likewise.
	(no_conflict_p): Likewise.
	* loop.c (scan_loop): Use INSN_P.
	(find_and_verify_loops): Likewise.
	(count_loop_regs_set): Likewise.
	(loop_reg_used_before_p): Likewise.
	(strength_reduce): Likewise.
	(recombine_givs): Likewise.
	(check_dbra_loop): Likewise.
	(load_mems): Likewise.
	(try_copy_prop): Likewise.
	* print-rtl.c (print_rtx): Use INSN_P.
	* recog.c (find_single_use): Use INSN_P.
	* reg-stack.c (stack_regs_mentioned): Use INSN_P.
	(next_flags_user): Likewise.
	(swap_rtx_condition): Likewise.
	* regmove.c (mark_flags_life_zones): Use INSN_P.
	(optimize_reg_copy_1): Likewise.
	(optimize_reg_copy_2): Likewise.
	(optimize_reg_copy_3): Likewise.
	(reg_is_remote_constant_p): Likewise.
	(fixup_match_2): Likewise.
	(regmove_optimize): Likewise.
	(fixup_match_1): Likewise.
	* regrename.c (build_def_use): Use INSN_P.
	(replace_reg_in_block): Likewise.
	(consider_use): Likewise.
	* reload.c (find_equiv_reg): Use INSN_P.
	* reload1.c (reload): Use INSN_P.
	(maybe_fix_stack_asms): Likewise.
	(calculate_needs_all_insns): Likewise.
	(reload_as_needed): Likewise.
	(emit_output_reload_insns): Likewise.
	(delete_address_reloads_1): Likewise.
	(reload_cse_regs_1): Likewise.
	(reload_combine): Likewise.
	(reload_cse_move2add): Likewise.
	* reorg.c (redundant_insn): Use INSN_P.
	(dbr_schedule): Likewise.
	* resource.c (find_dead_or_set_registers): Use INSN_P.
	(mark_target_live_regs): Likewise.
	* rtlanal.c (reg_used_between_p): Use INSN_P.
	(reg_referenced_between_p): Likewise.
	(reg_set_between_p): Likewise.
	(reg_set_p): Likewise.
	(single_set): Likewise.
	(multiple_sets): Likewise.
	(find_last_value): Likewise.
	(reg_set_last): Likewise.
	(find_reg_note): Likewise.
	(find_regno_note): Likewise.
	* sibcall.c (sequence_uses_addressof): Use INSN_P.
	* simplify-rtx.c (cselib_process_insn): Use INSN_P.
	* ssa.c (find_evaluations): Use INSN_P.
	(rename_block): Likewise.
	(rename_equivalent_regs): Likewise.
	* unroll.c (loop_find_equiv_value): Use INSN_P.
	(set_dominates_use): Likewise.
	* varasm.c (mark_constant_pool): Use INSN_P.
	(mark_constants): Likewise.
	* config/alpha/alpha.c (alpha_does_function_need_gp): Use INSN_P.
	(alphaev4_next_group): Likewise.
	(alphaev5_next_group): Likewise.
	* config/c4x/c4x.c (c4x_process_after_reload): Use INSN_P.
	(c4x_rptb_rpts_p): Likewise.
	* config/mips/mips.c (mips16_optimize_gp): Use INSN_P.
	* config/rs6000/rs6000.c (uses_TOC): Use INSN_P.
	(rs6000_adjust_priority): Likewise.
	* config/sh/sh.c (sh_loop_align): Use INSN_P.
	(machine_dependent_reorg): Likewise.
	(split_branches): Likewise.
	* config/tahoe/tahoe.c (tahoe_cmp_check): Use INSN_P.

From-SVN: r35494
2000-08-04 14:28:08 -06:00
Richard Henderson 4b983fdc50 cse.c (canon_hash): Handle PRE_MODIFY/POST_MODIFY.
* cse.c (canon_hash): Handle PRE_MODIFY/POST_MODIFY.
	(cse_insn): Likewise.
	(addr_affects_sp_p): Likewise.
	* expr.c (move_by_pieces): Likewise.
	(clear_by_pieces): Likewise.
	* gcse.c (oprs_unchanged_p): Likewise.
	* haifa-sched.c (sched_analyze_2): Likewise.
	* recog.c (offsettable_address_p): Likewise.
	* regclass.c (record_address_regs): Likewise.
	* reload.c (find_reusable_reload): Likewise.
	(push_reload): Likewise.
	(operands_match_p): Likewise.
	(decompose): Likewise.
	(find_reloads_address_1): Likewise.
	(find_inc_amount): Likewise.
	* reload1.c (elimination_effects): Likewise.
	* resource.c (mark_set_resources): Likewise.
	* flow.c (attempt_auto_inc): New function; mostly broken out
	of find_auto_inc.
	(find_auto_inc): Split into two functions and enhanced to
	generate POST_MODIFY.
	* rtl.def (PRE_MODIFY, POST_MODIFY): Adjust comment.
	* rtl.h (count_all_occurrences):  Declare.
	(HAVE_{PRE,POST}_MODIFY_{DISP,REG}): Provide default of 0 if not
	defined.
	* rtlanal.c (count_all_occurrences): New function.
	* tm.texi (HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_DISP,
	HAVE_POST_MODIFY_REG, HAVE_PRE_MODIFY_REG): Document.

	* config/ia64/ia64-protos.h (destination_operand): Declare.
	* config/ia64/ia64.c (destination_operand): New function.
	(ia64_print_operand): Handle POST_MODIFY.
	(rtx_needs_barrier): Likewise.
	* config/ia64/ia64.h (HAVE_POST_MODIFY_DISP): Define to 1.
	(HAVE_POST_MODIFY_REG): Define to 1.
	(MAX_REGS_PER_ADDRESS): Change to 2.
	(GO_IF_LEGITIMATE_ADDRESS): Accept POST_MODIFY too.
	(LEGITIMATE_ADDRESS_REG): New helper macro.
	(LEGITIMATE_ADDRESS_DISP): Likewise.
	(PREDICATE_CODES): Add entry for destination_operand.
	* config/ia64/ia64.md (all mov patterns): Use destination_operand
	predicate for operand 0.

From-SVN: r35321
2000-07-28 10:46:18 -07:00
Richard Henderson d80eb1e167 Makefile.in (resource.o): Depend on except.h.
* Makefile.in (resource.o): Depend on except.h.
        * except.h (output_exception_table_data): Prototype.
        * genconfig.c (gen_peephole2): Prototype.
        * genemit.c (main): Include ggc.h.
        * genoutput.c: Revert parts of last change: include errors.h
        (main): Set progname.
        * recog.c: Include hard-reg-set.h before recog.h.
        * resource.c: Include except.h.

From-SVN: r34219
2000-05-27 19:17:59 -07:00
Richard Henderson 2328013936 Makefile.in (recog.o): Don't depend on resource.h.
* Makefile.in (recog.o): Don't depend on resource.h.
	* recog.c: Don't include resource.h.
	(recog_last_allowed_insn): Remove.
	(recog_next_insn): Remove.
	(struct peep2_insn_data): New.
	(peep2_insn_data, peep2_current): New.
	(peep2_next_insn): New.
	(peep2_regno_dead_p, peep2_reg_dead_p): New.
	(peep2_find_free_register): New.
	(peephole2_optimize): Track life information by insn as we go.
	* recog.h: Update declarations.
	* resource.c (find_free_register, reg_dead_p): Remove.
	* resource.h: Remove their declarations.
	* toplev.c: Include hard-reg-set.h before recog.h.

	* genconfig.c (max_insns_per_peep2): New.
	(gen_peephole2): New.
	(main): Call it.
	* genemit.c (output_peephole2_scratches): Generate calls to
	peep2_find_free_register; adjust surrounding code.
	(main): Have insn-emit.c include hard-reg-set.h before recog.h.
	* genrecog.c (change_state): Don't track last_insn.
	(write_action): Write into *_pmatch_len before accepting.
	(write_tree): Adjust peephole2_insns and subroutines to match.

	* config/i386/i386.md (all peepholes): Use peep2_regno_dead_p.

From-SVN: r34208
2000-05-27 13:23:15 -07:00
Mark Mitchell 0519ce3019 except.h (can_throw): Declare it.
* except.h (can_throw): Declare it.
	* except.c (can_throw): Give it external linkage.
	* resource.c (find_dead_or_set_registers): Use can_throw.

From-SVN: r34178
2000-05-25 23:43:43 +00:00
Jan Hubicka 7f1c097d36 combine.c (try_combine): Use any_condjump_p...
* combine.c (try_combine): Use any_condjump_p, any_uncondjump_p
        and pc_set at the place of simplejump_p and condjump_p.
        * cse.c (record_jump_equiv): Likewise.
        * emit-rtl.c (emit): Likewise.
        * explow.c (find_next_ref): Likewise.
        * flow.c (tidy_fallthru_edge): Likewise.
        (init_propagate_block_info): Likewise.
        * gcse.c (delete_null_pointer_checks): Likewise.
        * ifcvt.c (cond_exec_get_condition, noce_get_condition,
        dead_or_predicable): Likewise.
        * integrate.c (copy_insn_list): Likewise.
        * loop.c (scan_loop, verify_dominator, find_and_verify_loops,
        for_each_insn_in_loop, check_dbra_loop, get_condition,
        insert_bct, load_mems): Likewise.
        * resource.c (find_dead_or_set_registers): Likewise.
        * sibcalls.c (simplejump_p): Likewise.
        * unroll.c (copy_loop_body, reg_dead_after_loop): Likewise.

From-SVN: r34175
2000-05-25 14:38:49 -07:00
Stan Cox 73780b74b3 resource.h (mark_resource_type): New.
* resource.h (mark_resource_type): New.
	* resource.c (find_dead_or_set_registers, mark_target_live_regs,
	find_free_register): Use mark_resource_type.
	(mark_set_resources): Change include_delayed_effects
	to mark_resource_type.
	* reorg.c (steal_delay_list_from_target, try_merge_delay_insns,
	redundant_insn, fill_simple_delay_slots, fill_slots_from_thread):
	Use mark_resource_type.

From-SVN: r32771
2000-03-27 21:50:15 +00:00
Richard Kenner 770ae6cc71 * Rework fields used to describe positions of bitfields and
modify sizes to be unsigned and use HOST_WIDE_INT.
	* alias.c (reg_known_value_size): Now unsigned.
	* c-typeck.c (build_unary_op, case ADDR_EXPR): Use byte_position.
	(really_start_incremental_init): Use bitsize_zero_node.
	(push_init_level, pop_init_level, output_init_element): Likewise.
	Use bitsize_unit_node and bitsize_one_node.
	(output_pending_init_elements, process_init_element): Likewise.
	* combine.c (combine_max_regno, reg_sign_bit_copies): Now unsigned.
	(make_extraction): Position and length HOST_WIDE_INT and unsigned
	HOST_WIDE_INT, respectively.
	(get_pos_from_mask): Passed in value is unsigned HOST_WIDE_INT.
	(num_sign_bit_copies): Returns unsigned.
	BITWIDTH now unsigned; rework arithmetic.
	Remove recursive call from arg to MAX.
	(combine_instructions, init_reg_last_arrays): NREGS now unsigned.
	(setup_incoming_promotions, can_combine_p, try_combine, simplify_set):
	REGNO now unsigned.
	(set_nonzero_bit_and_sign_copies): NUM now unsigned.
	(find_split_point, expand_compound_operation, make_extraction): LEN
	now unsigned HOST_WIDE_INT, POS now HOST_WIDE_INT.
	(make_field_assignment): Likewise.
	(combine_simplify_rtx): Add cast.
	(expand_compound_operation): MODEWIDTH now unsigned; rework arithmetic.
	(force_to_mode): WIDTH now unsigned; add cast.
	(if_then_else_cond): SIZE now unsigned.
	(nonzero_bits): MODE_WIDTH, RESULT_WIDTH, and WIDTH now unsigned.
	(extended_count): Now returns unsigned.
	(simplify_shift_const): COUNT unsigned; arg is now INPUT_COUNT.
	Add SIGNED_COUNT variable; MODE_WORDS and FIRST_COUNT now unsigned.
	(simplify_comparison): MODE_WIDTH now unsigned.
	(update_table_tick): REGNO and ENDREGNO now unsigned; new var R.
	(mark_used_regs_combine): Likewise; rework arithmetic.
	(record_value_for_reg): REGNO, ENDREGNO, and I now unsigned.
	(record_dead_and_set_regs, reg_dead_at_p, distribute_notes): Likewise.
	(record_promoted_value): REGNO now unsigned.
	(get_last_value_validate): REGNO, ENDREGNO, and J now unsigned.
	(get_last_value): REGNO now unsigned.
	(use_crosses_set_p): REGNO and ENDREGNO now unsigned.
	(reg_dead_regno, reg_dead_endregno): Now unsigned.
	(remove_death): Arg REGNO now unsigned.
	(move_deaths):  REGNO, DEADREGNO, DEADEND, OUREND, and I now unsigned.
	(reg_bitfield_target_p): REGNO, REGNO, ENDREGNO, and ENDTREGNO
	now unsigned.
	* convert.c (convert_to_integer): INPREC and OUTPREC now unsigned.
	* cse.c (struct qty_table_elem): FIRST_REG and LAST_REG now unsigned.
	(struct cse_reg_info): REGNO now unsigned.
	(cached_regno): Now unsigned.
	(REGNO_QTY_VALID_P): Add cast.
	(make_new_qty, make_regs_eqv, delete_reg_eqiv): Regno args unsigned.
	(remove_invalid_regs): Likewise.
	(remove_invalid_subreg_refs): Likewise; arg WORD also unsigned
	as are variables END and I.
	(get_cse_reg_info, insert): Likewise.
	(mention_regs, invalidate_for_call): REGNO, ENDREGNO, and I unsigned.
	(canon_hash): Likewise.
	(insert_regs, lookup_for_remove): REGNO now unsigned.
	(invalidate): REGNO, ENDREGNO, TREGNO, and TENDREGNO now unsigned.
	New variable RN.
	* dbxout.c (dbxout_parms, dbxout_reg_parms): Don't check for REGNO < 0.
	* dwarf2out.c (dwarf2ou_frame_debug_expr): Remove cast.
	* emit-rtl.c (subreg_realpart_p): Add cast.
	(operand_subword): Arg I is now unsigned as is var PARTWORDS.
	(operand_subword_force): Arg I is now unsigned.
	* except.c (eh_regs): Variable I is now unsigned.
	* explow.c (hard_function_value): BYTES is unsigned HOST_WIDE_INT.
	* expmed.c (store_fixed_bit_field): Position is HOST_WIDE_INT;
	length is unsigned HOST_WIDE_INT; likewise for internal variables.
	(store_split_bit_field, extract_fixed_bit_field): Likewise.
	(extract_split_bit_field, store_bit_field, extract_bit_field):
	Likewise.
	* expr.c (store_constructor_fields, store_constructor, store_field):
	Positions are HOST_WIDE_INT and lengths are unsigned HOST_WIDE_INT.
	(expand_assignment, expand_expr, expand_expr_unaligned): Likewise.
	(do_jump): Likewise.
	(move_by_pieces, move_by_pieces_ninsns, clear_by_pieces):
	MAX_SIZE is now unsigned.
	(emit_group_load): BYTEPOS is HOST_WIDE_INT; BYTELEN is unsigned.
	(emit_group_store): Likewise.
	(emit_move_insn): I now unsigned.
	(store_constructor): Use host_integerp, tree_low_cst, and
	bitsize_unit_node.
	(get_inner_reference): Return bitpos and bitsize as HOST_WIDE_INT.
	Rework all calculations to use trees and new fields.
	* expr.h (promoted_input_arg): Regno now unsigned.
	(store_bit_field, extract_bit_field): Adjust types of pos and size.
	(mark_seen_cases): Arg is HOST_WIDE_INT.
	* flow.c (verify_wide_reg_1): REGNO now unsigned.
	* fold-const.c (decode_field_reference): Size and pos HOST_WIDE_INT;
	precisions and alignments are unsigned.
	(optimize_bit_field_compare, fold_truthop): Likewise.
	(int_const_binop): Adjust threshold for size_int_type_wide call.
	(fold_convert): Likewise.
	(size_int_type_wide): Make table larger and fix thinko that only
	had half of table used.
	(all_ones_mask_p, fold): Precisions are unsigned.
	* function.c (put_reg_info_stack): REGNO is unsigned.
	(instantiate_decl): Size is HOST_WIDE_INT.
	(instantiate_virtual_regs): I is unsigned.
	(assign_parms): REGNO, REGNOI, and REGNOR are unsigned.
	(promoted_input_arg): REGNO is unsigned.
	* function.h (struct function): x_max_parm_reg is now unsigned.
	* gcse.c (max_gcse_regno): Now unsigned.
	(struct null_pointer_info): min_reg and max_reg now unsigned.
	(lookup_set, next_set): REGNO arg now unsigned.
	(compute_hash_table): REGNO and I now unsigned.
	(handle_avail_expr): regnum_for_replacing now unsigned.
	(cprop_insn): REGNO now unsigned.
	(delete_null_pointer_checks_1): BLOCK_REG now pointer to unsigned.
	* ggc-common.c (ggc_mark_tree_children, case FIELD_DECL): New case.
	* global.c (set_preference): SRC_REGNO, DEST_REGNO, and I now unsigned.
	* hard-reg-set.h (reg_class_size): Now unsigned.
	* integrate.c (mark_stores): LAST_REG and I now unsigned; new UREGNO.
	* jump.c (mark_modified_reg): I now unsigned; add cast.
	(rtx_equal_for_thread_p): Add cast.
	* loop.c (max_reg_before_loop): Now unsigned.
	(struct_movable): REGNO now unsigned.
	(try_copy_prop): REGNO arg unsigned.
	(regs_match_p): XN and YN now unsigned.
	(consec_sets_invariant_p, maybe_eliminate_biv): REGNO now unsigned.
	(strength_reduce): Likewise; NREGS also unsigned.
	(first_increment_giv, last_increment_giv unsigned): Now unsigned.
	* loop.h (struct iv_class): REGNO now unsigned.
	(max_reg_before_loop, first_increment_giv, last_increment_giv):
	Now unsigned.
	* machmode.h (mode_size, mode_unit_size): Now unsigned.
	(mode_for_size, smallest_mode_for_size): Pass size as unsigned.
	* optabs.c (expand_binop): I and NWORDS now unsigned.
	(expand_unop): I now unsigned.
	* print-tree.c (print_node): Don't print DECL_FIELD_BITPOS, but do
	print DECL_FIELD_OFFSET and DECL_FIELD_BIT_OFFSET.
	* real.c (significand_size): Now returns unsigned.
	* real.h (significand_size): Likewise.
	* regclass.c (reg_class_size): Now unsigned.
	(choose_hard_reg_mode): Both operands now unsigned.
	(record_reg_classes): REGNO and NR now unsigned.
	(reg_scan): NREGS now unsigned.
	(reg_scan_update): old_max_regno now unsigned.
	(reg_scan_mark_refs): Arg MIN_REGNO and var REGNO now unsigned.
	* reload.c (find_valid_class): BEST_SIZE now unsigned.
	(find_dummy_reload): REGNO, NWORDS, and	I now unsigned.
	(hard_reg_set_here_p): Args BEG_REGNO and END_REGNO now unsigned.
	Likewise for variable R.
	(refers_to_regno_for_reload_p): Args REGNO and END_REGNO now unsigned,
	as are variables INNER_REGNO and INNER_ENDREGNO; add new variable R.
	(find_equiv_reg): Add casts.
	(regno_clobbered_p): Arg REGNO now unsigned.
	* reload.h (struct reload): NREGS now unsigned.
	(refers_to_regno_for_reload_p): Regno args are unsigned.
	(regno_clobbered_p): Likewise.
	* reload1.c (reg_max_ref_width, spill_stack_slot_width): Now unsigned.
	(compute_use_by_pseudos): REGNO now unsigned.
	(find_reg): I and J now unsigned, new variable K, and change loop
	variables accordingly; THIS_NREGS now unsigned.
	(alter_reg): INHERENT_SIZE and TOTAL_SIZE now unsigned.
	(spill_hard_reg): REGNO arg now unsigned; add casts.
	(forget_old_reloads_1): REGNO, NR, and I now unsigned.
	(mark_reload_reg_in_use): Arg REGNO and vars NREGS and I now unsigned.
	(clear_reload_reg_in_use): Arg REGNO and vars NREGS, START_REGNO,
	END_REGNO, CONFLICT_START, and CONFLICT_END now unsigned.
	(reload_reg_free_p, reload_reg_reaches_end_p): Arg REGNO now unsigned.
	(choose_reload_regs): MAX_GROUP_SIZE now unsigned.
	(emit_reload_insns): REGNO now unsigned.
	(reload_cse_move2add): Add cast.
	(move2add_note_store): REGNO and I now unsigned; new variable ENDREGNO
	and rework loop.
	* resource.c (mark_referenced_resources, mark_set_resources): New
	variable R; REGNO and LAST_REGNO now unsigned.
	(mark_target_live_regs): J and REGNO now unsigned.
	* rtl.c (mode_size, mode_unit_size): Now unsigned.
	* rtl.h (union rtunion_def): New field rtuint.
	(XCUINT): New macro.
	(ADDRESSOF_REGNO, REGNO, SUBREG_WORD): New XCUINT.
	(operand_subword, operand_subword_force): Word number is unsigned.
	(choose_hard_reg_mode): Operands are unsigned.
	(refers_to-regno_p, dead_or_set_regno_p): Regno arg is unsigned.
	(find_regno_note, find_regno_fusage, replace_regs): Likewise.
	(regno_use_in, combine_instructions, remove_death): Likewise.
	(reg_scan, reg_scan_update): Likewise.
	(extended_count): Return is unsigned.
	* rtlanal.c (refers_to_regno_p): Args REGNO and ENDREGNO and vars I,
	INNER_REGNO, and INNER_ENDREGNO now unsigned; new variable X_REGNO.
	(reg_overlap_mentioned_p): REGNO and ENDREGNO now unsigned.
	(reg_set_last_first_regno, reg_set_last_last_regno): Now unsigned.
	(reg_reg_last_1): FIRS and LAST now unsigned.
	(dead_or_set_p): REGNO, LAST_REGNO, and I now unsigned.
	(dead_or_set_regno_p): Arg TEST_REGNO and vars REGNO and ENDREGNO
	now unsigned.
	(find_regno_note, regno_use_in): Arg REGNO now unsigned.
	(find_regno_fusage): Likewise; also var REGNOTE now unsigned.
	(find_reg_fusage): Variables REGNO, END_REGNO, and I now unsigned.
	(replace_regs): Arg NREGS now unsigned.
	* sdbout.c (sdbout_parms, sdbout_reg_parms): Don't check REGNO < 0.
	* simplify-rtx.c (simplify_unary_operation): WIDTH now unsigned.
	(simplify_binary_operation): Likewise.
	(cselib_invalidate_regno): Arg REGNO and variables ENDREGNO, I, and
	THIS_LAST now unsigned.
	(cselib_record_set): Add cast.
	* ssa.c (ssa_max_reg_num): Now unsigned.
	(rename_block): REGNO now unsigned.
	* stmt.c (expand_return): Bit positions unsigned HOST_WIDE_INT;
	sizes now unsigned.
	(all_cases_count): Just return -1 not -2.
	COUNT, MINVAL, and LASTVAL now HOST_WIDE_INT.
	Rework tests to use trees whenever possible.
	Use host_integerp and tree_low_cst.
	(mark_seen_cases): COUNT arg now HOST_WIDE_INT;
	Likewise variable NEXT_NODE_OFFSET; XLO now unsigned.
	(check_for_full_enumeration_handing): BYTES_NEEDED, I to HOST_WIDE_INT.
	* stor-layout.c (mode_for_size): SIZE arg now unsigned.
	(smallest_mode_for_size): Likewise.
	(layout_decl): Simplify handing of a specified DECL_SIZE_UNIT.
	KNOWN_ALIGN is now an alignment, so simplify code.
	Don't turn off DECL_BIT_FIELD if field is BLKmode, but not type.
	(start_record_layout): Renamed from new_record_layout_info.
	Update to new fields.
	(debug_rli, normalize_rli, rli_size_unit_so_far, rli_size_so_far):
	New functions.
	(place_union_field): Renamed from layout_union_field.
	Update to use new fields in rli.
	(place_field): Renamed from layout_field.
	Major rewrite to use new fields in rli; pass alignment to layout_decl.
	(finalize_record_size): Rework to use new fields in rli and handle
	union.
	(compute_record_mode): Rework to simplify and to use new DECL fields.
	(finalize_type_size): Make rounding more consistent.
	(finish_union_layout): Deleted.
	(layout_type, case VOID_TYPE): Don't set TYPE_SIZE_UNIT either.
	(layout_type, case RECORD_TYPE): Call new function names.
	(initialize_sizetypes): Set TYPE_IS_SIZETYPE.
	(set_sizetype): Set TYPE_IS_SIZETYPE earlier.
	(get_best_mode): UNIT is now unsigned; remove casts.
	* tree.c (bit_position): Compute from new fields.
	(byte_position, int_byte_position): New functions.
	(print_type_hash_statistics): Cast to remove warning.
	(build_range_type): Use host_integerp and tree_low_cst to try to hash.
	(build_index_type): Likewise; make subtype of sizetype.
	(build_index_2_type): Pass sizetype to build_range_type.
	(build_common_tree_nodes): Use size_int and bitsize_int to
	initialize nodes; add bitsize_{zero,one,unit}_node.
	* tree.h (DECL_FIELD_CONTEXT): Use FIELD_DECL_CHECK.
	(DECL_BIT_FIELD_TYPE, DECL_QUALIFIER, DECL_FCONTEXT): Likewise.
	(DECL_PACKED, DECL_BIT_FIELD): Likewise.
	(DECL_FIELD_BITPOS): Deleted.
	(DECL_FIELD_OFFSET, DECL_FIELD_BIT_OFFSET): New fields.
	(DECL_RESULT, DECL_SAVED_INSNS): Use FUNCTION_DECL_CHECK.
	(DECL_FRAME_SIZE, DECL_FUNCTION_CODE, DECL_NO_STATIC_CHAIN): Likewise.
	(DECL_INLINE, DECL_BUILT_IN_NONANSI, DECL_IS_MALLOC): Likewise.
	(DECL_BUILT_IN_CLASS, DECL_STATIC_CONSTRUCTOR): Likewise.
	(DECL_STATIC_DESTRUCTOR, DECL_NO_CHECK_MEMORY_USAGE): Likewise.
	(DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_NO_LIMIT_STACK) Likewise.
	(DECL_ORIGINAL_TYPE, TYPE_DECL_SUPPRESS_DEBUG): Use TYPE_DECL_CHECK.
	(DECL_ARG_TYPE_AS_WRITEN, DECL_ARG_TYPE): Use PARM_DECL_CHECK.
	(DECL_INCOMING_RTL, DECL_TRANSPARENT_UNION): Likewise.
	(DECL_ALIGN): Adjust to new field in union.
	(DECL_OFFSET_ALIGN): New field.
	(DECL_ERROR_ISSUED, DECL_TOO_LATE): Use LABEL_DECL_CHECK.
	(DECL_IN_TEXT_SECTION): Use VAR_DECL_CHECK.
	(union tree_decl): Add struct for both aligns.
	(enum tree_index): Add TI_BITSIZE_{ZERO,ONE,UNIT}.
	(bitsize_zero_node, bitsize_one_node, bitsize_unit_node): Added.
	(struct record_layout_info): Rework fields to have offset
	alignment and byte and bit position.
	(start_record_layout, place_field): Renamed from old names.
	(rli_size_so_far, rli_size_unit_so_far, normalize_rli): New decls.
	(byte_position, int_byte_position): Likewise.
	(get_inner_reference): Change types of position and length.
	* unroll.c (unroll_loop): New variable R; use for some loops.
	MAX_LOCAL_REGNUM and MAXREGNUM now unsigned.
	(calculate_giv_inc): Arg REGNO now unsigned.
	(copy_loop_body): REGNO and SRC_REGNO now unsigned.
	* varasm.c (assemble_variable): Clean up handling of size using
	host_integerp and tree_low_cst.
	(decode_addr_const): Use byte, not bit, position.
	(output_constructor): bitpos and offsets are HOST_WIDE_INT;
	use tree_low_cst and int_bit_position.
	* objc/objc-act.c (build_ivar_list_initializer): Use byte_position.
	* ch/actions.c (check_missing_cases): BYTES_NEEDED is HOST_WIDE_INT.
	* ch/typeck.c (expand_constant_to_buffer): Use int_byte_position.
	(extract_constant_from_buffer): Likewise.
	* cp/class.c (build_vbase_pointer_fields): layout_field now
	place_field.
	(get_vfield_offset): Use byte_position.
	(set_rtti_entry): Set OFFSET to ssizetype zero.
	(get_binfo_offset_as_int): Deleted.
	(dfs_record_base_offsets): Use tree_low_cst.
	(dfs_search_base_offsets): Likewise.
	(layout_nonempty_base_or_field): Reflect changes in RLI format
	and call byte_position.
	(layout_empty_base): Convert offset to ssizetype.
	(build_base_field): use rli_size_unit_so_far.
	(dfs_propagate_binfo_offsets): Do computation in proper type.
	(layout_virtual_bases): Pass ssizetype to propagate_binfo_offsets.
	(layout_class_type): Reflect changes in RLI names and fields.
	(finish_struct_1): Set DECL_FIELD_OFFSET.
	* cp/dump.c (dequeue_and_dump): Call bit_position.
	* cp/expr.c (cplus_expand_constant): Use byte_position.
	* cp/rtti.c (expand_class_desc): Use bitsize_one_node.
	* cp/typeck.c (build_component_addr): Use byte_position and don't
	special case for zero offset.
	* f/com.c (ffecom_tree_canonize_ptr_): Use bitsize_zero_node.
	(ffecom_tree_canonize_ref_): Likewise.
	* java/class.c (make_field_value): Use byte_position.
	* java/expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
	(java_array_data_offset): Likewise.
	* java/java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
	bzero call.

From-SVN: r32742
2000-03-25 13:34:13 -05:00
Graham Stott 0cb5d81cf1 resource.c (mark_referenced_resources): Changed use SET_DEST (...) to XEXP (......
* resource.c (mark_referenced_resources): Changed use SET_DEST (...)
        to XEXP (..., 0) on RTL nodes which are not SET or CLOBBER.

From-SVN: r32167
2000-02-25 22:19:35 -07:00
Kaveh R. Ghazi 957e47632b print-rtl.c: PROTO -> PARAMS.
* print-rtl.c: PROTO -> PARAMS.
        * real.c: Likewise.
        * reg-stack.c: Likewise.
        * resource.c: Likewise.
        * sdbout.h: Likewise.
        * simplify-rtx.c: Likewise.
        * stor-layout.c: Likewise.
        * stupid.c: Likewise.
        * xcoffout.c: Likewise.
        * xcoffout.h: Likewise.

From-SVN: r31463
2000-01-17 16:01:04 +00:00
Alexandre Oliva 07570c398b resource.c (mark_referenced_resources): Mark a set strict_low_part as used.
* resource.c (mark_referenced_resources): Mark a set strict_low_part
as used.
* config/i386/i386.c (ix86_expand_setcc): Re-enable clear + set
strict_low_part when possible.

From-SVN: r31340
2000-01-11 23:52:07 +00:00
Kaveh Ghazi b87c6d55b0 Update copyrights for last checkin.
From-SVN: r31309
2000-01-11 00:12:38 +00:00
Kaveh R. Ghazi 7bdb32b97e Makefile.in (optabs.o): Depend on real.h
* Makefile.in (optabs.o): Depend on real.h
	(resource.o): Depend on insn-attr.h

	* builtins.c (result_vector): Wrap prototype in macro conditions
	governing definition and use.

	* c-common.c: Include tm_p.h.

	* c-lex.c: Likewise.

	* elfos.h: Constify a char*.

	* final.c (align_fuzz): Wrap prototype in macro HAVE_ATTR_length.
	(get_attr_length, shorten_branches, profile_after_prologue): Mark
	parameter with ATTRIBUTE_UNUSED.

	* fold-const.c (exact_real_inverse): Wrap variable `i' in
	CHECK_FLOAT_VALUE.

	* haifa-sched.c (schedule_insns): Mark parameter with
	ATTRIBUTE_UNUSED.

	* optabs.c: Include real.h.

	* real.h (ereal_atof): Add prototype arguments.

	* resource.c: Include insn-attr.h.

	* sdbout.c (sdbout_queue_anonymous_type,
	sdbout_dequeue_anonymous_types): Wrap in macro
	SDB_ALLOW_FORWARD_REFERENCES.
	(sdbout_init, sdbout_start_new_source_file): Mark parameter with
	ATTRIBUTE_UNUSED.

	* stmt.c (expand_return): Wrap variable `op0' in macro HAVE_return.

	* stupid.c: Include tm_p.h.

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

cp:
	* lex.c: Include tm_p.h.

ch:
	* lex.c: Include tm_p.h.

From-SVN: r31308
2000-01-10 23:48:03 +00:00
Richard Henderson 925fa22749 resource.c: Revert Oct 26 20:42 and Oct 27 00:56 changes.
* resource.c: Revert Oct 26 20:42 and Oct 27 00:56 changes.
        * toplev.c: Revert Nov 1 13:22 change.

From-SVN: r30357
1999-11-02 15:43:44 -08:00
Diego Novillo 96e9c98d59 resource.c (mark_target_live_regs): For unconditional branches...
* resource.c (mark_target_live_regs): For unconditional branches,
	the resources found at the branch target should be added to the
	resources found so far, not intersected.

From-SVN: r30349
1999-11-02 09:41:16 -05:00
Richard Henderson af05822029 resource.c (find_free_register): Don't use the frame pointer if frame_pointer_needed.
* resource.c (find_free_register): Don't use the frame pointer
        if frame_pointer_needed.

From-SVN: r30246
1999-10-28 12:30:02 -07:00
Mark Mitchell 848323170b rtl.h (note_stores): Add additional paramter.
* rtl.h (note_stores): Add additional paramter.
	* rtlanal.c (reg_set_p_1): Take additional paramter.
	(reg_set_last_1): Likewise.
	(reg_set_p): Adjust call to note_stores.
	(reg_set_last): Likewise.
	(note_stores): Pass data parameter to worker function.
	* alias.c (record_set): Take additional parameter.
	(init_alias_analysis): Pass it.
	* caller-save.c (mark_set_regs): Take additional parameter.
	(save_call_clobbered_regs): Pass NULL to note_stores.
	* combine.c (set_nonzero_bits_and_sign_copies): Take additional
	parameter.
	(record_dead_and_set_regs_1): Likewise.
	(reg_dead_at_p_1): Likewise.
	(combine_instructions): Adjust calls to note_stores.
	(try_combine): Likewise.
	(record_dead_insn): Remove.
	(record_dead_and_set_regs): Adjust calls to note_stores.
	(reg_dead_at_p): Likewise.
	* cse.c (invalidate_skipped_set): Take additional parameter.
	(cse_check_loop_start): Likewise.
	(cse_check_loop_start_value): Remove.
	(cse_set_around_loop): Adjust calls to note_stores.
	* flow.c (notice_stack_pointer_modification): Take additional
	parameter.  Remove duplicate declaration.
	(record_volatile_insns): Adjust calls to note_stores.
	* gcse.c (record_set_info): Take additional parameter.
	(record_last_set_info): Likewise.
	(invalidate_nonnull_info): Likewise.
	(record_set_insn): Remove.
	(compute_sets): Adjust calls to note_stores.
	(last_set_insn): Remove.
	(compute_hash_table): Adjust calls to note_stores.
	(insert_insn_end_bb): Likewise.
	(delete_null_pointer_checks): Likewise.
	* global.c (mark_reg_store): Take additional parameter.
	(mark_reg_clobber): Likewise.
	(reg_becomes_live): Likewise.
	(global_conflicts): Adjust calls to note_stores.
	(build_insn_chain): Likewise.
	* integrate.c (note_modified_parmregs): Take additional parameter.
	(mark_stores): Likewise.  Make it static.
	(save_for_inline_nocopy): Adjust calls to note_stores.
	(try_constants): Likewise.
	* integrate.h (mark_stores): Remove declaration.
	* jump.c (mark_modified_reg): Take additional parameter.
	(thread_jumps): Adjust calls to note_stores.
	* local-alloc.c (validate_equiv_mem_from_store): Take additional
	parameter.
	(no_equiv): Likewise.
	(reg_is_set): Likewise.
	(validate_equiv_mem): Adjust calls to note_stores.
	(update_equiv_regs): Likewise.
	(block_alloc): Likewise.
	* loop.c (note_set_pseudo_multiple_uses_retval): Remove.
	(note_addr_stored): Take additional parameter.
	(note_set_pseudo_multiple_uses): Likewise.
	(record_initial): Likewise.
	(prescan_loop): Adjust calls to note_stores.
	(strength_reduce): Likewise.
	(check_dbra_loop): Likewise.
	* regmove.c (flags_set_1): Take additional paramter.
	(mark_flags_life_zones): Adjust calls to note_stores.
	* reload1.c (mark_not_eliminable): Take additional parameter.
	(forget_old_reloads_1): Likewise.
	(reload_cse_invalidate_rtx): Likewise.
	(reload_cse_check_clobber): Likewise.
	(reload_combine_note_store): Likewise.
	(move2add_note_store): Likewise.
	(reload): Adjust calls to note_stores.
	(reload_as_needed): Likewise.
	(emit_reload_insns): Likewise.
	(reload_cse_regs_1): Likewise.
	(reload_cse_record_set): Adjust calls to reload_cse_invalidate_rtx.
	(reload_combine): Adjust calls to note_stores.
	* resource.c (update_live_status): Take additional paramter.
	(mark_target_live_regs): Adjust calls to note_stores.
	* stupid.c (find_clobbered_regs): Take additional parameter.
	(stupid_life_analysis): Adjust calls to note_stores.

From-SVN: r30221
1999-10-27 19:27:41 +00:00
Richard Henderson 0b8d60fa5d resource.c (mark_target_live_regs): Check that the target insn wasn't created after compute_bb_for_insn.
* resource.c (mark_target_live_regs): Check that the target
        insn wasn't created after compute_bb_for_insn.

From-SVN: r30212
1999-10-27 00:57:32 -07:00
Richard Henderson d024732666 resource.c (find_basic_block): Delete.
* resource.c (find_basic_block): Delete.
        (mark_target_live_regs, incr_ticks_for_insn): Use BLOCK_NUM instead.
        (init_resource_info): Call compute_bb_for_insn.

From-SVN: r30206
1999-10-26 20:44:08 -07:00
Zack Weinberg 6343a50edf resource.c (find_free_register): Mark class_str argument const.
1999-10-04 21:58 -0700  Zack Weinberg  <zack@bitmover.com>

	* resource.c (find_free_register): Mark class_str argument const.
	* resource.h: Update prototype to match.

	* i386.h (PREDICATE_CODES): Add entry for long_memory_operand.
	* i386.md: Give all anonymous insns names.

From-SVN: r29821
1999-10-05 05:00:55 +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
Kaveh R. Ghazi ad85216ece c-aux-info.c (concat): Don't define.
* c-aux-info.c (concat): Don't define.

	* 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.

	* objc/objc-act.c (lang_init): Call concat, not xmalloc/strcpy/...
	Fix memory leak, free allocated memory.

	* prefix.c (translate_name): Call xstrdup, not save_string.
	(update_path): Likewise.

	* profile.c (branch_prob): Call xstrdup, not xmalloc/strcpy.

	* protoize.c (xstrerror, xmalloc, xrealloc, xfree, savestring2):
	Don't define.  Callers of xfree/savestring2 changed to use
	free/concat instead.

	* reload1.c (reload): Call xcalloc, not xmalloc/bzero.
	(init_elim_table): Likewise.

	* resource.c (init_resource_info): Likewise.

	* stupid.c (stupid_life_analysis): Likewise.

	* toplev.c (xmalloc, xcalloc, xrealloc, xstrdup): Don't define.
	(open_dump_file): Call concat, not xmalloc/strcpy/...
	(clean_dump_file): Likewise.
	(compile_file): Call xstrdup, not xmalloc/strcpy.

From-SVN: r29148
1999-09-07 02:36:41 +00:00
Richard Henderson ede7cd4499 backport: Makefile.in (STAGESTUFF): Add *.peephole2.
Merge peephole2 from new_ia32_branch:
        * Makefile.in (STAGESTUFF): Add *.peephole2.
        (mostlyclean): Likewise.
        (recog.o): Depend on resource.h.

        * final.c (peephole): Conditionalize decl on HAVE_peephole.
        (final_scan_insn): Likewise for the invocation of peephole.
        * genconfig.c (main): Look for peephole and peephole2 patterns.
        Emit HAVE_peephole* accordingly.
        * genpeep.c (main): Conditionalize entire output on HAVE_peephole.
        * flags.h (flag_peephole2): Declare.
        * toplev.c: New pass peephole2.  New flag -fpeephole2.

        * genattrtab.c (main): Count DEFINE_PEEPHOLE2.
        * gencodes.c (main): Likewise.
        * genextract.c (main): Likewise.
        * genoutput.c (main): Likewise.
        * genemit.c (max_operand_1): Look for the max scratch operand.
        (gen_rtx_scratch): New.
        (gen_exp): Use it, and pass on new arg subroutine_type.
        (gen_expand): Take max scratch into account.
        (gen_split): Emit peephole2 functions.
        (output_peephole2_scratch): New.
        (main): Include hard-reg-set.h and resource.h.  Handle peephole2.
        * genrecog.c (routine_type): Add PEEPHOLE2.
        (IS_SPLIT): New.
        (make_insn_sequence): Match outer parallel for peep2.  Discard
        top level scratches and dups.
        (add_to_sequence): New args insn_type and top.  Update all callers.
        Handle toplevel peep2 matching insns.
        (write_subroutine): Handle peep2.
        (write_tree_1): Likewise.
        (write_tree): Likewise.
        (main): Likewise.
        (change_state): New arg afterward.  Update all callers.
        Handle matching separate insns.
        * recog.c (recog_next_insn): New.
        (peephole2_optimize): New.
        * rtl.def (DEFINE_PEEPHOLE2): New.
        * resource.c (find_free_register): New argument last_insn.  Use it
        to find a register available through the entire span.
        * resource.h (find_free_register): Update prototype.

From-SVN: r29015
1999-08-31 13:37:09 -07:00
Zack Weinberg 8ce2547995 tree.h: fancy_abort always takes three args.
1999-08-26 09:42 -0700  Zack Weinberg  <zack@bitmover.com>

	* tree.h: fancy_abort always takes three args.
	* resource.c: Move include of system.h before toplev.h.

From-SVN: r28893
1999-08-26 16:49:42 +00:00
Bob Manson f2a1bc0267 haifa-sched.c (split_hard_reg_notes): Move to flow.c
* haifa-sched.c (split_hard_reg_notes): Move to flow.c
        (new_insn_dead_notes): Likewise.
        (update_n_sets): Likewise.
        (update_flow_info): Move to flow.c, renamed to update_life_info;
        extend to handle multiple source insns.
        * flow.c: Include resource.h
        (unlink_insn_chain): New.
        (split_hard_reg_notes): New.
        (maybe_add_dead_note): New.
        (maybe_add_dead_note_use): New.
        (find_insn_with_note): New.
        (new_insn_dead_notes): New.
        (update_n_sets): New.
        (sets_reg_or_subreg_1, sets_reg_or_subreg): New.
        (maybe_remove_dead_notes): New.
        (update_life_info): New.
        (prepend_reg_notes): New.
        (replace_insns): New.
        * output.h (update_life_info): Declare.
        * recog.c (split_block_insns): Use update_life_info.
        * resource.c (find_free_register): Use reg_alloc_order, don't use
        fixed regs, make sure the mode is supported, don't use new regs.
        (reg_dead_p): New.
        * rtl.h (replace_insns): Declare.

Co-Authored-By: Richard Henderson <rth@cygnus.com>

From-SVN: r28828
1999-08-24 15:35:55 -07:00
Jim Wilson 8328efa357 Fix cse.c/resource.c register lifetime inconsistency.
* resource.c (mark_target_live_regs): Use
	PIC_OFFSET_TABLE_REG_CALL_CLOBBERED.

From-SVN: r28786
1999-08-20 17:54:22 -07: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
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
Mark Mitchell a504535255 resource.c (mark_referenced_resources): Make volatil monotonically increasing.
* resource.c (mark_referenced_resources): Make volatil
	monotonically increasing.
	(mark_set_resources): Likewise.

From-SVN: r26811
1999-05-06 23:29:23 +00:00
Mark Mitchell 3d298f8f0e resource.c (mark_set_resources): Handle UNSPEC_VOLATILE...
* resource.c (mark_set_resources): Handle UNSPEC_VOLATILE,
	ASM_INPUT, TRAP_IF, and ASM_OPERANDS just like in
	mark_referenced_resources.

From-SVN: r26769
1999-05-04 16:02:07 +00:00
Zack Weinberg 01198c2f1f c-aux-info.c, [...]: Include toplev.h for real declaration of trim_filename.
1999-04-17 20:11 -0400  Zack Weinberg  <zack@rabi.columbia.edu>
	* c-aux-info.c, emit-rtl.c, explow.c, expmed.c, gcse.c,
	haifa-sched.c, optabs.c, reorg.c, resource.c, sched.c: Include
	toplev.h for real declaration of trim_filename.
	* Makefile.in: Update dependencies.

From-SVN: r26523
1999-04-17 17:14:58 +00:00
Richard Henderson e881bb1b1b Flow rewrite to use basic block structures and edge lists.
From-SVN: r25450
1999-02-25 15:45:42 -08:00
Richard Henderson 6a73406ee9 Missed rtl.h on commit and from ChangeLog.
Add copyright to resource.c.

From-SVN: r24999
1999-02-02 17:26:55 -08:00
Bob Manson ca545bb569 Bob Manson <manson@charmed.cygnus.com>
Bob Manson  <manson@charmed.cygnus.com>
        * resource.c, resource.h: New files.
        * haifa-sched.c (regno_use_in): Moved to rtlanal.c.
        (split_block_insns): Moved to recog.c.
        (update_flow_info): Make public.
        * reorg.c: Moved the functions dealing with computing resource
        usage to resource.c.
        * sched.c (regno_use_in): Moved to rtlanal.c.
        (update_flow_info): Make public.
        (schedule_insns): Use split_block_insns.
        * recog.c (split_block_insns): New function.

From-SVN: r24982
1999-02-02 13:22:52 -08:00