Commit Graph

451 Commits

Author SHA1 Message Date
Daniel Berlin 6fb5fa3cbc Merge dataflow branch into mainline
From-SVN: r125624
2007-06-11 18:02:15 +00:00
Richard Sandiford 09e18274fd regs.h (end_hard_regno): New function.
gcc/
	* regs.h (end_hard_regno): New function.
	(END_HARD_REGNO, END_REGNO): New macros.
	(add_to_hard_reg_set): New function.
	(remove_from_hard_reg_set): Likewise.
	(in_hard_reg_set_p): Likewise.
	(overlaps_hard_reg_set_p): Likewise.
	* bt-load.c (find_btr_reference): Use overlaps_hard_reg_set_p.
	(note_btr_set): Use END_HARD_REGNO.
	* caller-save.c (setup_save_areas): Use end_hard_regno.
	(mark_set_regs): Use END_HARD_REGNO.
	(add_stored_regs): Use end_hard_regno.
	(mark_referenced_regs): Use add_to_hard_reg_set.
	* combine.c (update_table_tick): Use END_REGNO.
	(record_value_for_reg): Likewise.
	(record_dead_and_set_regs): Likewise.
	(get_last_value_validate): Likewise.
	(use_crosses_set_p): Likewise.
	(reg_dead_at_p_1): Likewise.
	(reg_dead_at_p): Likewise.
	(mark_used_regs_combine): Use add_to_hard_reg_set.
	(move_deaths): Use END_HARD_REGNO.
	(reg_bitfield_target_p): Use end_hard_regno.
	(distribute_notes): Use END_HARD_REGNO.
	* cse.c (mention_regs): Use END_REGNO.
	(insert): Use add_to_hard_reg_set.
	(invalidate): Use END_HARD_REGNO.
	(invalidate_for_call): Likewise.
	(exp_equiv_p): Use END_REGNO.
	(cse_insn): Likewise.
	* cselib.c (cselib_invalidate_regno): Use end_hard_regno.
	* df-problems.c (df_urec_mark_reg_change): Use END_HARD_REGNO.
	* df-scan.c (df_ref_record): Use END_HARD_REGNO.
	* function.c (keep_stack_depressed): Use end_hard_regno.
	* global.c (global_alloc): Use end_hard_regno.
	(global_conflicts): Use add_to_hard_reg_set instead of
	mark_reg_live_nc.
	(find_reg): Likewise.
	(mark_reg_store): Likewise.
	(mark_reg_conflicts): Likewise.
	(mark_reg_death): Use remove_from_hard_reg_set.
	(mark_reg_live_nc): Delete.
	(set_preference): Use end_hard_regno.
	* local-alloc.c (mark_life): Use add_to_hard_reg_set and
	remove_from_hard_reg_set.
	(post_mark_life): Use add_to_hard_reg_set.
	* mode-switching.c (reg_dies): Use remove_from_hard_reg_set.
	(reg_becomes_live): Use add_to_hard_reg_set.
	* recog.c (reg_fits_class_p): Use in_hard_reg_set_p.
	(peep2_find_free_register): Use add_to_hard_reg_set.
	* reg-stack.c (convert_regs_exit): Use END_HARD_REGNO.
	* regclass.c (record_reg_classes): Use in_hard_reg_set_p.
	* regrename.c (note_sets): Use add_to_hard_reg_set.
	(clear_dead_regs): Use remove_from_hard_reg_set.
	(regrename_optimize): Use add_to_hard_reg_set.
	(find_oldest_value_reg): Use in_hard_reg_set_p.
	* reload.c (push_reload): Use in_hard_reg_set_p and end_hard_regno.
	(hard_reg_set_here_p): Use end_hard_regno.
	(decompose): Likewise.
	(reg_overlap_mentioned_for_reload_p): Use END_HARD_REGNO.
	(find_equiv_reg): Use in_hard_reg_set_p and end_hard_regno.
	* reload1.c (compute_use_by_pseudos): Use add_to_hard_reg_set.
	(mark_home_live): Use end_hard_regno.
	(spill_hard_reg): Likewise.
	(clear_reload_reg_in_use): Likewise.
	* reorg.c (delete_prior_computation): Use END_REGNO.
	* resource.c (update_live_status): Use END_HARD_REGNO.
	(mark_referenced_resources): Use add_to_hard_reg_set.
	(mark_set_resources): Likewise.
	(mark_target_live_regs): Likewise.  Use remove_from_hard_reg_set.
	* rtlanal.c (refers_to_regno_p): Use END_REGNO.
	(reg_overlap_mentioned_p): Likewise.
	(dead_or_set_p): Likewise.  Use an exclusive upper loop bound.
	(covers_regno_no_parallel_p): Use END_REGNO.
	(find_regno_note): Likewise.
	(find_reg_fusage): Use END_HARD_REGNO.
	* stmt.c (decl_overlaps_hard_reg_set_p): Use overlaps_hard_reg_set_p.
	* var-tracking.c (emit_note_insn_var_location): Use end_hard_regno.

