Commit Graph

338 Commits

Author SHA1 Message Date
Nick Clifton 150e407ad0 Patch from Nick Clifton.
Bug 14093
* config/sh/sh-protos.h (sh_promote_prototypes): Declare.
* config/sh/sh.c (sh_promote_prototypes): Remove declaration.
Delete static from definition.
* config/sh/sh.h (FUNCTION_VALUE): Add sh_promote_prototypes call.

From-SVN: r81325
2004-04-29 22:59:06 -07:00
Kaz Kojima 13ecc9e003 sh.c (prepare_move_operands): Use emit_call_insn when the TLS address is generated by a function call.
* config/sh/sh.c (prepare_move_operands): Use emit_call_insn
	when the TLS address is generated by a function call.
	* config/sh/sh.md (tls_global_dynamic): Use a call expression.
	(tls_local_dynamic): Likewise.

From-SVN: r80450
2004-04-06 05:58:44 +00:00
Paolo Bonzini ec8e098d3d alias.c (rtx_equal_for_memref_p): Use predicates to test rtx classes and new rtx class codes...
2004-02-07  Paolo Bonzini  <bonzini@gnu.org>

	* alias.c (rtx_equal_for_memref_p): Use predicates
	to test rtx classes and new rtx class codes, possibly
	splitting conditionals that tested against '<' and 'o'.
	* caller-save.c (save_call_clobbered_regs): Likewise.
	* combine.c (contains_muldiv, find_split_point, subst,
	combine_simplify_rtx, simplify_if_then_else,
	simplify_set, simplify_logical, expand_compound_operation,
	make_compound_operation, if_then_else_cond, known_cond,
	apply_distributive_law, cached_nonzero_bits,
	cached_num_sign_bit_copies, simplify_shift_const,
	gen_binary, simplify_comparison, update_table_tick,
	record_value_for_reg, get_lsat_value_validate): Likewise.
	* cse.c (mention_regs, find_best_addr, find_comparison_args,
	fold_rtx, cse_insn, invalidate_memory, cse_basic_block):
	Likewise.
	* emit-rtl.c (copy_insn_1): Likewise.
	* expr.c (force_operand): Likewise.
	* final.c (final_scan_insn, get_mem_expr_from_op): Likewise.
	* flow.c (notice_stack_pointer_modification_1,
	invalidate_mems_from_autoinc, ior_reg_cond, not_reg_cond,
	and_reg_cond, elim_reg_cond): Likewise.
	* function.c (update_epilogue_consts): Likewise.
	* genattrtab.c (attr_rtx_1): Likewise.
	* genopinit.c (gen_insn): Likewise.
	* integrate.c (subst_constants): Likewise.
	* jump.c (reversed_comparison_code_parts,
	reversed_comparison_code, delete_related_insns,
	rtx_renumbered_equal_p): Likewise.
	* local-alloc.c (block_alloc): Likewise.
	* loop.c (rtx_equal_for_prefetch_p, maybe_eliminate_biv,
	canonicalize_condition): Likewise.
	* loop-iv.c (simplify_using_conditions, iv_number_of_iterations):
	Likewise.
	* optabs.c (add_equal_node, expand_binop): Likewise.
	* predict.c (estimate_probability): Likewise.
	* ra-debug.c (ra_print_rtx_2op, ra_print_rtx): Likewise.
	* recog.c (validate_replace_rtx_1, comparison_operator,
	offsettable_address_p, constrain_operands): Likewise.
	* reg-stack.c (swap_rtx_condition_1, subst_stack_regs_pat):
	Likewise.
	* regclass.c (scan_one_insn): Likewise.
	* regmove.c (stable_and_no_regs_but_for_p): Likewise.
	* regrename.c (kill_autoinc_value): Likewise.
	* reload.c (find_reusable_reload, find_reloads,
	reg_overlap_mentioned_for_reload_p): Likewise.
	* reload1.c (gen_reload, delete_address_reloads_1): Likewise.
	* rtl.c (copy_rtx): Likewise.
	* rtl.h (CONSTANT_P, INSN_P): Likewise.
	* rtlanal.c (commutative_operand_precedence): Likewise.
	* sched-deps.c (conditions_mutex_p): Likewise.
	* sched-rgn.c (is_cfg_nonregular): Likewise.
	* simplify-rtx.c (simplify_gen_binary,
	simplify_gen_relational, simplify_replace_rtx,
	simplify_unary_operation, simplify_binary_operation,
	simplify_ternary_operation, simplify_rtx): Likewise.
	* unroll.c (reg_dead_after_loop): Likewise.
	* config/alpha/alpha.c (alpha_swapped_comparison_operator,
	print_operand): Likewise.
	* config/arc/arc.c (proper_comparison_operator): Likewise.
	* config/arm/arm.c (arm_arm_address_cost, arm_select_cc_mode):
	Likewise.
	* config/avr/avr.c (_reg_unused_after): Likewise.
	* config/frv/frv.c (frv_ifcvt_modify_tests,
	frv_ifcvt_modify_insn, frv_pack_insn): Likewise.
	* config/i386/i386.c (ix86_comparison_operator,
	ix86_carry_flag_operator, fcmov_comparison_operator,
	arith_or_logical_operator, print_operand,
	ix86_expand_binary_operator, ix86_binary_operator_ok):
	Likewise.
	* config/i386/i386.md: Likewise.
	* config/ia64/ia64.c (not_postinc_memory_operand,
	ia64_print_operand, update_set_flags, errata_emit_nops):
	Likewise.
	* config/ia64/ia64.h (PREFERRED_RELOAD_CLASS,
	CONSTRAINT_OK_FOR_S): Likewise.
	* config/ip2k/ip2k.c (mdr_resequence_xy_yx,
	mdr_try_move_dp_reload, ip2k_check_can_adjust_stack_ref,
	ip2k_xexp_not_uses_reg_for_mem, ip2k_xexp_not_uses_reg_p,
	ip2k_composite_xexp_not_uses_reg_p, ip2k_unary_operator):
	Likewise.
	* config/iq2000/iq2000.c (cmp_op, symbolic_expression_p,
	eqne_comparison_operator, signed_comparison_operator):
	Likewise.
	* config/mips/mips.c (cmp_op, symbolic_expression_p):
	Likewise.
	* config/mmix/mmix (mmix_foldable_comparison_operator,
	mmix_comparison_operator): Likewise.
	* config/pa/pa.c (hppa_legitimize_address): Likewise.
	* config/rs6000/rs6000.c (stmw_operation,
	branch_comparison_operator, trap_comparison_operator,
	ccr_bit): Likewise.
	* config/rs6000/rs6000.h (SELECT_CC_MODE): Likewise.
	* config/s390/s390.c (s390_alc_comparison,
	s390_slb_comparison):L Likewise.
	* config/sh/sh.c (gen_block_redirect, reg_unused_after):
	Likewise.
	* config/sparc/sparc.c (eq_or_neq, normal_comp_operator,
	noov_compare_op, noov_compare64_op, v9_regcmp_op,
	emit_hard_tfmode_operation, reg_unused_after)
	* doc/md.texi, doc/rtl.texi: Likewise.

	* ra-debug.c: Add 2004 to list of copyright years.
	* unroll.c: Likewise.

	* combine.c (simplify_logical): Remove dummy test,
	(apply_distributive_law): Fix typo in comment.
	GET_CODE (x) == AND so x is a commutative binary op.
	* jump.c (delete_related_insns): simplify loop
	condition, move testing of RTX codes inside the loop.
	(rtx_renumbered_equal_p): do not use RTX_CODE.
	* rtl.c (rtx_class): Declare as enum rtx_class.
	* rtl.def (EQ, NE, UNEQ, LTGT, UNORDERED, ORDERED):
	Move to RTX_COMM_COMPARE class.
	(HIGH, SYMBOL_REF, LABEL_REF, CONST, CONST_INT, CONST_DOUBLE):
	Move to RTX_CONST_OBJ class.
	* rtl.h (enum rtx_class): New declaration,
	(RTX_OBJ_MASK, RTX_OBJ_RESULT, RTX_COMPARE_MASK,
	RTX_COMPARE_RESULT, RTX_ARITHMETIC_MASK, RTX_ARITHMETIC_RESULT,
	RTX_BINARY_MASK, RTX_BINARY_RESULT, RTX_COMMUTATIVE_MASK,
	RTX_COMMUTATIVE_RESULT, RTX_NON_COMMUTATIVE_RESULT,
	RTX_EXPR_FIRST, RTX_EXPR_LAST, UNARY_P, BINARY_P,
	ARITHMETIC_P, COMMUTATIVE_ARITHMETIC_P, COMPARISON_P,
	SWAPPABLE_OPERANDS_P, NON_COMMUTATIVE_P, COMMUTATIVE_P,
	OBJECT_P): New macros.
	* config/sparc/sparc.c (noov_compare_op): Remove register
	from parameter.