From-SVN: r124961
2007-05-22 20:52:39 +00:00
Steve Ellcey 0fa4cb7dd9 re PR target/31850 (gcc.c-torture/compile/limits-fnargs.c is slow at compiling for spu-elf)
PR target/31850
	* reload.c (subst_reloads): Remove checking.

From-SVN: r124810
2007-05-17 20:29:34 +00:00
Kaz Kojima 10050f74a3 re PR rtl-optimization/28011 ([SH] g++ generates wrong code, if '-fno-exceptions' and '-O' options are specified)
PR rtl-optimization/28011
	* reload.c (push_reload): Set dont_share if IN appears in OUT
	also when IN is a PLUS rtx.
	(reg_overlap_mentioned_for_reload_p): Return true if X and IN
	are same PLUS rtx.

From-SVN: r124557
2007-05-08 22:22:49 +00:00
Richard Sandiford 8c74fb06c6 reload.h (elimination_target_reg_p): Declare.
gcc/
	* reload.h (elimination_target_reg_p): Declare.
	* reload.c (find_reloads): Don't apply the reg_rtx move
	optimization if the SET_DEST satisfies elimination_target_reg_p.
	* reload1.c (elimination_target_reg_p): New function.
	(gen_reload): In the move/add2 fallback, make sure that op0
	does not overlap the destination register.

From-SVN: r124215
2007-04-27 11:39:47 +00:00
Ian Lance Taylor f5c3dc96c3 re PR target/28675 (ICE in extract_insn, at recog.c:2084 (unrecognizable insn) [arm])
gcc/:
	PR target/28675
	* reload.c (find_reloads_subreg_address): If the address was valid
	in the original mode but not in the new mode, reload the whole
	address.
testsuite/:
	PR target/28675
	* gcc.c-torture/compile/pr28675.c: New test.

From-SVN: r124211
2007-04-27 04:11:47 +00:00
Bernd Schmidt c1673e1b5a reload.c (combine_reloads): When trying to use a dying register...
* reload.c (combine_reloads): When trying to use a dying register,
	check whether it's uninitialized and don't use if so.

From-SVN: r123986
2007-04-20 00:08:46 +00:00
Bernd Schmidt 0f4b25a3e3 reload.c (find_reloads_toplev, [...]): Use rtx_equal_p...
* reload.c (find_reloads_toplev, find_reloads_address,
	find_reloads_address_1, find_reloads_subreg_address): Use rtx_equal_p,
	not a pointer equality test, to decide if we need to call
	push_reg_equiv_alt_mem.

From-SVN: r123724
2007-04-11 19:44:07 +00:00
Ulrich Weigand b098aaf2ae reload.c (find_reloads_address_1): Handle PLUS expressions resulting from register elimination as PRE_MODIFY /...
* reload.c (find_reloads_address_1): Handle PLUS expressions resulting
	from register elimination as PRE_MODIFY / POST_MODIFY increments.
	Do not attempt to handle MEM inside auto-inc expressions.
	* reload1.c (eliminate_regs_1): Do not attempt to handle elimination
	of a register modified by an auto-inc expression.  However, do handle
	elimination of a register used as PRE_MODIFY / POST_MODIFY increment.
	(elimination_effects): Prohibit elimination of a register modified
	by an auto-inc expression.  Disable register elimination rules whose
	target register is modified by an auto-inc expression with variable
	increment.

From-SVN: r122318
2007-02-25 20:56:46 +00:00
Kazu Hirata 9f5ed61a80 c-decl.c, [...]: Fix comment typos.
* c-decl.c, config/avr/avr.c, config/avr/avr.h,
	config/m68k/m68k.c, config/m68k/netbsd-elf.h,
	config/mn10300/mn10300.c, config/pdp11/pdp11.h,
	config/rs6000/cell.md, config/rs6000/darwin.h,
	config/sh/sh.md, config/sh/sh4-300.md, config/spu/spu.c,
	config/spu/spu.md, cselib.c, expr.c, haifa-sched.c, hwint.h,
	jump.c, reload.c, sched-deps.c, sched-int.h, tree-inline.c,
	tree-profile.c, tree-ssa-live.h, tree-vrp.c: Fix comment
	typos.  Follow spelling conventions.
	* doc/invoke.texi: Follow spelling conventions.

From-SVN: r121546
2007-02-03 16:47:06 +00:00
Joseph Myers f1f4e530a5 rtlanal.c (struct subreg_info, [...]): New.
* rtlanal.c (struct subreg_info, subreg_get_info, subreg_nregs):
	New.
	(subreg_regno_offset, subreg_offset_representable_p): Change to
	wrappers about subreg_get_info.
	(refers_to_regno_p, reg_overlap_mentioned_p): Use subreg_nregs.
	* rtl.h (subreg_nregs): Declare.
	* doc/tm.texi (HARD_REGNO_NREGS_HAS_PADDING): Update to refer to
	subreg_get_info.
	* caller-save.c (mark_set_regs, add_stored_regs): Use
	subreg_nregs.
	* df-scan.c (df_ref_record): Use subreg_nregs.
	* flow.c (mark_set_1): Use subreg_nregs.
	* postreload.c (move2add_note_store): Use subreg_nregs.
	* reload.c (decompose, refers_to_regno_for_reload_p,
	reg_overlap_mentioned_for_reload_p): Use subreg_nregs.
	* resource.c (update_live_status, mark_referenced_resources,
	mark_set_resources): Use subreg_nregs.

From-SVN: r120076
2006-12-20 16:25:00 +00:00
Richard Sandiford 4b7b277aff re PR rtl-optimization/28982 (Incorrect reloading of automodification expressions)
gcc/
	PR rtl-optimization/28982
	* reload.c (find_reloads_address_1): Use RELOAD_OTHER for the
	index of a PRE_MODIFY or POST_MODIFY address.
	* reload1.c (inc_for_reload): Use find_replacement on the original
	base and index registers.

gcc/testsuite/
	PR rtl-optimization/28982
	* gcc.c-torture/execute/pr28982a.c: New test.
	* gcc.c-torture/execute/pr28982b.c: Likewise.

From-SVN: r116919
2006-09-13 06:30:59 +00:00
Alexandre Oliva 3f1e3e7010 re PR target/28146 (-O2 produces invalid code on s390-linux-gnu: gcc-4.1.2 20060608)
PR target/28146
* reload.h (reg_equiv_alt_mem_list): New declaration.
* reload1.c (reg_equiv_alt_mem_list): New definition.
(reload): Initialize it and release it.
(delete_output_reload): Use it.
* reload.c (push_reg_equiv_alt_mem): New function.
(find_reloads_toplev): Call it.
(find_reloads_address, find_reloads_address_1): Likewise.
(find_reloads_subreg_address): Likewise.

From-SVN: r116215
2006-08-17 08:55:02 +00:00
Jan Hubicka 71156bccaa re PR rtl-optimization/26655 (ICE in ix86_secondary_memory_needed, at config/i386/i386.c:16446)
PR target/26655
	PR target/28270
	* reload.c (push_reload): Patch out the mismathcing instruction; return early.
	(find_reload): Bail out if the instruction was patched out.

From-SVN: r115928
2006-08-04 17:05:38 +00:00
Roger Sayle 4119019bd7 re PR target/27858 (ICE in spill_failure, at reload1.c:1911while bootstrapping 4.2 on alpha)
PR target/27858
	Revert incorrect fix for PR target/27158
	2006-05-08  Roger Sayle  <roger@eyesopen.com>
	* reload.c (find_reloads_toplev): Only return the simplified SUBREG
	of a reg_equiv_constant if the result is a legitimate constant.

From-SVN: r114559
2006-06-12 02:10:24 +00:00
Andreas Krebbel 6c65d7577c reload.c (find_reloads): Unset force_reload for 'X' constraint.
2006-06-09  Andreas Krebbel  <krebbel1@de.ibm.com>

	* reload.c (find_reloads): Unset force_reload for 'X' constraint.

From-SVN: r114508
2006-06-09 14:23:57 +00:00
Kazu Hirata 6fc0bb99a7 cfgcleanup.c, [...]: Fix comment typos.
* cfgcleanup.c, cfgexpand.c, cgraphunit.c, config/arm/arm.c,
	config/fr30/fr30.md, config/i386/i386-interix.h,
	config/i386/i386.c, config/i386/i386.md, config/sh/superh.h,
	config/sh/superh64.h, config/v850/v850.c, df-core.c,
	df-problems.c, df.h, except.c, final.c, haifa-sched.c,
	lambda-code.c, libgcc2.h, omp-low.c, optabs.c, predict.c,
	reload.c, tree-flow.h, tree-outof-ssa.c, tree-ssa-dce.c,
	tree-ssa-pre.c, tree-vect-transform.c: Fix comment typos.
	Follow spelling conventions.
	* doc/invoke.texi, doc/rtl.texi, doc/tm.texi: Fix typos.
	Follow spelling conventions.

From-SVN: r114168
2006-05-28 17:46:46 +00:00
Ulrich Weigand 7c7ce73aa7 re PR rtl-optimization/27661 (ICE in subst_reloads)
PR rtl-optimization/27661
	* reload.c (find_reloads): When reloading a VOIDmode constant
	as address due to an EXTRA_MEMORY_CONSTRAINT or 'o' constraint,
	use Pmode as mode of the reload register.

	PR rtl-optimization/27661
	* gcc.dg/pr27661.c: New test case.

From-SVN: r114141
2006-05-26 20:21:53 +00:00
Roger Sayle 857e575351 re PR target/27158 (ICE in extract_insn with -maltivec)
PR target/27158
	* reload.c (find_reloads_toplev): Only return the simplified SUBREG
	of a reg_equiv_constant if the result is a legitimate constant.

	* gcc.target/powerpc/pr27158.c: New test case.