From-SVN: r78824
2004-03-03 08:35:33 +00:00
Kazu Hirata 4ee31f1e47 passes.c, [...]: Fix comment typos.
gcc/
	* passes.c, config/frv/frv.c, config/sh/sh.c: Fix comment
	typos.
	* doc/cppopts.texi: Fix a typo.

gcc/cp/
	* call.c: Fix a comment typo.

From-SVN: r78676
2004-02-29 22:02:30 +00:00
Kazu Hirata 832a3292d9 * config/sh/sh.c: Fix formatting.
From-SVN: r78646
2004-02-29 02:53:51 +00:00
Kazu Hirata 508ea1c5fa * config/sh/sh.c: Convert to ISO-C.
From-SVN: r78645
2004-02-29 02:28:59 +00:00
Richard Henderson c263766cf3 toplev.c (dump_file_tbl): Rename from dump_file.
* toplev.c (dump_file_tbl): Rename from dump_file.
        * bb-reorder.c, bt-load.c, cfgcleanup.c, cfglayout.c, cfgloopanal.c,
        cfgloopmanip.c, cfgrtl.c, config/arm/arm.c, config/frv/frv.c,
        config/i386/i386.c, config/ia64/ia64.c, config/mips/mips.c,
        config/sh/sh.c, cse.c, flow.c, ifcvt.c, loop-iv.c, loop-unroll.c,
        loop-unswitch.c, output.h, predict.c, profile.c, ra-build.c,
        ra-colorize.c, ra-debug.c, ra-rewrite.c, ra.c, regrename.c, reload1.c,
        toplev.c, tracer.c, value-prof.c, var-tracking.c, web.c:
        s/rtl_dump_file/dump_file/g.

From-SVN: r78399
2004-02-24 15:40:03 -08:00
Sanjiv Kumar Gupta 58565a33ed target-def.h (TARGET_SCHED_INIT_GLOBAL, [...]): New macros.
2003-02-24  Sanjiv Kumar Gupta  <sanjivg@noida.hcltech.com>

	* target-def.h (TARGET_SCHED_INIT_GLOBAL,
	TARGET_SCHED_FINISH_GLOBAL): New macros.

	* target.h (md_init_global, md_finish_global): Function
	declarations corresponding to new target macros.

	* haifa-sched.c (sched_init, sched_finish): Allow target to
	call the new schedular hooks.

	* flow.c (recompute_reg_usage): Add PROP_DEATH_NOTES flag in
	call to update_life_info.

	* config/sh/sh.h (OVERRIDE_OPTIONS): Re-enable
	flag_schedule_insns for SH4.

	* config/sh/sh.c (sh_md_init_global, sh_md_finish_global,
	find_set_regmode_weight, find_insn_regmode_weight,
	find_regmode_weight), sh_md_init, sh_dfa_new_cycle,
	sh_variable_issue, high_pressure, ready_reorder,
	rank_for_reorder, swap_reorder, sh_reorder, sh_reorder2): New
	functions used to throttle the insn movement in first
	scheduling pass for SH.

	* gcc/doc/tm.texi: Document TARGET_SCHED_INIT_GLOBAL and
	TARGET_SCHED_FINISH_GLOBAL.

From-SVN: r78374
2004-02-24 17:28:33 +00:00
Alan Modra 0f6937feff tm.texi (INIT_CUMULATIVE_ARGS): Update doco.
* doc/tm.texi (INIT_CUMULATIVE_ARGS): Update doco.
	* calls.c (expand_call): Pass n_named_args to INIT_CUMULATIVE_ARGS.
	(emit_library_call_value_1): Likewise pass nargs.
	* expr.c (block_move_libcall_safe_for_call_parm): Pass 3 here.
	* function.c (assign_parms): Pass -1 to INIT_CUMULATIVE_ARGS.
	* config/rs6000/rs6000.c (init_cumulative_args): Use n_named_args
	parameter instead of scanning TYPE_ARGS_TYPES to count args.
	* config/rs6000/rs6000-protos.h (init_cumulative_args): Update
	prototype.
	* config/rs6000/rs6000.h (INIT_CUMULATIVE_ARGS): Pass extra arg.
	(INIT_CUMULATIVE_INCOMING_ARGS): Set extra arg to 1000.
	(INIT_CUMULATIVE_LIBCALL_ARGS): Set extra arg to 0.
	* config/sh/sh.c (sh_output_mi_thunk): Pass 1 as n_named_args to
	INIT_CUMULATIVE_ARGS.
	* config/alpha/alpha.h (INIT_CUMULATIVE_ARGS): Update.
	* config/alpha/unicosmk.h, config/alpha/vms.h, config/arc/arc.h,
	config/arm/arm.h, config/avr/avr.h, config/c4x/c4x.h,
	config/cris/cris.h, config/fr30/fr30.h, config/frv/frv.h,
	config/h8300/h8300.h, config/i386/i386.h, config/i860/i860.h,
	config/ia64/ia64.h, config/ip2k/ip2k.h, config/iq2000/iq2000.h,
	config/iq2000/iq2000.c, config/m32r/m32r.h, config/m68hc11/m68hc11.h,
	config/m68k/m68k.h, config/mcore/mcore.h, config/mips/mips.h,
	config/mmix/mmix.h, config/mn10300/mn10300.h, config/ns32k/ns32k.h,
	config/pa/pa.h, config/pdp11/pdp11.h config/s390/s390.h,
	config/sh/sh.h, config/sparc/sparc.h, config/stormy16/stormy16.h,
	config/v850/v850.h, config/vax/vax.h, config/xtensa/xtensa.h: Likewise.

From-SVN: r77380
2004-02-06 16:48:36 +10:30
Rainer Orth 839ee4bc57 re PR target/13750 (Ada bootstrap failure on Tru64 UNIX: b_gnat[1b].o comparison failure)
PR middle-end/13750
	Revert:
	2004-01-15  Geoffrey Keating  <geoffk@apple.com>
	PR pch/13361
	* c-typeck.c (constructor_asmspec): Delete.
	(struct initializer_stack): Delete field 'asmspec'.
	(start_init): Delete saving of asmspec.
	(finish_init): Don't update constructor_asmspec.
	* dwarf2out.c (rtl_for_decl_location): Duplicate string from tree.
	* stmt.c (expand_asm): Duplicate strings from tree.
	(expand_asm_operands): Likewise.
	* tree.c (tree_size): Update computation of size of STRING_CST.
	(make_node): Don't make STRING_CST nodes.
	(build_string): Allocate string with tree node.
	* tree.def (STRING_CST): Update comment.
	* tree.h (TREE_STRING_POINTER): Adjust for change to STRING_CST.
	(tree_string): Place contents of string in tree node.
	* config/sh/sh.c (sh_handle_sp_switch_attribute): Duplicate string
	from tree.

	cp:
	PR middle-end/13750
	Revert:
	2004-01-15  Geoffrey Keating  <geoffk@apple.com>
	PR pch/13361
	* cp/lex.c (handle_pragma_interface): Duplicate string from tree.
	(handle_pragma_implementation): Likewise.

	testsuite:
	PR middle-end/13750
	Revert:
	2004-01-15  Geoffrey Keating  <geoffk@apple.com>
	PR pch/13361
	* testsuite/g++.dg/pch/wchar-1.C: New.
	* testsuite/g++.dg/pch/wchar-1.Hs: New.

From-SVN: r77343
2004-02-05 21:56:38 +00:00
Kazu Hirata a556fd39ab alpha.c, [...]: Use const0_rtx instead of GEN_INT (0).
* config/alpha/alpha.c, config/arm/arm.c, config/c4x/c4x.c,
	config/fr30/fr30.md, config/frv/frv.c, config/frv/frv.md,
	config/h8300/h8300.c, config/ia64/ia64.c, config/ip2k/ip2k.md,
	config/m32r/m32r.md, config/m68hc11/m68hc11.c,
	config/mips/mips.md, config/mmix/mmix.c,
	config/mn10300/mn10300.c, config/mn10300/mn10300.md,
	config/ns32k/ns32k.c, config/pa/pa.md, config/pdp11/pdp11.c,
	config/rs6000/altivec.md, config/s390/s390.c,
	config/s390/s390.h, config/s390/s390.md, config/sh/sh.c,
	config/sh/sh.h, config/sh/sh.md, config/stormy16/stormy16.c:
	Use const0_rtx instead of GEN_INT (0).  Do the same for other
	constants that are readily available.

From-SVN: r77161
2004-02-03 06:43:59 +00:00
Kazu Hirata 0f4c242bcb arm.md, [...]: Fix indentation.
* config/arm/arm.md, config/c4x/c4x.md, config/cris/cris.md,
	config/h8300/h8300.c, config/ip2k/ip2k.md,
	config/iq2000/iq2000.c, config/mips/mips.c,
	config/rs6000/rs6000.c, config/rs6000/rs6000.md,
	config/sh/sh.c, config/sh/sh.md, config/stormy16/stormy16.c,
	config/v850/v850.md: Fix indentation.

From-SVN: r77116
2004-02-02 15:18:28 +00:00
Kazu Hirata 1c563bedd2 arc.md, [...]: Replace gen_rtx with gen_rtx_fmt_e*.
* config/arc/arc.md, config/arm/arm.c, config/arm/arm.md,
	config/c4x/c4x.c, config/c4x/c4x.md, config/cris/cris.md,
	config/frv/frv.c, config/h8300/h8300.c, config/ip2k/ip2k.md,
	config/iq2000/iq2000.c, config/m32r/m32r.c,
	config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.md,
	config/mn10300/mn10300.c, config/rs6000/rs6000.c,
	config/rs6000/rs6000.md, config/sh/sh.c, config/sh/sh.md,
	config/stormy16/stormy16.c, config/v850/v850.md,
	config/xtensa/xtensa.c: Replace gen_rtx with gen_rtx_fmt_e*.

From-SVN: r77098
2004-02-02 06:31:08 +00:00
Kazu Hirata c0d4e710f7 sh.c: Replace "gen_rtx (FOO, " with "gen_rtx_FOO (".
* config/sh/sh.c: Replace "gen_rtx (FOO, " with "gen_rtx_FOO (".
	* config/sh/sh.h: Likewise.
	* config/sh/sh.md: Likewise.

From-SVN: r77051
2004-01-31 22:09:22 +00:00
Kazu Hirata bd5bd7ac81 alpha.c: Remove mentions of deprecates macros in comments...
* config/alpha/alpha.c: Remove mentions of deprecates macros
	in comments, remove some target-independent comments about target
	macros, and/or add minimal function comments for target hook
	implementations.
	* config/avr/avr.c: Likewise.
	* config/ia64/ia64.h: Likewise.
	* config/ip2k/ip2k.c: Likewise.
	* config/iq2000/iq2000.c: Likewise.
	* config/m32r/m32r.h: Likewise.
	* config/m68hc11/m68hc11.c: Likewise.
	* config/mcore/mcore.c: Likewise.
	* config/mmix/mmix.c: Likewise.
	* config/mn10300/mn10300.c: Likewise.
	* config/pa/pa.c: Likewise.
	* config/pdp11/pdp11.c: Likewise.
	* config/rs6000/rs6000.h: Likewise.
	* config/sh/sh.c: Likewise.
	* config/sh/sh.h: Likewise.
	* config/sparc/sparc.c: Likewise.
	* config/sparc/sparc.h: Likewise.
	* config/stormy16/stormy16.c: Likewise.
	* config/xtensa/xtensa.c: Likewise.

From-SVN: r77005
2004-01-30 23:16:23 +00:00
Alexandre Oliva 0f2b41b2d8 re PR target/13819 (sh-elf broken; abort in sh_reorg())
PR optimization/13819
* config/sh/sh.c (sh_reorg): Compensate for sharing of CLOBBERs
introduced by 2004-01-20's Jan Hubicka's copy_insn change.
(sh_handle_sp_switch_attribute): Remove warning.

From-SVN: r76425
2004-01-23 15:29:09 +00:00
Daniel Jacobowitz 5cfc5f84fb final.c (final_scan_insn): Make non-static again.
* final.c (final_scan_insn): Make non-static again.
	* output.h (final_scan_insn): Re-add prototype.
	* config/arc/arc.c (arc_output_function_epilogue): Add NULL
	to final_scan_insn call.
	* config/cris/cris.c (cris_target_asm_function_epilogue): Likewise.
	* config/mips/mips.c (mips_output_conditional_branch): Likewise.
	* config/pa/pa.c (output_lbranch, output_call): Likewise.
	* config/sh/sh.c (print_slot): Likewise.
	* config/sparc/sparc.c (sparc_nonflat_function_epilogue): Likewise.
	(output_sibcall, sparc_flat_function_epilogue): Likewise.

From-SVN: r76117
2004-01-18 22:37:29 +00:00
Andrew Pinski 8582b18a5f sh.c: Include ggc.h.
2004-01-16  Andrew Pinski  <pinskia@physics.uc.edu>

        * config/sh/sh.c: Include ggc.h.

From-SVN: r76018
2004-01-16 17:19:20 -08:00
Geoffrey Keating a6dd409400 Index: ChangeLog
2004-01-15  Geoffrey Keating  <geoffk@apple.com>

	PR pch/13361
	* c-typeck.c (constructor_asmspec): Delete.
	(struct initializer_stack): Delete field 'asmspec'.
	(start_init): Delete saving of asmspec.
	(finish_init): Don't update constructor_asmspec.
	* dwarf2out.c (rtl_for_decl_location): Duplicate string from tree.
	* stmt.c (expand_asm): Duplicate strings from tree.
	(expand_asm_operands): Likewise.
	* tree.c (tree_size): Update computation of size of STRING_CST.
	(make_node): Don't make STRING_CST nodes.
	(build_string): Allocate string with tree node.
	* tree.def (STRING_CST): Update comment.
	* tree.h (TREE_STRING_POINTER): Adjust for change to STRING_CST.
	(tree_string): Place contents of string in tree node.
	* config/sh/sh.c (sh_handle_sp_switch_attribute): Duplicate string
	from tree.

Index: cp/ChangeLog
2004-01-15  Geoffrey Keating  <geoffk@apple.com>

	PR pch/13361
	* cp/lex.c (handle_pragma_interface): Duplicate string from tree.
	(handle_pragma_implementation): Likewise.

Index: testsuite/ChangeLog
2004-01-15  Geoffrey Keating  <geoffk@apple.com>

	PR pch/13361
	* testsuite/g++.dg/pch/wchar-1.C: New.
	* testsuite/g++.dg/pch/wchar-1.Hs: New.