From-SVN: r113632
2006-05-08 21:09:49 +00:00
Richard Guenther 71a9b19ae8 re PR target/26826 (ICE in reg_or_subregno, at jump.c:2011)
2006-04-17  Richard Guenther  <rguenther@suse.de>

	PR target/26826
	* reload.c (push_reload): Guard calls to get_secondary_mem
	for memory subregs.

From-SVN: r113007
2006-04-17 13:53:19 +00:00
Alan Modra e17e34d8d7 reload.c (find_dummy_reload): Fix typo in 2006-04-03 change.
* reload.c (find_dummy_reload): Fix typo in 2006-04-03 change.

From-SVN: r112705
2006-04-06 00:15:12 +09:30
Paolo Bonzini b5c82fa138 re PR target/19653 (x87 reg allocated for constants for -mfpmath=sse)
2005-08-08  Paolo Bonzini  <bonzini@gnu.org>
	    Dale Johannesen  <dalej@apple.com>

	PR target/19653
	* regclass.c (struct reg_pref): Update documentation.
	(regclass): Set prefclass to NO_REGS if memory is the best option.
	(record_reg_classes): Cope with a prefclass set to NO_REGS.
	* reload.c (find_reloads): Take PREFERRED_OUTPUT_RELOAD_CLASS
	into account.  For non-registers, equate an empty preferred
	reload class to a `!' in the constraint; move the if clause to
	do so after those that reject the insn.
	(push_reload): Allow PREFERRED_*_RELOAD_CLASS to liberally
	return NO_REGS.
	(find_dummy_reload): Likewise.
	* doc/tm.texi (Register Classes): Document what it means
	if PREFERRED_*_RELOAD_CLASS return NO_REGS.
	* config/i386/i386.c (ix86_preferred_reload_class): Force
	using SSE registers (and return NO_REGS for floating-point
	constants) if math is done with SSE.
	(ix86_preferred_output_reload_class): New.
	* config/i386/i386-protos.h (ix86_preferred_output_reload_class): New.
	* config/i386/i386.h (PREFERRED_OUTPUT_RELOAD_CLASS): New.
	* config/i386/i386.md: Remove # register preferences.


Co-Authored-By: Dale Johannesen <dalej@apple.com>

From-SVN: r112637
2006-04-03 11:20:07 +00:00
Bernd Schmidt c4963a0a32 bfin-protos.h (bfin_dsp_memref_p): Declare.
* config/bfin/bfin-protos.h (bfin_dsp_memref_p): Declare.
	* config/bfin/bfin.c (bfin_dsp_memref_p): New function.
	(bfin_valid_reg_p): Test for pseudos explicitly and use only
	REGNO_MODE_CODE_OK_FOR_BASE_P.  New args MODE and OUTER_CODE; all
	callers changed.
	* config/bfin/bfin.h (PREG_P): Use P_REGNO_P.
	(IREG_P, P_REGNO_P, I_REGNO_P): New macros.
	(enum reg_class, REG_CLASS_CONTENTS): Add IPREGS.
	(BASE_REG_CLASS, REG_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P,
	REGNO_OK_FOR_BASE_STRICT_P, REGNO_OK_FOR_BASE_NONSTRICT_P): Delete
	macros.
	(IREG_POSSIBLE_P, MODE_CODE_BASE_REG_CLASS,
	REGNO_MODE_CODE_OK_FOR_BASE_P): New macros.
	(REGNO_REG_CLASS): ARGP is in PREGS.
	* config/bfin/bfin.md (movhi_insn): Allow for addresses containing
	IREGS.
	(zero_extendhisi2, extendhisi2): Likewise; changed to define_and_split
	to deal with those addresses.
	* addresses.h: New file.
	* caller-save.c: Include "addresses.h".
	(init_caller_save): Use new base_reg_class function.
	* rtl-factoring.c: Include "addresses.h".
	(recompute_gain_for_pattern_seq): Use new function ok_for_base_p_1.
	* recog.c: Include "addresses.h".
	(preprocess_constraints): Use new base_reg_class function.
	* regrename.c: Include "addresses.h".
	(scan_rtx_address): Use new regno_ok_for_base_p and base_reg_class
	functions.  Keep track of a new var INDEX_CODE to compute valid
	classes.
	(replace_oldest_value_addr): Likewise.
	(replace_oldest_value_mem): Use base_reg_class.
	* reload.c: Include "addresses.h".
	(REGNO_MODE_OK_FOR_BASE_P, REG_MODE_OK_FOR_BASE_P): Delete macros.
	(find_reloads): Use new base_reg_class function.
	(find_reloads_address): Likewise; also use regno_ok_for_base_p.
	(find_reloads_address_1): Likewise. New args OUTER_CODE and INDEX_CODE;
	all callers and prototype changed.
	* reload1.c: Include "addresses.h".
	(maybe_fix_stack_asms): Use base_reg_class.
	* regclass.c: Include "addresses.h".
	(ok_for_index_p_nonstrict, ok_for_base_p_nonstrict): New functions.
	(init_reg_autoinc): Use new base_reg_class function.
	(record_reg_classes): Likewise.
	(record_address_regs): Delete arg CLASS; add args CONTEXT, MODE,
	OUTER_CODE and INDEX_CODE.  All callers and prototype changed.
	Use new args to compute necessary class.

	* Makefile.in (regclass.o, reload.o, reload1.o, caller-save.o, recog.o,
	regrename.o, rtl-factoring.o): Update dependencies.
	* doc/tm.texi (MODE_CODE_BASE_REG_CLASS): Document.
	(REGNO_MODE_CODE_OK_FOR_BASE_P): Likewise.
	(REG_OK_FOR_BASE_P, REG_MODE_OK_FOR_BASE_P, REG_MODE_OK_FOR_REG_BASE_P,
	REG_OK_FOR_INDEX_P): Delete documentation.

From-SVN: r112248
2006-03-21 13:07:33 +00:00
Denis Nagorny d0236c3be1 re PR target/25603 (Miscompiled FORTRAN program)
2006-02-16  Denis Nagorny <denis_nagorny@linux.intel.com>

	PR rtl-optimization/25603
	* reload.c (reg_inc_found_and_valid_p): New. Check REG_INC note.
	(regno_clobbered_p): Use it. Reusing SETS argument for REG_INC case.
	* reload1.c (choose_reload_regs): Added call of regno_clobbered_p 
	with new meaning of SETS.

From-SVN: r111162
2006-02-16 16:03:06 -08:00
Bernd Schmidt 65b4c3370f reload.c (push_secondary_reload): Initialize t_icode.
* reload.c (push_secondary_reload): Initialize t_icode.

From-SVN: r110485
2006-02-01 22:34:06 +00:00
DJ Delorie 838f78d63b reload.c (reg_overlap_mentioned_for_reload_p): Handle subregs of mems.
* reload.c (reg_overlap_mentioned_for_reload_p): Handle subregs of
mems.

From-SVN: r109792
2006-01-16 19:58:06 -05:00
Ulrich Weigand 5a575f77fd re PR rtl-optimization/21041 (ICE: output_operand: Cannot decompose address)
PR rtl-optimization/21041
	* reload.c (find_reloads_subreg_address): Replace paradoxical
	subreg of MEM by widened access only if the resulting memory
	is properly aligned, even on !STRICT_ALIGNMENT targets.

	PR rtl-optimization/21041
	* gcc.dg/pr21041.c: New test.

From-SVN: r108760
2005-12-18 16:06:55 +00:00
Alan Modra 425de7399f reload.c (find_reloads): Fix comment typo.
* reload.c (find_reloads): Fix comment typo.
	* recog.h (recog_memoized): Correct comment.

From-SVN: r108627
2005-12-16 16:44:17 +10:30
Kazu Hirata 6416ae7f28 basic-block.h, [...]: Fix comment typos.
* basic-block.h, config/i386/winnt.c, config/pa/pa.c,
	config/s390/s390.c, dfp.c, expr.c, fold-const.c, params.def,
	reload.c, struct-equiv.c, tree-ssa-ccp.c, tree-ssa-pre.c,
	tree-ssa-reassoc.c, tree-ssa-structalias.c: Fix comment typos.
	* doc/invoke.texi, doc/tm.texi: Fix typos.

From-SVN: r108626
2005-12-16 06:09:31 +00:00
J"orn Rennecke 444aea52f6 reload.h (reg_equiv_invariant): Declare.
2005-12-07  J"orn Rennecke <joern.rennecke@st.com>

	* reload.h (reg_equiv_invariant): Declare.
	* reload.c (refers_to_regno_for_reload_p): Allow R to be a pseudo
	register also when reg_equiv_invariant[R] is set.

From-SVN: r108195
2005-12-07 23:41:19 +00:00
Richard Sandiford 58477b5d26 reload.c (push_secondary_reload): Fix typo: s/insn_constraint/scratch_constraint/.
* gcc/reload.c (push_secondary_reload): Fix typo:
	s/insn_constraint/scratch_constraint/.

From-SVN: r108154
2005-12-07 09:43:39 +00:00
J"orn Rennecke 8a99f6f92f re PR target/21623 (ICE in reload_cse_simplify_operands, at postreload.c:391)
PR target/21623:

	* regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove
	SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests.
	(init_fake_stack_mems): Remove HAVE_SECONDARY_RELOADS test.
	(memory_move_secondary_cost, init_reg_autoinc): Remove
	SECONDARY_INPUT_RELOAD_CLASS / SECONDARY_OUTPUT_RELOAD_CLASS tests.
	Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with
	secondary_reload_class call.
	(copy_cost): Likewise.  Add new parameter prev_sri.  Changed all
	callers.
	* reload.c (entire file): Remove HAVE_SECONDARY_RELOADS checks.
	(push_secondary_reload): Use secondary_reload target hook.
	(secondary_reload_class, scratch_reload_class): New functions.
	(push_reload): Remove SECONDARY_INPUT_RELOAD_CLASS and
	SECONDARY_OUTPUT_RELOAD_CLASS tests.  Replace
	SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call.
	* reload.h (HAVE_SECONDARY_RELOADS): Don't define nor test.
	(secondary_reload_class, scratch_reload_class): Declare.
	* reload1.c: Include target.h.
	(reload_adjust_reg_for_temp): New function.
	(reload_adjust_reg_for_icode): Likewise.
	(choose_reload_regs): Remove SECONDARY_INPUT_RELOAD_CLASS test.
	Replace SECONDARY_INPUT_RELOAD_CLASS use with secondary_reload_class
	call.
	(emit_input_reload_insns): Likewise.  Rewrite secondary reload checks
	for inheritance.  Support case when both secondary & tertiary reloads
	are for intermediate registers.
	(emit_output_reload_insns): Replace SECONDARY_OUTPUT_RELOAD_CLASS use
        with secondary_reload_class call.  Support case when both secondary
	& tertiary reloads are for intermediate registers.
	* target-def.h (TARGET_SECONDARY_RELOAD): Provide default definition.
	(TARGET_INITIALIZER) Add TARGET_SECONDARY_RELOAD.
	* target.h (secondary_reload_info): New struct / typedef.
	(struct gcc_target): New member secondary_reload.
	* targhooks.c Include reload.h, optabs.h and recog.h.
	(default_secondary_reload): New function.
	* targhooks.h (default_secondary_reload): Declare.
	* doc/tm.texi: Document secondary_reload target hook.  Update
	description of SECONDARY_*RELOAD_CLASS and reload_{in,out}<mode>.
	* doc/md.texi: Likewise.

	* sh-protos.h (sh_secondary_reload): Declare.
	* sh.c (TARGET_SECONDARY_RELOAD): Override.
	(sh_secondary_reload): New function.
	* sh.h (SECONDARY_INOUT_RELOAD_CLASS): Don't define.
	(SECONDARY_OUTPUT_RELOAD_CLASS): Likewise.
	(SECONDARY_INPUT_RELOAD_CLASS): Likewise.
	(HAVE_SECONDARY_RELOADS): Define.
	* sh.md (reload_indf): Rename to:
	(reload_indf__frn).
	(reload_outdf): Rename to:
	(reload_outdf__RnFRm).
	(reload_insf): Rename to:
	(reload_insf__frn).
	(reload_insi): Rename to:
	(reload_insi__i_fpul).

From-SVN: r107468
2005-11-24 18:55:53 +00:00
Ben Elliston 3d8bf70f59 optabs.c (expand_abs_nojump): Use SCALAR_FLOAT_MODE_P instead of explicitly testing GET_MODE_CLASS (x) ==...
* optabs.c (expand_abs_nojump): Use SCALAR_FLOAT_MODE_P instead of
	explicitly testing GET_MODE_CLASS (x) == MODE_FLOAT.
	* genopinit.c (gen_insn): Likewise.
	* reload.c (find_equiv_reg): Likewise.
	* loop.c (load_mems): Likewise.
	* rtlanal.c (may_trap_p_1, canonicalize_condition): Likewise.
	* cse.c (find_comparison_args, fold_rtx): Likewise.
	* dwarf2out.c (add_const_value_attribute): Likewise.
	* expr.c (convert_move): Likewise.
	* recog.c (general_operand, register_operand): Likewise.
	* reg-stack.c (replace_reg): Likewise.
	* tree-vect-generic.c (type_for_widest_vector_mode): Likewise.
	* c-common.c (handle_vector_size_attribute): Likewise.
	* simplify-rtx.c (simplify_const_unary_operation): Likewise.
	(simplify_binary_operation_1): Likewise.
	(simplify_const_binary_operation): Likewise.
	(simplify_relational_operation): Likewise.
	(simplify_const_relational_operation): Likewise.
	(simplify_immed_subreg): Likewise.
	* emit-rtl.c (gen_lowpart_common): Likewise.
	* expmed.c (expand_mult): Likewise.
	* stor-layout.c (layout_type): Likewise.

From-SVN: r107322
2005-11-22 07:53:27 +11:00
Hans-Peter Nilsson ff0d9879ab re PR middle-end/24912 (m68k build failure: ICE: in reload_cse_simplify_operands)
PR middle-end/24912
	PR middle-end/24750
	* reload.c (find_reloads_address_1): Mention dependency on
	gen_reload.
	* reload1.c (gen_reload): For IN with an unary operation, try
	moving inner expression to OUT if trivial SET is not valid.
	Confirm that the result is valid.  Move common code block into...
	(emit_insn_if_valid_for_reload): New function.

From-SVN: r107231
2005-11-19 21:56:17 +00:00
Hans-Peter Nilsson 19fe122f94 re PR middle-end/24750 (global-alloc (reload) trips over own confusion for unexpected addressing modes)
PR middle-end/24750
	* reload.c (find_reloads_address_1) <case TRUNCATE, SIGN_EXTEND,
	ZERO_EXTEND>: New cases.

From-SVN: r106804
2005-11-11 23:17:16 +00:00
Andrew Pinski d14e25e00b re PR middle-end/20606 (ICE in make_edges, at cfgbuild.c:327 on x86_64 (with O2 - not with no optimizations))
2005-10-05  Andrew Pinski  <pinskia@physics.uc.edu>

        PR middle-end/20606
        PR middle-end/24069
        * reload.c (subst_reloads): When adding a REG_LABEL to a
        jump instruction, also update JUMP_LABEL.

From-SVN: r105013
2005-10-05 12:50:27 -07:00
J"orn Rennecke 50aa8e71b7 re PR middle-end/23135 (find_reloads_toplev -> find_reloads_subreg_address uses wrong reload type)
PR middle-end/23135
	* reload.c (find_reloads_subreg_address): Pass down TYPE
	unchanged.  Change all callers except find_reloads_toplev.

From-SVN: r102772
2005-08-05 17:06:35 +01:00
Richard Henderson 37cf61167f cse.c (exp_equiv_p): Special case CONST_DOUBLE.
* cse.c (exp_equiv_p): Special case CONST_DOUBLE.
        * cselib.c (rtx_equal_for_cselib_p): Likewise.
        * jump.c (rtx_renumbered_equal_p): Likewise.
        * loop.c (rtx_equal_for_loop_p): Tidy and special case PC, CC0,
        CONST_INT and CONST_DOUBLE.
        (rtx_equal_for_prefetch_p): Likewise, plus LABEL_REF.
        * reload.c (operands_match_p): Special case CONST_INT and
        CONST_DOUBLE; check mode earlier.

From-SVN: r102548
2005-07-28 22:57:44 -07:00
Kelley Cook 366ccddb2b Update FSF address.
From-SVN: r101317
2005-06-25 02:02:01 +00:00
Jan Hubicka 5e2d947ce8 basic-block.h (rtl_bb_info): Break out head_, end_, global_live_at_start, global_live_at_end from ...
* basic-block.h (rtl_bb_info): Break out head_, end_,
	global_live_at_start, global_live_at_end from ...
	(basic_block_def): ... here; update all references
	(BB_RTL): New flag.
	(init_rtl_bb_info): Declare.
	* cfgexpand.c (expand_gimple_basic_block): Init bb info, set BB_RTL
	flag.
	* cfgrtl.c: Include ggc.h
	(create_basic_block_structure): Init bb info.
	(rtl_verify_flow_info_1): Check BB_RTL flag and rtl_bb_info pointer.
	(init_rtl_bb_info): New function.
	(rtl_merge_block, cfglayout_merge_block): Copy global_live_at_end here.
	* cfghooks.c (merge_block): Do not copy global_live_at_end here.
	* cfg.c (clear_bb_flags): Skip BB_RTL flag.
	(dump_flow_info): Gueard global_live_* dumping.

From-SVN: r101082
2005-06-16 10:33:40 +00:00
Martin Koegler 67468e8eda Prevent out-of-bounds array access in reload.
PR rtl-optimization/18877
* reload.c (decompose) <case REG, case SUBREG>: Handle pseudo reg
number in val.start.

From-SVN: r98938
2005-04-28 13:36:56 -07:00
Nathan Sidwell 0e61db61a0 lambda.h (lambda_vector_min_nz): Likewise.
* lambda.h (lambda_vector_min_nz): Likewise.
	* langhooks.h (struct lang_hooks_for_types,
	struct lang_hooks): Likewise.
	* output.h (assemble_integer, this_is_asm_operands): Likewise.
	* tree.h: Likewise.
	* vec.h: Likewise.
	* tree-flow-inline.h (relink_imm_use): Use gcc_assert.

	* optabs.c (prepare_cmp_insn, emit_cmp_and_jump_insns): Reword
	comments to avoid 'abort'.  Use gcc_assert as necessary.
	* opts.c (common_handle_option): Likewise.
	* pretty-print.c (pp_base_format_text): Likewise.
	* print-rtl.c (print_rtx): Likewise.
	* read-rtl.c (read_rtx_filename, read_rtx_1): Likewise.
	* regmove.c (try_auto_increment): Likewise.
	* reload.c (find_valid_class, find_reloads_toplev,
	find_equiv_reg): Likewise.
	* reload1.c (reload, forget_old_reloads_1, function_invariant_p,
	merge_assigned_reloads): Likewise.
	* tree-inline.c (inline_forbidden_p_1,
	estimate_num_insns_1): Likewise.
	* tree-optimize.c (execute_todo): Likewise.
	* tree-outof-ssa.c (eliminate_phi): Likewise.
	* tree-ssa-alias.c (add_pointed_to_expr): Likewise.
	* tree-ssa-ccp.c (maybe_fold_stmt_indirect): Likewise.
	* tree-ssa-operands.c (parse_ssa_operands,
	get_indirect_ref_operands, create_ssa_artficial_load_stmt): Likewise.
	* tree-ssa-pre.c (find_or_generate_expression): Likewise.
	* tree-ssanames.c (release_ssa_name): Likewise.
	* tree.c (int_bit_position, int_byte_position, tree_low_cst,
	walk_tree): Likewise.

	* tree-ssa-operands.c (verify_abort): Fold into ..
	(verify_imm_links): ... here.

From-SVN: r98519
2005-04-21 18:05:34 +00:00
Michael Matz 687b527d75 re PR middle-end/20973 (kdelibs (khtml) miscompiled by reload)
PR20973
        * reload.c (push_reload, find_dummy_reload): Check for uninitialized
        pseudos.

From-SVN: r98460
2005-04-20 14:30:38 +00:00
David Edelsohn b436d71257 reload.c (operands_match_p): Only increment register number for SCALAR_INT_MODE_P modes in multiple hard...
* reload.c (operands_match_p): Only increment register number for
        SCALAR_INT_MODE_P modes in multiple hard registers.

From-SVN: r95519
2005-02-24 17:06:06 -05:00
Ulrich Weigand e88d55cd88 reload.c (find_reloads): Swap address_reloaded flags when swapping commutative operands.
* reload.c (find_reloads): Swap address_reloaded flags when
	swapping commutative operands.

From-SVN: r95018
2005-02-14 15:07:05 +00:00
Dale Johannesen 7e42db17f9 cselib.c (cselib_process_insn): Clear out regs where HARD_REGNO_CALL_PART_CLOBBERED is true at a call.
2005-02-11  Dale Johannesen  <dalej@apple.com>

	* cselib.c (cselib_process_insn):  Clear out regs where
	HARD_REGNO_CALL_PART_CLOBBERED is true at a call.
	* reload.c (find_equiv_reg): Ditto.

From-SVN: r94885
2005-02-11 18:12:33 +00:00
Roger Sayle 778f72f2cf harg-reg-set.h (reg_class_names): Prototype global array.
* harg-reg-set.h (reg_class_names): Prototype global array.
	* regclass.c (reg_class_names): Declare here and initialize to
	REG_CLASS_NAMES.
	(dump_regclass): Remove local declaration of reg_class_names.
	(regclass): Likewise.
	* cfg.c (dump_flow_info): Likewise.
	* ra-debug.c (reg_class_names): Likewise.
	* regrename.c (reg_class_names): Likewise.
	* reload.c (reg_class_names): Likewise.
	* reload1.c (spill_failure): Likewise.
	* config/m68hc11/m68hc11.c (reg_class_names): Likewise.

From-SVN: r93696
2005-01-15 16:06:17 +00:00
Steven Bosscher 46d096a3c7 combine.c (expand_compound_operation): Add comment that we fall through after case.
* combine.c (expand_compound_operation)  <ZERO_EXTRACT>: Add
	comment that we fall through after case.
	(mark_used_regs_combine): Don't expect a SIGN_EXTRACT in a SET_DEST.
	(distribute_links): Likewise.
	* cse.c (cse_insn): Likewise.
	* cselib.c (cselib_invalidate_mem): Likewise.
	* df.c: Update comments at the top of the file.
	(read_modify_subreg_p): Update comments here too.
	(df_def_record_1): Don't expect a SIGN_EXTRACT in a SET_DEST.
	* flow.c (mark_set_1): Likewise.
	(mark_used_regs): Likewise.
	* gcse.c (mems_conflict_for_gcse_p): Likewise.
	(canon_list_insert): Likewise.
	(mark_set): Likewise.
	(try_replace_reg): Likewise.
	(store_killed_in_insn): Likewise.
	* loop.c (count_one_set): Likewise.
	(basic_induction_var): Likewise.
	* postreload-gcse.c (find_mem_conflicts): Likewise.
	* postreload.c (reload_combine_note_store): Likewise.
	(move2add_note_store): Likewise.
	* reload.c (find_equiv_reg): Likewise.
	(mark_referenced_resources): Likewise.
	* rtlanal.c (set_noop_p): Likewise.
	(note_stores): Likewise.
	(note_uses): Likewise.
	* sched-deps.c (sched_analyze_1): Likewise.
	* sched-rgn.c (check_live_1): Likewise.
	(update_live_1): Likewise.
	* config/i860/i860.c: Likewise.

	* rtl.dec (SIGN_EXTRACT): Document that this cannot appear as
	an lvalue.
	(ZERO_EXTRACT): Mention that this one can be an lvalue.

	* doc/rtl.texi: Update documentation for bit-fields and SET.

From-SVN: r92974
2005-01-05 23:19:23 +00:00
Roger Sayle 5b804e8a7e reload.c (regno_clobbered_p): Add a gcc_assert that regno refers to a hard register.
* reload.c (regno_clobbered_p): Add a gcc_assert that regno
	refers to a hard register.

From-SVN: r92574
2004-12-23 22:48:51 +00:00
Kaz Kojima 2ca396208c re PR target/18511 (cc1plus segfaults when compiling libstdc++-v3/src/localename.cc)
PR target/18511
	* reload1.c (emit_output_reload_insns): Check if OLD is a hard
	register before calling regno_clobbered_p.
	* reload.c: Update comment for regno_clobbered_p.

From-SVN: r92531
2004-12-23 04:53:48 +00:00