From-SVN: r75961
2004-01-16 07:20:38 +00:00
J"orn Rennecke f96540656c re PR target/9365 ([SH] segfault in gen_far_branch (config/sh/sh.c))
PR target/9365
        * sh.c (gen_block_redirect): Add special handling of RETURN.
        (gen_far_branch) Don't call gen_stuff_delay_slot if there is no
        far branch target (i.e. it's a return).

From-SVN: r75872
2004-01-14 18:02:42 +00:00
Kazu Hirata 0fe7abcc1e system.h (TEXT_SECTION): Poison.
* system.h (TEXT_SECTION): Poison.
	* varasm.c (text_section): Don't use TEXT_SECTION.
	* config/sh/sh.c (sh_file_start): Fix a comment typo.
	* doc/tm.texi (TEXT_SECTION): Remove.

From-SVN: r75797
2004-01-13 10:51:39 +00:00
J"orn Rennecke 68d2b0bb98 Fixed date in ChangeLog. Also updated Copyright dates in source files.
From-SVN: r75730
2004-01-12 16:20:14 +00:00
J"orn Rennecke 07d7d2f4d1 re PR target/13585 (Incorrect optimisation of call to sfunc)
PR target/13585
	* sh-protos.h (check_use_sfunc_addr): Declare.
	* sh.c (extract_sfunc_addr, check_use_sfunc_addr): New functions.
	* sh.md (use_sfunc_addr): Use check_use_sfunc_addr in insn predicate.

From-SVN: r75717
2004-01-12 12:59:38 +00:00
Kazu Hirata 24746a428d linux.h: Fix comment formatting.
* config/sh/linux.h: Fix comment formatting.
	* config/sh/netbsd-elf.h: Likewise.
	* config/sh/sh.c: Likewise.
	* config/sh/sh.h: Likewise.
	* config/sh/vxworks.h: Likewise.

From-SVN: r75462
2004-01-06 04:21:52 +00:00
Stuart Menefy 5d27ef9484 re PR target/13302 (Putting a va_list in a struct causes seg fault)
2003-12-05  Stuart Menefy <stuart.menefy@st.com>
	    J"orn Rennecke <joern.rennecke@superh.com>

	PR target/13302
gcc:
	* sh.c (sh_build_builtin_va_list): Use (*lang_hooks.types.make_type).
testsuite:
	* g++.dg/other/struct-va_list.C: New test.

Co-Authored-By: J"orn Rennecke <joern.rennecke@superh.com>

From-SVN: r74334
2003-12-05 15:48:37 +00:00
J"orn Rennecke 3db1b43486 re PR rtl-optimization/13260 (Incorrect optimisation of loop termination condition)
PR optimization/13260
	* sh-protos.h (sh_expand_t_scc): Declare.
	* sh.h (PREDICATE_CODES): Add cmpsi_operand.
	* sh.c (cmpsi_operand, sh_expand_t_scc): New functions.
	* sh.md (cmpsi): Use cmpsi_operand.  If T_REG is compared to
	something that is not a CONST_INT, copy it into a pseudo register.
	(subc): Fix description of new T value.
	(slt, sgt, sge, sgtu): Don't clobber T after rtl generation is over.
	(sltu, sleu, sgeu): Likewise.
	(seq, sne): Likewise. Use sh_expand_t_scc.

From-SVN: r74294
2003-12-04 20:10:29 +00:00
J"orn Rennecke bcc8cc820a Fix libstdc++-v3 build failure on sh64-elf:
* sh-protos.h (sh_pch_valid_p): Declare.
	* sh.c ("intl.h"): Include.
	(TARGET_PCH_VALID_P): Override.
	(sh_target_switches): New variable.
	(target_switches): Define.
	(sh_pch_valid_p): New function.

	* sh.h (MODE_AFTER): Don't change mode unless TARGET_HITACHI.

From-SVN: r73338
2003-11-07 17:44:57 +00:00
Richard Henderson c35d187fc3 builtins.c (std_build_builtin_va_list): New.
* builtins.c (std_build_builtin_va_list): New.
	* expr.h (std_build_builtin_va_list): Declare.
	* defaults.h (BUILD_VA_LIST_TYPE): New.
	* system.h (BUILD_VA_LIST_TYPE): Poison.
	* target-def.h (TARGET_BUILD_BUILTIN_VA_LIST): New.
	* target.h (struct gcc_target): Add build_builtin_va_list.
	* tree.c (build_common_tree_nodes_2): Use it.

	* config/alpha/alpha-protos.h, config/alpha/alpha.c,
	config/alpha/alpha.h, config/alpha/unicosmk.h,
	config/d30v/d30v-protos.h, config/d30v/d30v.c, config/d30v/d30v.h,
	config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.h,
	config/i860/i860-protos.h, config/i860/i860.c, config/i860/i860.h,
	config/i960/i960-protos.h, config/i960/i960.c, config/i960/i960.h,
	config/mips/iris6.h, config/mips/mips-protos.h, config/mips/mips.c,
	config/mips/mips.h, config/rs6000/rs6000-protos.h,
	config/rs6000/rs6000.c, config/rs6000/rs6000.h,
	config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h,
	config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.h,
	config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c,
	config/xtensa/xtensa.h: Rename foo_build_va_list to
	foo_build_builtin_va_list; make it static.  Define
	TARGET_BUILD_BUILTIN_VA_LIST.  Remove BUILD_VA_LIST_TYPE.
	Update protos.

	* config/i386/i386.c (ix86_expand_carry_flag_compare): Make static.
	* config/iq2000/iq2000.h (BUILD_VA_LIST_TYPE): Remove.

From-SVN: r73076
2003-10-29 18:02:49 -08:00
Steven Bosscher cf27749919 sh.c, [...]: Convert to ISO C90 function declarations and definitions.
* config/sh/sh.c, config/sh/sh-protos.h: Convert to
	ISO C90 function declarations and definitions.

From-SVN: r72424
2003-10-13 08:44:08 +00:00
Kelley Cook 7ec022b20e GNU CC -> GCC
From-SVN: r71850
2003-09-27 04:48:30 +00:00
DJ Delorie 61f71b3447 targhooks.c: New file.
* targhooks.c: New file.
	* targhooks.h: New file.
	* Makefile.in: Add targhooks.o support.
	(function.o): Depend on$(TARGET_H).
	(stmt.o): Likewise.
	(combine.o): Depend on $(TREE_H) and $(TARGET_H).
	* builtins.c (apply_args_size, expand_builtin_apply_args_1,
	expand_builtin_apply): Convert to calls.struct_value_rtx hook.
	(expand_builtin_saveregs): Convert to
	calls.expand_builtin_saveregs hook.
	* c-decl.c (start_decl): Handle new calls.promote_prototypes hook
	here, instead of ...
	(get_parm_info) ... here.
	(store_parm_decls_oldstyle): Convert to calls.promote_prototypes
	hook.
	(finish_function): Handle calls.promote_prototypes hook here too.
	* c-typeck.c (convert_arguments): Convert to
	calls.promote_prototypes hook.
	(c_convert_parm_for_inlining): Likewise.
	* calls.c (initialize_argument_information): Convert to
	calls.promote_function_args hook.
	(expand_call): Convert to calls.struct_value_rtx,
	calls.strict_argument_naming,
	calls.pretend_outgoing_varargs_named, and
	calls.promote_function_return hooks.  Pass fndecl to
	aggregate_value_p.  Initialize CUMULATIVE_ARGS before calling
	hooks, so they can use that.
	(emit_library_call_value_1): Likewise.
	* combine.c (setup_incoming_promotions): Convert to
	calls.promote_function_args hook.
	* emit-rtl.c: Convert to calls.struct_value_rtx hook.
	* expr.c (expand_assignment): Pass call to aggregate_value_p.
	(expand_expr): Likewise.
	* expr.h: Remove support for SETUP_INCOMING_VARARGS,
	STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED,
	RETURN_IN_MEMORY macro defaults.
	* final.c (profile_function): Convert to calls.struct_value_rtx
	hook.
	* function.c (aggregate_value_p): Accept function type tree as
	second parameter; try to deduce fntype from it.  Convert to
	calls.return_in_memory hook.
	(assign_parms): Convert to calls.setup_incoming_varargs,
	calls.strict_argument_naming, calls.promote_function_args,
	calls.pretend_outgoing_varargs_named hooks.  Pass fndecl to
	aggregate_value_p.
	(expand_function_start): Likewise.  Convert to
	calls.struct_value_rtx hook.
	(expand_function_end): Convert to calls.promote_function_return hook.
	(allocate_struct_function): Pass fndecl to aggregate_value_p.
	* hard-reg-set.h: Update comments to new hook names.
	* integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p.
	* reg-stack.c (stack_result): Likewise.
	* rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete.
	* stmt.c (expand_value_return): Convert to
	calls.promote_function_return hook.
	* target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS,
	TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES,
	TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY,
	TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS,
	TARGET_STRICT_ARGUMENT_NAMING,
	TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS.
	* target.h: Likewise.
	* tree.h (aggregate_value_p): Also takes a tree to deduce function
	attributes from (for target hooks).
	* doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN,
	PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM,
	STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING,
	EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS,
	STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert
	to hooks.

	* config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function
	to aggregate_value_p.
	* config/arm/arm.c (arm_init_cumulative_args,
	arm_output_mi_thunk): Likewise.
	* config/i386/i386.c (ix86_return_pops_args, x86_this_parameter):
	Likewise.
	* config/mips/mips.c (mips_save_reg_p, mips_expand_prologue,
	mips_can_use_return_insn): Likewise.
	* config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise.
	* config/s390/s390.c (s390_output_mi_thunk): Likewise.
	* config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to
	aggregate_value_p.
	* config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass
	function to aggregate_value_p.
	* objc/objc-act.c (generate_struct_by_value_array): Pass NULL to
	aggregate_value_p.

	* config/sh/sh-protos.h (sh_builtin_saveregs): Remove.
	(sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg,
	sh_function_arg_advance, sh_pass_in_reg_p): New.  * config/sh/sh.c
	(sh_handle_renesas_attribute, sh_promote_prototypes,
	sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs,
	sh_setup_incoming_varargs, sh_strict_argument_naming,
	sh_pretend_outgoing_varargs_named): New decls.
	(targetm): Add new hooks.
	(calc_live_regs): Save MACL and MACH if the function has the
	renesas attribute.
	(sh_expand_prologue): Support renesas attribute.
	(sh_builtin_saveregs): Make static.
	(sh_build_va_list): Support renesas attribute.
	(sh_va_start): Likewise.
	(sh_va_arg): Likewise.
	(sh_promote_prototypes): New.
	(sh_function_arg): New, moved from sh.h.  Support renesas
	attribute.
	(sh_function_arg_advance): Likewise.
	(sh_return_in_memory): Likewise.
	(sh_strict_argument_naming): Likewise.
	(sh_pretend_outgoing_varargs_named): Likewise.
	(sh_struct_value_rtx): New.
	(sh_attribute): Add renesas attribute.
	(sh_handle_renesas_attribute): New.
	(sh_attr_renesas_p, sh_cfun_attr_renesas_p): New.
	(sh_ms_bitfield_layout_p): Support renesas attribute also.
	(sh_output_mi_thunk): Pass function to aggregate_value_p.  *
	config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for
	-mhitachi.
	(STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to
	target hooks.
	(sh_args): Add renesas_abi flag.
	(INIT_CUMULATIVE_ARGS): Set it.  Pass fndecl to aggregate_value_p.
	(FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c.
	(PASS_IN_REG_P): Support renesas attribute.  Pass DF and TF on the
	stack for the renesas abi.
	(STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED,
	SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS,
	PROMOTE_PROTOTYPES): Moved to sh.c.  * config/sh/sh.md (call): Set
	call cookie to indicate renesas calls.

	* decl.c (finish_function): Pass fndecl to aggregate_value_p.

	* misc.c (default_pass_by_ref): Convert to calls.return_in_memory
	hook.

From-SVN: r71048
2003-09-03 23:18:05 -04:00
J"orn Rennecke dce20bbc11 sh.c (sh_get_pr_initial_val): Always wrap in unspec for TARGET_SH1.
* sh.c (sh_get_pr_initial_val): Always wrap in unspec for TARGET_SH1.
	* sh.md (load_ra): Change insn predicate to TARGET_SH1.

From-SVN: r70410
2003-08-13 20:20:16 +01:00
J"orn Rennecke 7d73a2bae9 sh.c (calc_live_regs): If the return address pointer is live, force pr live.
* sh.c (calc_live_regs): If the return address pointer is live,
	force pr live.
	(sh5_schedule_saves): Exclude PR_MEDIA_REG from being a temp register
	for saves / restores.
	(sh_expand_epilogue): If sh_media_register_for_return returns a
	register number, flag the instructions that restores PR_MEDIA_REG
	as possibly dead.
	Remove dead update of offset.
	(sh_get_pr_initial_val): Use UNSPEC_RA if we don't know yet if
	we can use the result of get_hard_reg_initial_val.
	* sh.md (UNSPEC_RA): New constant.
	(movsi_i_lowpart+1): Changed into a define_insn_and_split, named:
	(load_ra).  Handle UNSPEC_RA.
	(sibcall_media): Use PR_MEDIA_REG.

From-SVN: r70234
2003-08-07 23:40:07 +01:00
J"orn Rennecke 97b3d0f016 sh.h (CALL_USED_REGISTERS): Include PR_REG and PR_MEDIA_REG.
* sh.h (CALL_USED_REGISTERS): Include PR_REG and PR_MEDIA_REG.
	* sh.c (calc_live_regs): Use sh_pr_n_sets to determine if pr
	needs saving on SHmedia.

From-SVN: r70227
2003-08-07 20:35:52 +01:00
J"orn Rennecke b869f90433 Fix SHcompact exception handling:
2003-08-06  J"orn Rennecke <joern.rennecke@superh.com>

	Fix SHcompact exception handling:
	* sh.c (sh_get_pr_initial_val): If PR is or miight be clobbered
	by the prologue, return a MEM with return_address_pointer_rtx
	as address.
	* sh.h (HARD_REGNO_MODE_OK): PR is OK for SImode.
	(RETURN_ADDR_OFFSET): Don't define.
	(SH_DBX_REGISTER_NUMBER): Use SHmedia numbers for SHmedia
	registers that are visible in compact mode.  Show that SHmedia
	registers still exist in compact mode, even if there are not
	readily accessible.
	(ASM_PREFERRED_EH_DATA_FORMAT): Supply DW_EH_PE_indirect
	if GLOBAL.  Use DW_EH_PE_textrel (nominally) for CODE,
	and DW_EH_PE_pcrel for pic data.
	(ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): If DW_EH_PE_textrel,
	set SYMBOL_FLAG_FUNCTION in symbol, and actually use
	DW_EH_PE_pcrel / DW_EH_PE_absptr encoding.
	(ALLOCATE_INITIAL_VALUE): Put PR on stack if prologue clobbers it.
	* sh.md (movsi_media-1): New splitter.

From-SVN: r70204
2003-08-06 20:33:13 +01:00
J"orn Rennecke fada196198 prologue / epilogue / warning patches:
2003-07-16  J"orn Rennecke <joern.rennecke@superh.com>
	    Con Bradley <con.bradley@superh.com>

	* sh-protos.h (sh_get_pr_initial_val): Declare.
	* sh.c (regno_reg_class): Make its elements type enum reg_class.
	(output_stack_adjust): Remove emit_fn argument.  Add epilogue_p
	and live_regs_mask arguments.  Changed all callers.
	(save_schedule_s): New structure.
	(save_schedule): New typedef.
	(scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions.
	(calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p.
	In interrupts handlers, also save registers that are usually
	partially saved, and make sure there is at least one general purpose
	register saved if a target register needs saving.
	Add casts in comparisons to avoid warnings.
	(sh_media_register_for_return): return -1 for interrupt handlers.
	(MAX_SAVED_REGS, MAX_TEMPS): New defines.
	(sh_expand_prologue): Use sh5_schedule_saves.  Check that any temp
	registers used are available.
	Set RTX_FRAME_RELATED_P where appropriate.
	Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing.
	(sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves.
	(initial_elimination_offset): Likewise.
	* sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4.
	(LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings.
	(FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO.
	(XD_REGISTER_P, TARGET_REGISTER_P): Likewise.
	(HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15,
	and for target registers.
	(RETURN_IN_MEMORY): Add parentheses to avoid warnings.
	(regno_reg_class): Make its elements type enum reg_class.
	(CONSTRAINT_LEN): Don't use isdigit.
	(FUNCTION_ARG_REGNO_P): Add casts to avoid warnings.
	(FUNCTION_ARG): Add parentheses to avoid warnings.
	(RETURN_ADDR_RTX): Use sh_get_pr_initial_val.
	(RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5.
	(SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings.
	(EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings.
	* sh.md (xordi3+1): Remove unused variable regno.
	(return_media): Check that tr0 is available before using it.

Co-Authored-By: Con Bradley <con.bradley@superh.com>

From-SVN: r69480
2003-07-16 22:41:20 +01:00
Kaveh R. Ghazi e97a46ce6c arm.c (arm_init_iwmmxt_builtins, [...]): Use ARRAY_SIZE.
* config/arm/arm.c (arm_init_iwmmxt_builtins, arm_expand_builtin):
	Use ARRAY_SIZE.
	* config/frv/frv.c (frv_expand_builtin): Likewise.
	* config/sh/sh.c (sh_media_init_builtins): Likewise.

From-SVN: r69194
2003-07-10 18:04:25 +00:00
Kazu Hirata fae778eb67 2064.md: Fix comment typos.
* config/s390/2064.md: Fix comment typos.
	* config/s390/2084.md: Likewise.
	* config/s390/s390.c: Likewise.
	* config/s390/s390.md: Likewise.
	* config/sh/sh.c: Likewise.
	* config/sh/sh.h: Likewise.
	* config/sh/sh.md: Likewise.
	* config/sparc/sparc.c: Likewise.
	* config/sparc/sparc.h: Likewise.
	* config/sparc/sparc.md: Likewise.
	* config/stormy16/stormy16.c: Likewise.
	* config/stormy16/stormy16.h: Likewise.
	* config/stormy16/stormy-abi: Fix a typo.

From-SVN: r68887
2003-07-03 16:25:52 +00:00
Nathan Sidwell 2e04021970 rtl.h (emit_note): Remove FILE parameter.
* rtl.h (emit_note): Remove FILE parameter.
	* emit-rtl.c (emit_line_note): Adjust emit_note call.
	(emit_note): Remove FILE parameter. Adjust.
	* builtins.c (expand_builtin_expect): Adjust emit_note call.
	* c-semantics.c (genrtl_scope_stmt): Likewise.
	(expand_stmt): Likewise.
	* cfglayout.c (reemit_insn_block_notes): Likewise.
	(duplicate_insn_chain): Likewise.
	* except.c (expand_eh_region_start, expand_eh_region_end,
	sjlj_emit_function_enter): Likewise.
	* explow.c (probe_stack_range): Likewise.
	* expr.c (emit_block_move_via_loop): Likewise.
	* function.c (init_function_start, expand_function_start,
	expand_function_end, thread_prologue_and_epilogue_insns): Likewise.
	* integrate.c (expand_inline_function, copy_insn_list): Likewise.
	* reg-stack.c (compensate_edge): Likewise.
	* reload1.c (reload): Likewise.
	* rtlanal.c (hoist_insn_to_edge): Likewise.
	* stmt.c (expand_fixup, expand_start_loop, expand_start_null_loop,
	expand_loop_continue_here, expand_end_loop, expand_continue_loop,
	expand_exit_loop_top_cond, expand_value_return,
	expand_start_bindings_and_block, expand_end_bindings,
	expand_decl_cleanup, expand_start_case): Likewise.
	* unroll.c (copy_loop_body
	* config/alpha/alpha.c (alpha_output_mi_thunk_osf): Likewise.
	* config/ia64/ia64.c (ia64_output_mi_thunk): Likewise.
	* config/rs6000/rs6000.c (rs6000_emit_eh_toc_restore,
	rs6000_emit_allocate_stack, rs6000_output_function_prologue,
	rs6000_output_function_epilogue, rs6000_output_mi_thunk): Likewise.
	* config/sh/sh.c (sh_output_mi_thunk): Likewise.
	* config/sparc/sparc.c (sparc_output_mi_thunk): Likewise.

	* ada/misc.c (record_code_position): Likewise.

From-SVN: r68561
2003-06-27 09:49:44 +00:00
Dhananjay Deshpande b1dcf523e9 sh.c (sh_register_move_cost): Add case for moving between MAC_REGS.
2003-06-25	Dhananjay Deshpande <dhananjayd@kpitcummins.com>

	* config/sh/sh.c (sh_register_move_cost):
	Add case for moving between MAC_REGS.

From-SVN: r68484
2003-06-25 18:33:35 +01:00
J"orn Rennecke 6d1cb95f3f Back out these patches:
2003-06-02  J"orn Rennecke <joern.rennecke@superh.com>
          * sh.h (OLD_ARG_MODE): New macro.
          (FUNCTION_ARG_ADVANCE, FUNCTION_ARG_PASS_BY_REFERENCE): Use it.
          (FUNCTION_ARG_1): Break out of:
          (FUNCTION_ARG).  Use OLD_ARG_MODE.
	 2003-06-06  J"orn Rennecke <joern.rennecke@superh.com>
          * sh.h (FUNCTION_ARG_1): Consistently use NEW_MODE for the mode
          of the generated register.

	* sh.h (FUNCTION_ARG_SCmode_WART): Define.
	(FUNCTION_ARG): Unless FUNCTION_ARG_SCmode_WART is defined and
	an even number of floating point regs are in use, use the same
	sequence of argument passing registers for SCmode as would be
	used for two SFmode values.
	* sh.c (sh_va_arg): If FUNCTION_ARG_SCmode_WART is defined,
	swap real / imaginary parts in incoming SCmode values passed
	in registers.

From-SVN: r68430
2003-06-24 18:22:05 +01:00
Richard Henderson a3424f5c1e hooks.c (hook_int_void_no_regs): Rename from hook_reg_class_void_no_regs; change return type.
* hooks.c (hook_int_void_no_regs): Rename from
        hook_reg_class_void_no_regs; change return type.
        * hooks.h: Update.
        * target-def.h (TARGET_BRANCH_TARGET_REGISTER_CLASS): Update.
        * target.h (branch_target_register_class): Change return type to int.
        Add documentation.
        * config/sh/sh.c (sh_target_reg_class): Change return type.
        * doc/tm.texi (TARGET_BRANCH_TARGET_REGISTER_CLASS): Likewise.

From-SVN: r68275
2003-06-20 10:30:05 -07:00
Zack Weinberg 1bc7c5b629 target.h (asm_out.file_start, [...]): New hooks.
* target.h (asm_out.file_start, file_start_app_off,
	file_start_file_directive): New hooks.
	* target-def.h (TARGET_ASM_FILE_START_FILE_DIRECTIVE,
	TARGET_ASM_FILE_START_APP_OFF, TARGET_ASM_FILE_START):
	New hook-definition macros.
	* doc/tm.texi: Document new hooks; remove docs of ASM_FILE_START.
	* varasm.c (default_file_start): New.
	* output.h: Prototype it.
	* toplev.c (init_asm_output): Use targetm.asm_out.file_start.
	* system.h: Poison ASM_FILE_START.

	* config/alpha/alpha.c (alpha_write_verstamp): Delete.
	(alpha_file_start): New, define if !TARGET_ABI_UNICOSMK.
	(unicosmk_asm_file_start): Rename unicosmk_file_start,
	make static, take no arguments.
	(TARGET_ASM_FILE_START, TARGET_ASM_FILE_END,
	TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set as appropriate.
	* config/alpha/unicosmk.h: Don't define ASM_FILE_START nor
	TARGET_ASM_FILE_END.  Remove reference to ASM_FILE_START in
	comment.
	* config/arc/arc.c (arc_asm_file_start): Rename
	arc_file_start, take no arguments, make static.
	(TARGET_ASM_FILE_START): Set it.
	* config/arm/arm.c (aof_file_start): New static function.
	(TARGET_ASM_FILE_START): Set it, when appropriate.
	* config/arm/coff.h, config/arm/elf.h:
	Set TARGET_ASM_FILE_START_APP_OFF to true.
	* config/avr/avr.c (asm_file_start): Rename avr_file_start,
	take no arguments, make static.
	(TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE):
	Set them.
	* config/c4x/c4x.c (c4x_file_start): New static function.
	(TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE):
	Set them.
	* config/cris/cris.c (cris_file_start): New static function.
	(TARGET_ASM_FILE_START): Set it.
	* config/dsp16xx/dsp16xx.c (coff_dsp16xx_file_start): Rename
	dsp16xx_file_start, make static.
	(luxworks_dsp16xx_file_start): Delete.
	(TARGET_ASM_FILE_START): Set it.
	* config/h8300/h8300.c (asm_file_start): Rename
	h8300_file_start, make static, take no arguments.
	(TARGET_ASM_FILE_START): Set it.
	* config/i370/i370.c (i370_file_start): New static function.
	(TARGET_ASM_FILE_START): Set it.
	* config/i386/i386.c (x86_file_start): New static function.
	(TARGET_ASM_FILE_START): Set it.
	* config/i386/i386.h (X86_FILE_START_VERSION_DIRECTIVE,
	X86_FILE_START_FLTUSED): New macros, default to false.
	* config/i386/i386-interix.h: Override X86_FILE_START_FLTUSED to 1.
	* config/i386/sysv4.h, config/i386/sco5.h: Override
	X86_FILE_START_VERSION_DIRECTIVE to true.
	* config/ia64/ia64.c (ia64_file_start): New static function.
	(TARGET_ASM_FILE_START): Set it.
	(emit_safe_across_calls): Take no arguments.
	* config/ia64/ia64.md: Update to match.
	* config/m32r/m32r.c (m32r_asm_file_start): Rename
	m32r_file_start, make static, take no arguments.
	(TARGET_ASM_FILE_START): Set it.
	* config/m68hc11/m68hc11.c (m68hc11_asm_file_start): Rename
	m68hc11_file_start, make static, take no arguments.
	(TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set.
	(print_options): Delete.
	* config/m68k/m68k.c (m68k_hp320_file_start): New static function.
	(TARGET_ASM_FILE_START_APP_OFF): Set.
	* config/m68k/hp320.h: Set TARGET_ASM_FILE_START to
	m68k_hp320_file_start.
	* config/mips/mips.c (iris6_asm_file_start, mips_asm_file_start):
	Make static, take no arguments.
	(TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set.
	* config/mmix/mmix.c (mmix_asm_file_start): Rename
	mmix_file_start, make static, take no arguments.
	(TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set.
	* config/mn10300/mn10300.c (asm_file_start): Rename
	mn10300_file_start, make static, take no arguments.
	(TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set.
	* config/ns32k/ns32k.c (TARGET_ASM_FILE_START_APP_OFF): Set.
	* config/pa/pa.c (pa_file_start_level, pa_file_start_space,
	pa_file_start_file, pa_file_start_mcount, pa_elf_file_start,
	pa_som_file_start, pa_linux_file_start, pa_hpux64_gas_file_start,
	pa_hpux64_hpas_file_start): New static functions.
	* config/pa/elf.h: Set TARGET_ASM_FILE_START to pa_elf_file_start.
	* config/pa/pa-linux.h: Set TARGET_ASM_FILE_START to
	pa_linux_file_start.
	* config/pa/pa64-hpux.h: Set TARGET_ASM_FILE_START to
	pa_hpux64_gas_file_start or pa_hpux64_hpas_file_start, as
	appropriate.
	* config/pa/som.h: Set TARGET_ASM_FILE_START to pa_som_file_start.
	* config/rs6000/rs6000.c: Include xcoffout.h when TARGET_XCOFF.
	(rs6000_file_start): Make static, take no arguments.  Reset
	default_cpu under certain conditions.
	(rs6000_xcoff_file_start): New function.
	* config/rs6000/rs6000.h (TARGET_ASM_FILE_START): Set.
	* config/rs6000/xcoff.h (TARGET_ASM_FILE_START,
	TARGET_ASM_FILE_START_FILE_DIRECTIVE): Override.
	* config/sh/sh.c (output_file_start): Rename
	sh_file_start, make static, take no arguments.  Merge in old
	code from sh/elf.h's ASM_FILE_START, conditioned on TARGET_ELF.
	(TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set.
	* config/sh/sh.c (TARGET_ELF): Define to 0.
	* config/sh/elf.h (TARGET_ELF): Redefine to 1.
	* config/v850/v850.c (asm_file_start): Delete.
	(TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set.
	* config/vax/vax.c (vax_file_start): New static function.
	(TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_APP_OFF): Set.

	* config/darwin.h: Override ASM_FILE_START_FILE_DIRECTIVE to false.
	* config/elfos.h, config/svr3.h, config/arm/elf.h, config/arm/pe.h
	* config/i386/att.h, config/i386/gas.h, config/i386/linux.h
	* config/i386/sysv4.h, config/i386/sco5.h, config/i960/i960-coff.h
	* config/m68k/coff.h, config/m68k/hp320.h, config/mcore/mcore-pe.h
	* config/vax/vaxv.h: Set ASM_FILE_START_FILE_DIRECTIVE to true.

	* config/darwin.h, config/elfos.h, config/alpha/elf.h
	* config/alpha/openbsd.h, config/alpha/osf.h, config/alpha/vms.h
	* config/arc/arc.h, config/arm/aof.h, config/arm/aout.h
	* config/arm/coff.h, config/arm/elf.h, config/arm/pe.h
	* config/avr/avr.h, config/c4x/c4x.h, config/cris/cris.h
	* config/dsp16xx/dsp16xx.h, config/h8300/elf.h, config/h8300/h8300.h
	* config/i370/i370.h, config/i386/att.h, config/i386/gas.h
	* config/i386/i386-interix.h, config/i386/linux.h, config/i386/sysv4.h
	* config/i386/sco5.h, config/i960/i960-coff.h, config/i960/i960.h
	* config/ia64/ia64.h, config/ia64/sysv4.h, config/m32r/m32r.h
	* config/m68hc11/m68hc11.h, config/m68k/coff.h, config/m68k/m68k.h
	* config/mcore/mcore-pe.h, config/mips/iris6.h, config/mips/mips.h
	* config/mmix/mmix.h, config/mn10300/mn10300.h, config/ns32k/ns32k.h
	* config/pa/elf.h, config/pa/pa-linux.h, config/pa/pa64-hpux.h
	* config/pa/som.h, config/pdp11/pdp11.h, config/rs6000/linux64.h
	* config/rs6000/lynx.h, config/rs6000/xcoff.h, config/sh/elf.h
	* config/sh/sh.h, config/sparc/sparc.h, config/v850/v850.h
	* config/vax/vax.h, config/vax/vaxv.h: Don't (re)define ASM_FILE_START.

	* config/alpha/alpha-protos.h, config/arc/arc-protos.h
	* config/avr/avr-protos.h, config/dsp16xx/dsp16xx-protos.h
	* config/h8300/h8300-protos.h, config/ia64/ia64-protos.h
	* config/m32r/m32r-protos.h, config/m68hc11/m68hc11-protos.h
	* config/mips/mips-protos.h, config/mmix/mmix-protos.h
	* config/mn10300/mn10300-protos.h, config/rs6000/rs6000-protos.h
	* config/sh/sh-protos.h, config/v850/v850-protos.h: Update.

	* xcoffout.h, config/rs6000/aix.h, config/rs6000/xcoff.h:
	Remove reference to ASM_FILE_START in comment.
	* config/arm/aof.h, config/arm/aout.h, config/arm/freebsd.h
	* config/arm/linux-gas.h, config/arm/netbsd-elf.h
	* config/arm/netbsd.h: Delete definition of ARM_OS_NAME.

From-SVN: r68229
2003-06-19 21:47:26 +00:00
Stephen Clarke fe3ad57221 bt-load.c: New file.
2003-06-18  Stephen Clarke <stephen.clarke@superh.com>
            J"orn Rennecke <joern.rennecke@superh.com>

	* bt-load.c: New file.
	* Makefile.in (OBJS): Include bt-load.o
	(bt-load.o): Add dependencies.
	* flags.h (flag_branch_target_load_optimize): Declare.
	(flag_branch_target_load_optimize2): Likewise.
	* hooks.c (hook_reg_class_void_no_regs): New function.
	(hook_bool_bool_false): Likewise.
	* hooks.h (hook_reg_class_void_no_regs, hook_bool_bool_false): Declare.
	* rtl.h (branch_target_load_optimize): Declare.
	* target-def.h (TARGET_BRANCH_TARGET_REGISTER_CLASS): Define.
	(TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED): Likewise.
	(TARGET_INITIALIZER): Include these.
	* target.h (struct gcc_target): Add branch_target_register_class
	and branch_target_register_callee_saved members.
	* toplev.c (enum dump_file_index): Add DFI_branch_target_load
	(dump_file) Add "tars" entry.
	(flag_branch_target_load_optimize): New variable.
	(flag_branch_target_load_optimize2): Likewise.
	(lang_independent_options): Add entries for new options.
	(rest_of_compilation): Call branch_target_load_optimize.
	* doc/tm.texi (TARGET_BRANCH_TARGET_REGISTER_CLASS): Document.
	(TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED): Likewise.
	* doc/invoke.texi: Document -fbranch-target-load-optimize and
	-fbranch-target-load-optimize2.
	* rtl.h (epilogue_completed): Declare.
	* recog.c (epilogue_completed): New variable.
	* toplev.c (rest_of_compilation): Set it.
	* flow.c (mark_regs_live_at_end): Use it.
	* config/ia64/ia64.c (ia64_output_mi_thunk): Set it.
	* config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise.
	* config/sh/sh.c (sh_output_mi_thunk): Likewise.
	* config/sparc/sparc.c (sparc_output_mi_thunk): Likewise.

	* sh.c (shmedia_space_reserved_for_target_registers): New variable.
	(sh_target_reg_class): New function.
	(sh_optimize_target_register_callee_saved): Likwise.
	(shmedia_target_regs_stack_space): Likewise.
	(shmedia_reserve_space_for_target_registers_p): Likewise.
	(shmedia_target_regs_stack_adjust): Likewise.
	(TARGET_BRANCH_TARGET_REGISTER_CLASS): Override.
	(TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED): Likewise.
	(calc_live_regs): If flag_branch_target_load_optimize2 and
	TARGET_SAVE_ALL_TARGET_REGS is enabled, and we have space reserved
	for target registers, make sure that we save all target registers.
	(sh_expand_prologue, sh_expand_epilogue): Take target register
	optimizations into account.  Collapse stack adjustments if that
	is beneficial.
	(initial_elimination_offset): Reserve space for target registers
	if necessary.
	* sh.h (SAVE_ALL_TR_BIT, TARGET_SAVE_ALL_TARGET_REGS): Define.
	(OPTIMIZATION_OPTIONS): Enable flag_branch_target_load_optimize.

Co-Authored-By: J"orn Rennecke <joern.rennecke@superh.com>

From-SVN: r68165
2003-06-18 20:43:55 +01:00
Kazu Hirata c8f0269d46 coff.h: Replace Hitachi with Renesas.
* config/sh/coff.h: Replace Hitachi with Renesas.
	* config/sh/elf.h: Likewise.
	* config/sh/embed-elf.h: Likewise.
	* config/sh/lib1funcs.asm: Likewise.
	* config/sh/sh-protos.h: Likewise.
	* config/sh/sh.c: Likewise.
	* config/sh/sh.h: Likewise.
	* config/sh/sh.md: Likewise.

From-SVN: r68107
2003-06-17 19:19:16 +00:00
J"orn Rennecke 735cb76eba sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT).
* sh.h (REG_CLASS_FROM_LETTER): Change to:
	(REG_CLASS_FROM_CONSTRAINT).
	(CONST_OK_FOR_I): Rename to:
	(CONST_OK_FOR_I08).  Changed all users.
	(CONST_OK_FOR_J): Rename to:
	(CONST_OK_FOR_I16).  Changed all users.
	(CONST_OK_FOR_K): Rename to:
	(CONST_OK_FOR_P27).  Changed all users.
	(CONST_OK_FOR_L): Rename to:
	(CONST_OK_FOR_K08).  Changed all users.
	(CONST_OK_FOR_O): Rename to:
	(CONST_OK_FOR_I06).  Changed all users.
	(CONST_OK_FOR_P): Rename to:
	(CONST_OK_FOR_I10).  Changed all users.
	(CONSTRAINT_LEN, CONST_OK_FOR_I, CONST_OK_FOR_J16): Define.
	(CONST_OK_FOR_J, CONST_OK_FOR_K, CONST_OK_FOR_P): Likewise.
	(EXTRA_CONSTRAINT_A, EXTRA_CONSTRAINT_Bsc): Likewise.
	(EXTRA_CONSTRAINT_B, PIC_OFFSET_P, PIC_DIRECT_ADDR_P): Likewise.
	(EXTRA_CONSTRAINT_Cpg, EXTRA_CONSTRAINT_C): Likewise.
	(EXTRA_MEMORY_CONSTRAINT,(EXTRA_CONSTRAINT_Sr0): Likewise.
	(CONST_OK_FOR_LETTER_P): Replace with
	(CONST_OK_FOR_CONSTRAINT_P).
	(EXTRA_CONSTRAINT_S): Rename to:
	(EXTRA_CONSTRAINT_C16).  Changed all users.
	(MOVI_SHORI_BASE_OPERAND_P): Don't allow direct addresses.
	(EXTRA_CONSTRAINT_T): Rename to:
	(EXTRA_CONSTRAINT_Csy).  Changed all users.
	(EXTRA_CONSTRAINT_Z): Remove.
	(EXTRA_CONSTRAINT): Replace with:
	(EXTRA_CONSTRAINT_STR).
	(EXTRA_CONSTRAINT_U): Rename to:
	 (EXTRA_CONSTRAINT_Z).  Changed all users.
	* sh.c (and_operand): Use CONST_OK_FOR_J16.
	* sh.md (cmpeqsi_t-1, cmpeqsi_t, adddi3_media): Use new constraints.
	(addsi3_media, addsi3_compact, andsi3_compact, anddi3): Likewise.
	(iorsi3, iordi3, xorsi3, xordi3, ashlsi3_std, ashlhi3_k): Likewise.
	(lshrsi3_k, movsi_i, movsi_ie, movsi_i_lowpart, movsi_media): Likewise.
	(movsi_media_nofpu, movqi_media, movhi_i, movhi_media): Likewise.
	(*movdi_i, movdi_media, movdi_media_nofpu, shori_media): Likewise.
	(movdf_media, movdf_media_nofpu, movv2sf_i, movv4sf_i): Likewise.
	(movsf_media, movsf_media_nofpu, movsi_y, beq_media): Likewise.
	(beq_media_i, bne_media, pt, ptb, movv8qi_i, movv2hi_i): Likewise.
	(movv4hi_i, movv2si_i, negcmpeqv8qi, negcmpeqv2si): Likewise.
	(negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si, negcmpgtv4hi): Likewise.
	(mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub, mextr_rl, mextr_lr): Likewise.
	(mextr1, mextr2, mextr3, mextr4, mextr5, mextr6, mextr7): Likewise.
	(mperm_w, mperm_w_little, mperm_w_big, msad_ubq_i): Likewise.
	(mshards_q, mshfhi_b, mshflo_b, mshf4_b, mshf0_b, mshfhi_l): Likewise.
	(mshflo_l, mshf4_l, mshf0_l, mshfhi_w, mshflo_w, mshf4_w): Likewise.
	(mshf0_w, mshflo_w_x, mshfhi_l_di, mshfhi_l_di_rev): Likewise.
	(mshflo_l_di_rev, mshflo_l_di_x, concat_v2sf): Likewise.
	(mshflo_l_di_x_rev, subv2si3, subv4hi3, sssubv2si3): Likewise.
	(sssubv4hi3): Likewise.
	(movsf_i): Change I[08]/r to G/r.
	(movsf_ie): Change f/{G,H}/c/X to f/{G,H}/c/Bsc.

	* sh.c (sh_output_mi_thunk): Use CONST_OK_FOR_ADD.

From-SVN: r68022
2003-06-16 17:23:30 +01:00
J"orn Rennecke 266a27326f sh.c (prepare_move_operand): Check if operand 0 is an invalid memory reference.
* sh.c (prepare_move_operand): Check if operand 0 is an invalid
	memory reference.  Fix test that checks if operand 1 is using r0.
	* sh.md (movhi_i): Don't allow st.w r0,@(rX,rY) .

From-SVN: r68017
2003-06-16 15:56:38 +01:00
Andrew Pinski 117dca74cc t-rs6000: Add dependence of cfglayout.h to rs6000.o.
* config/rs6000/t-rs6000: Add dependence of cfglayout.h to rs6000.o.
        * config/rs6000/rs6000.c: Include cfglayout.h.
        * config/alpha/alpha.c: Likewise.
        * config/ia64/ia64.c: Likewise.
        * config/sparc/sparc.c: Likewise.
        * config/sh/sh.c: Likewise.

From-SVN: r67982
2003-06-15 11:01:57 -07:00
Richard Henderson a2855205a5 alpha.c (alpha_output_mi_thunk_osf): Call insn_locators_initialize.
* config/alpha/alpha.c (alpha_output_mi_thunk_osf): Call
        insn_locators_initialize.
        * config/ia64/ia64.c (ia64_output_mi_thunk): Likewise.
        * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise.
        * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise.
        * config/sh/sh.c (sh_output_mi_thunk): Do it later.

From-SVN: r67969
2003-06-15 00:36:43 -07:00
J"orn Rennecke 9053436180 sh-protos.h (function_symbol): Declare.
* sh-protos.h (function_symbol): Declare.
	* sh.c (expand_block_move, expand_ashiftrt): Use it.
	(sh_expand_prologue, sh_expand_epilogue): Likewise.
	(sh_initialize_trampoline): Likewise.
	(function_symbol): New function.
	* sh.md (udivsi3, divsi3, mulsi3, ic_invalidate_line): Use it.
	(initialize_trampoline, call, call_pop, call_value, sibcall): Likewise.
	(call_value_pop, shcompact_return_tramp): Likewise.

	* sh.h (OVERRIDE_OPTIONS): Don't suppress --profile-arc-flag.

	* sh.md (GOTaddr2picreg): Use gen_lowpart to get lowpart of
	target register.

From-SVN: r67732
2003-06-10 21:53:33 +01:00