Commit Graph

739 Commits

Author SHA1 Message Date
Ulrich Weigand 551d69292f re PR middle-end/30761 (Error: unsupported relocation against sfp)
PR middle-end/30761
	* reload1.c (eliminate_regs_in_insn): In the single_set special
	case, attempt to re-recognize the insn before falling back to
	having reload fix it up.

From-SVN: r122199
2007-02-21 15:05:01 +00:00
Steven Bosscher a31830a7ca fwprop.c (try_fwprop_subst): Use set_unique_reg_note to add the REG_EQ* note.
* fwprop.c (try_fwprop_subst): Use set_unique_reg_note
	to add the REG_EQ* note.
	* see.c (see_merge_one_use_extension): Likewise.
	* local-alloc.c (update_equiv_regs): Likewise.  Also don't
	turn REG_EQUAL notes into REG_EQUIV notes if the target
	register may have more than one set.
	* function.c (assign_parm_setup_reg): Use set_unique_reg_note.
	* gcse.c (try_replace_reg): Likewise.
	* alias.c (init_alias_analysis): Use find_reg_equal_equiv_note.
	* calls.c (fixup_tail_calls): Likewise.  Abort if there is
	more than one REG_EQUIV note.
	* reload1.c (gen_reload): Use set_unique_reg_note.

From-SVN: r121821
2007-02-11 19:53:11 +00:00
Kaz Kojima 4c9034c5e5 re PR rtl-optimization/29599 (ICE when building the kernel on SH4)
PR rtl-optimization/29599
	* reload1.c (eliminate_regs_in_insn): Take the destination
	mode into account when computing the offset.

From-SVN: r121792
2007-02-10 06:47:49 +00:00
DJ Delorie 21f14ff955 reload1.c (choose_reload_regs): Check for invalid subregs before computing their locations, not after.
* reload1.c (choose_reload_regs): Check for invalid subregs before
computing their locations, not after.

From-SVN: r121198
2007-01-25 20:15:05 -05:00
Richard Sandiford 92d5459253 reload1.c (emit_reload_insns): Pass the reload register for a non-spill output reload through forget_old_reloads_1.
gcc/
	* reload1.c (emit_reload_insns): Pass the reload register
	for a non-spill output reload through forget_old_reloads_1.

From-SVN: r121105
2007-01-24 08:16:14 +00:00
Nathan Sidwell 970af86771 re PR target/28966 (-maltivec -m32 causes the stack to be saved and restored even though there is no need for it)
gcc/
	PR target/28966
	PR target/29248
	* reload1.c (reload): Realign stack after it changes size.
gcc/testsuite/
	PR target/28966
	PR target/29248
	* gcc.dg/rs6000-leaf.c: New.

From-SVN: r120102
2006-12-21 09:03:18 +00:00
Peter Bergner 8c1249f965 re PR middle-end/30191 (GCC error: in eliminate_regs_in_insn, at reload1.c:3126)
PR middle-end/30191
        Revert:
        * reload1.c (eliminate_regs_in_insn): Merge the plus_src "else" and
        the offset == 0 "then" clauses.
        * config/rs6000/predicates.md (gpc_reg_operand): Check for
        reload_in_progress.

From-SVN: r119844
2006-12-13 13:19:03 -06:00
Peter Bergner 4fbd315165 reload1.c (eliminate_regs_in_insn): Merge the plus_src "else" and the offset == 0 "then" clauses.
* reload1.c (eliminate_regs_in_insn): Merge the plus_src "else" and
	the offset == 0 "then" clauses.
	* config/rs6000/predicates.md (gpc_reg_operand): Check for
	reload_in_progress.

From-SVN: r119800
2006-12-12 15:45:37 -06:00
Rask Ingemann Lambertsen 15447faef3 reload1.c (choose_reload_regs): Don't set byte offset when resolving subregs of hard regs.
2006-12-04  Rask Ingemann Lambertsen  <rask@sygehus.dk>

	* reload1.c (choose_reload_regs): Don't set byte offset when
	resolving subregs of hard regs.

From-SVN: r119705
2006-12-10 10:37:48 +00:00
Bernd Schmidt 2372a06257 reload1.c (delete_output_reload): Count occurrences in CALL_INSN_FUNCTION_USAGE.
* reload1.c (delete_output_reload): Count occurrences in
	CALL_INSN_FUNCTION_USAGE.
	* rtlanal.c (count_occurrences): Handle EXPR_LIST nodes without
	crashing at the end of the list.

From-SVN: r119571
2006-12-06 00:25:29 +00:00
DJ Delorie d2c9375a6d reload1.c (reloads_unique_chain): New.
* reload1.c (reloads_unique_chain): New.
(reloads_conflict): Call it.

From-SVN: r118953
2006-11-17 18:15:29 -05:00
Eric Christopher 167fa32c09 extend.texi (__builtin_bswap32): Document.
2006-09-07  Eric Christopher  <echristo@apple.com>
	    Falk Hueffner  <falk@debian.org>

	* doc/extend.texi (__builtin_bswap32): Document.
	(__builtin_bswap64): Ditto.
	* doc/libgcc.texi (bswapsi2): Document.
	(bswapdi2): Ditto.
	* doc/rtl.texi (bswap): Document.
	* optabs.c (expand_unop): Don't widen a bswap.
	(init_optabs): Init bswap. Set libfuncs explicitly
	for bswapsi2 and bswapdi2.
	* optabs.h (OTI_bswap): New.
	(bswap_optab): Ditto.
	* genopinit.c (optabs): Handle bswap_optab.
	* tree.h (tree_index): Add TI_UINT32_TYPE and
	TI_UINT64_TYPE.
	(uint32_type_node): New.
	(uint64_type_node): Ditto.
	* tree.c (build_common_tree_nodes_2): Initialize
	uint32_type_node and uint64_type_node.
	* builtins.c (expand_builtin_bswap): New.
	(expand_builtin): Call.
	(fold_builtin_bswap): New.
	(fold_builtin_1): Call.
	* fold-const.c (tree_expr_nonnegative_p): Return true
	for bswap.
	* builtin-types.def (BT_UINT32): New.
	(BT_UINT64): Ditto.
	(BT_FN_UINT32_UINT32): Ditto.
	(BT_FN_UINT64_UINT64): Ditto.
	* builtins.def (BUILT_IN_BSWAP32): New.
	(BUILT_IN_BSWAP64): Ditto.
	* rtl.def (BSWAP): New.
	* genattrtab.c (check_attr_value): New.
	* libgcc2.c (__bswapSI2): New.
	(__bswapDI2): Ditto.
	* libgcc2.h (__bswapSI2): Declare.
	(__bswapDI2): Ditto.
	* mklibgcc.in (lib2funcs): Add _bswapsi2 and _bswapdi2.
	* simplify-rtx.c (simplify_const_unary_operation): Return
	0 for BSWAP.
	* libgcc-std.ver (__bwapsi2): Add.
	(__bswapdi2): Ditto.
	* reload1.c (eliminate_regs_1): Add bswap.
	(elimination_effects): Ditto.
	* config/i386/i386.h (x86_bswap): New.
	(TARGET_BSWAP): Use.
	* config/i386/i386.c (x86_bswap): Set.

Co-Authored-By: Falk Hueffner <falk@debian.org>

From-SVN: r118361
2006-11-01 05:14:40 +00:00
Ben Elliston 247140eaf7 * reload1.c: Formatting fixes.
From-SVN: r117993
2006-10-24 13:24:58 +10:00
Richard Sandiford 63a7a62b25 reload1.c (alter_reg): Require the alignment of the stack slot to be at least reg_max_ref_width bytes.
gcc/
	* reload1.c (alter_reg): Require the alignment of the stack slot to
	be at least reg_max_ref_width bytes.
	(scan_paradoxical_subregs): Record the largest width in
	reg_max_ref_width.

From-SVN: r117252
2006-09-27 15:27:38 +00:00
Steven Bosscher d63e138968 re PR rtl-optimization/21299 (internal error on invalid asm statement)
PR rtl-optimization/21299
        * reload1.c (reload): Purge invalid ASMs in the final pass.

From-SVN: r117061
2006-09-19 21:22:31 +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
Jan Hubicka 7ef701a84a * reload1.c (emit_reload_insns): Fix yet another typo in my patch.
From-SVN: r116384
2006-08-24 19:43:43 +00:00
Jan Hubicka 1f6c68eda5 Patch by Paolo Bonzini
Patch by Paolo Bonzini
	* reload1.c (emit_reload_insns): Fix incorrect bracketing introduced by
	my previous patch.

From-SVN: r116325
2006-08-22 15:44:56 +00:00
Jan Hubicka 2c61f5f1ba re PR middle-end/28071 (A file that can not be compiled in reasonable time/space)
PR rtl-optimization/28071
	* reload1.c (reg_has_output_reload): Turn into regset.
	(reload_as_needed, forget_old_reloads_1, forget_marked_reloads,
	choose_reload_regs, emit_reload_insns): Update to new
	reg_has_output_reload.

From-SVN: r116277
2006-08-21 00:00:14 +00:00
Jan Hubicka 7ffaaddcda Fix typo in previously applied patch.
From-SVN: r116221
2006-08-17 10:08:31 +00:00
Jan Hubicka db4c738615 re PR tree-optimization/27865 (tree check failure building FreePOOMA)
PR tree-optimization/27865
	* reload1.c (forget_marked_reloads): New function.
	(forget_old_reloads_1): When data are passed, just mark the registers
	for later removal.
	(reload_as_needed): Use the new mechanizm.

From-SVN: r116220
2006-08-17 09:44:12 +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
Roger Sayle 8c3390831f re PR target/27531 (sparc: undefined reference to .LL226 with -O2)
2006-06-22  Roger Sayle  <roger@eyesopen.com>
	    Steven Bosscher  <stevenb.gcc@gmail.com>

	PR target/27531
	* reload1.c (gen_reload): Call mark_jump_label on the new insns
	generated by gen_move_insn to add REG_LABEL notes if necessary.

	* gcc.dg/pr27531-1.c: New test case.


Co-Authored-By: Steven Bosscher <stevenb.gcc@gmail.com>

From-SVN: r114921
2006-06-23 01:19:57 +00:00
Andreas Krebbel 184f4c5647 re PR middle-end/27959 (s390x miscompilation due to clobbering literal pool base reg)
2006-06-14  Andreas Krebbel  <krebbel1@de.ibm.com>

	PR middle-end/27959
	* reload1.c (reload): Remove registers returned by update_eliminables
	from used_spill_regs.

2006-06-14  Andreas Krebbel  <krebbel1@de.ibm.com>

	PR middle-end/27959
	* gcc.dg/pr27959.c: New testcase.

From-SVN: r114640
2006-06-14 14:19:54 +00:00
Kazu Hirata 43b373a2a5 local-alloc.c (rest_of_handle_local_alloc): Use VEC instead of VARRAY.
* local-alloc.c (rest_of_handle_local_alloc): Use VEC instead
	of VARRAY.
	* reload1.c (reg_equiv_memory_loc_varray): Rename to
	reg_equiv_memory_loc_vec.  Change the type to VEC(rtx,gc) *.
	(init_reload, reload): Use VEC instead of VARRAY.
	* reload.h: Update the prototype for
	reg_equiv_memory_loc_varray.

From-SVN: r112955
2006-04-14 14:31:32 +00:00
Paul Brook 67f074899d reload1.c (choose_reload_regs): Check for all RTX_AUTOINC operators.
2006-03-29  Paul Brook  <paul@codesourcery.com>

	* reload1.c (choose_reload_regs): Check for all RTX_AUTOINC operators.
	(inc_for_reload): Handle PRE_MODIFY and POST_MODIFY addresses.

From-SVN: r112500
2006-03-29 16:33:54 +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
Richard Sandiford aacd3885eb re PR target/9703 ([arm] Accessing data through constant pool more times could be solved in less instructions)
* cselib.c (cselib_init): Change RTX_SIZE to RTX_CODE_SIZE.
	* emit-rtl.c (copy_rtx_if_shared_1): Use shallow_copy_rtx.
	(copy_insn_1): Likewise.  Don't copy each field individually.
	Reindent.
	* read-rtl.c (apply_macro_to_rtx): Use RTX_CODE_SIZE instead
	of RTX_SIZE.
	* reload1.c (eliminate_regs): Use shallow_copy_rtx.
	* rtl.c (rtx_size): Rename variable to...
	(rtx_code_size): ...this.
	(rtx_size): New function.
	(rtx_alloc_stat): Use RTX_CODE_SIZE instead of RTX_SIZE.
	(copy_rtx): Use shallow_copy_rtx.  Don't copy each field individually.
	Reindent.
	(shallow_copy_rtx_stat): Use rtx_size instead of RTX_SIZE.
	* rtl.h (rtx_code_size): New variable.
	(rtx_size): Change from a variable to a function.
	(RTX_SIZE): Rename to...
	(RTX_CODE_SIZE): ...this.

	PR target/9703
	PR tree-optimization/17106
	* doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Document.
	(Anchored Addresses): New section.
	* doc/invoke.texi (-fsection-anchors): Document.
	* doc/rtl.texi (SYMBOL_REF_IN_BLOCK_P, SYMBOL_FLAG_IN_BLOCK): Likewise.
	(SYMBOL_REF_ANCHOR_P, SYMBOL_FLAG_ANCHOR): Likewise.
	(SYMBOL_REF_BLOCK, SYMBOL_REF_BLOCK_OFFSET): Likewise.
	* hooks.c (hook_bool_mode_rtx_false): New function.
	* hooks.h (hook_bool_mode_rtx_false): Declare.
	* gengtype.c (create_optional_field): New function.
	(adjust_field_rtx_def): Add the "block_sym" field for SYMBOL_REFs when
	SYMBOL_REF_IN_BLOCK_P is true.
	* target.h (output_anchor, use_blocks_for_constant_p): New hooks.
	(min_anchor_offset, max_anchor_offset): Likewise.
	(use_anchors_for_symbol_p): New hook.
	* toplev.c (compile_file): Call output_object_blocks.
	(target_supports_section_anchors_p): New function.
	(process_options): Check that -fsection-anchors is only used on
	targets that support it and when -funit-at-a-time is in effect.
	* tree-ssa-loop-ivopts.c (prepare_decl_rtl): Only create DECL_RTL
	if the decl doesn't have one.
	* dwarf2out.c: Remove instantiations of VEC(rtx,gc).
	* expr.c (emit_move_multi_word, emit_move_insn): Pass the result
	of force_const_mem through use_anchored_address.
	(expand_expr_constant): New function.
	(expand_expr_addr_expr_1): Call it.  Use the same modifier when
	calling expand_expr for INDIRECT_REF.
	(expand_expr_real_1): Pass DECL_RTL through use_anchored_address
	for all modifiers except EXPAND_INITIALIZER.  Use expand_expr_constant.
	* expr.h (use_anchored_address): Declare.
	* loop-unroll.c: Don't declare rtx vectors here.
	* explow.c: Include output.h.
	(validize_mem): Call use_anchored_address.
	(use_anchored_address): New function.
	* common.opt (-fsection-anchors): New switch.
	* varasm.c (object_block_htab, anchor_labelno): New variables.
	(hash_section, object_block_entry_eq, object_block_entry_hash)
	(use_object_blocks_p, get_block_for_section, create_block_symbol)
	(use_blocks_for_decl_p, change_symbol_section): New functions.
	(get_variable_section): New function, split out from assemble_variable.
	(make_decl_rtl): Create a block symbol if use_object_blocks_p and
	use_blocks_for_decl_p say so.  Use change_symbol_section if the
	symbol has already been created.
	(assemble_variable_contents): New function, split out from...
	(assemble_variable): ...here.  Don't output any code for
	block symbols; just pass them to place_block_symbol.
	Use get_variable_section and assemble_variable_contents.
	(get_constant_alignment, get_constant_section, get_constant_size): New
	functions, split from output_constant_def_contents.
	(build_constant_desc): Create a block symbol if use_object_blocks_p
	says so.  Or into SYMBOL_REF_FLAGS.
	(assemble_constant_contents): New function, split from...
	(output_constant_def_contents): ...here.  Don't output any code
	for block symbols; just pass them to place_section_symbol.
	Use get_constant_section and get_constant_alignment.
	(force_const_mem): Create a block symbol if use_object_blocks_p and
	use_blocks_for_constant_p say so.  Or into SYMBOL_REF_FLAGS.
	(output_constant_pool_1): Add an explicit alignment argument.
	Don't switch sections here.
	(output_constant_pool): Adjust call to output_constant_pool_1.
	Switch sections here instead.  Don't output anything for block symbols;
	just pass them to place_block_symbol.
	(init_varasm_once): Initialize object_block_htab.
	(default_encode_section_info): Keep the old SYMBOL_FLAG_IN_BLOCK.
	(default_asm_output_anchor, default_use_aenchors_for_symbol_p)
	(place_block_symbol, get_section_anchor, output_object_block)
	(output_object_block_htab, output_object_blocks): New functions.
	* target-def.h (TARGET_ASM_OUTPUT_ANCHOR): New macro.
	(TARGET_ASM_OUT): Include it.
	(TARGET_USE_BLOCKS_FOR_CONSTANT_P): New macro.
	(TARGET_MIN_ANCHOR_OFFSET, TARGET_MAX_ANCHOR_OFFSET): New macros.
	(TARGET_USE_ANCHORS_FOR_SYMBOL_P): New macro.
	(TARGET_INITIALIZER): Include them.
	* rtl.c (rtl_check_failed_block_symbol): New function.
	* rtl.h: Include vec.h.  Declare heap and gc rtx vectors.
	(block_symbol, object_block): New structures.
	(rtx_def): Add a block_symbol field to the union.
	(BLOCK_SYMBOL_CHECK): New macro.
	(rtl_check_failed_block_symbol): Declare.
	(SYMBOL_FLAG_IN_BLOCK, SYMBOL_FLAG_ANCHOR): New SYMBOL_REF flags.
	(SYMBOL_REF_IN_BLOCK_P, SYMBOL_REF_ANCHOR_P): New predicates.
	(SYMBOL_FLAG_MACH_DEP_SHIFT): Bump by 2.
	(SYMBOL_REF_BLOCK, SYMBOL_REF_BLOCK_OFFSET): New accessors.
	* output.h (output_section_symbols): Declare.
	(object_block): Name structure.
	(place_section_symbol, get_section_anchor, default_asm_output_anchor)
	(default_use_anchors_for_symbol_p): Declare.
	* Makefile.in (RTL_BASE_H): Add vec.h.
	(explow.o): Depend on output.h.
	* config/rs6000/rs6000.c (TARGET_MIN_ANCHOR_OFFSET): Override default.
	(TARGET_MAX_ANCHOR_OFFSET): Likewise.
	(TARGET_USE_BLOCKS_FOR_CONSTANT_P): Likewise.
	(rs6000_use_blocks_for_constant_p): New function.

From-SVN: r111254
2006-02-18 22:06:53 +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
Paul Brook b81ac2881e reload1.c (emit_reload_insns): Invalidate dead input registers used for reloads.
2005-02-16  Paul Brook  <paul@codesourcery.com>

	* reload1.c (emit_reload_insns): Invalidate dead input registers used
	for reloads.

From-SVN: r111137
2006-02-16 15:14:23 +00:00
J"orn Rennecke d0ab13fd8b * reload1.c (gen_reload): Also use find_replacement in UNARY_P case.
From-SVN: r110915
2006-02-13 15:31:31 +00:00
Bernd Schmidt 75803b857b reload1.c (emit_input_reload_insns): Delete code that tries to inherit using find_equiv_reg.
* reload1.c (emit_input_reload_insns): Delete code that tries to
	inherit using find_equiv_reg.

From-SVN: r110806
2006-02-09 17:26:41 +00:00
Marcin Dalecki 5ed6ace578 tree-vrp.c: Use XNEW/XCNEW allocation wrappers.
2006-01-31  Marcin Dalecki  <martin@dalecki.de>

	* tree-vrp.c: Use XNEW/XCNEW allocation wrappers.
	* regrename.c: Ditto.
	* tree-ssa-loop-im.c: Ditto.
	* tree-dump.c: Ditto.
	* tree-complex.c: Ditto.
	* genrecog.c: Ditto.
	* tree-ssa-threadupdate.c: Ditto.
	* tracer.c: Ditto.
	* java/class.c: Ditto.
	* java/jcf-parse.c: Ditto.
	* java/resource.c: Ditto.
	* java/except.c: Ditto.
	* java/jvspec.c: Ditto.
	* java/jcf-write.c: Ditto.
	* java/jcf-path.c: Ditto.
	* java/gjavah.c: Ditto.
	* java/zextract.c: Ditto.
	* java/jcf-io.c: Ditto.
	* java/jcf.h: Ditto.
	* java/buffer.c: Ditto.
	* java/lang.c: Ditto.
	* java/parse-scan.y: Ditto.
	* java/lex.c: Ditto.
	* java/lex.h: Ditto.
	* cfgloopmanip.c: Ditto.
	* postreload-gcse.c: Ditto.
	* tree-ssa-loop-manip.c: Ditto.
	* postreload.c: Ditto.
	* tree-ssa-loop-ch.c: Ditto.
	* loop.c: Ditto.
	* ipa-cp.c: Ditto.
	* cppspec.c: Ditto.
	* diagnostic.c: Ditto.
	* final.c: Ditto.
	* genoutput.c: Ditto.
	* gcc.c: Ditto.
	* cfghooks.c: Ditto.
	* cfgloopanal.c: Ditto.
	* objc/objc-act.c: Ditto.
	* gcov.c: Ditto.
	* genextract.c: Ditto.
	* genautomata.c: Ditto.
	* pretty-print.c: Ditto.
	* genemit.c: Ditto.
	* cgraphunit.c: Ditto.
	* flow.c: Ditto.
	* df-scan.c: Ditto.
	* haifa-sched.c: Ditto.
	* dominance.c: Ditto.
	* dbxout.c: Ditto.
	* tree-ssa-loop-ivopts.c: Ditto.
	* df-core.c: Ditto.
	* mode-switching.c: Ditto.
	* modulo-sched.c: Ditto.
	* graph.c: Ditto.
	* ipa-pure-const.c: Ditto.
	* cse.c: Ditto.
	* fix-header.c: Ditto.
	* web.c: Ditto.
	* tree-stdarg.c: Ditto.
	* ipa-utils.c: Ditto.
	* loop-init.c: Ditto.
	* ipa-inline.c: Ditto.
	* cfganal.c: Ditto.
	* global.c: Ditto.
	* alloc-pool.c: Ditto.
	* dwarf2out.c: Ditto.
	* opts.c: Ditto.
	* genattrtab.c: Ditto.
	* tree-ssa-loop-ivcanon.c: Ditto.
	* predict.c: Ditto.
	* timevar.c: Ditto.
	* lcm.c: Ditto.
	* fortran/gfortranspec.c: Ditto.
	* regmove.c: Ditto.
	* local-alloc.c: Ditto.
	* langhooks.c: Ditto.
	* function.c: Ditto.
	* tree-vectorizer.c: Ditto.
	* gcse.c: Ditto.
	* ipa-type-escape.c: Ditto.
	* alias.c: Ditto.
	* tree-if-conv.c: Ditto.
	* profile.c: Ditto.
	* ipa.c: Ditto.
	* tree-data-ref.c: Ditto.
	* loop-unroll.c: Ditto.
	* treelang/treetree.c: Ditto.
	* calls.c: Ditto.
	* bt-load.c: Ditto.
	* ggc-common.c: Ditto.
	* except.c: Ditto.
	* coverage.c: Ditto.
	* cselib.c: Ditto.
	* tree-cfgcleanup.c: Ditto.
	* tree-ssa-pre.c: Ditto.
	* cfgcleanup.c: Ditto.
	* loop-invariant.c: Ditto.
	* loop-iv.c: Ditto.
	* ipa-prop.c: Ditto.
	* print-tree.c: Ditto.
	* conflict.c: Ditto.
	* ggc-page.c: Ditto.
	* sched-deps.c: Ditto.
	* regclass.c: Ditto.
	* tree-object-size.c: Ditto.
	* combine.c: Ditto.
	* bb-reorder.c: Ditto.
	* resource.c: Ditto.
	* var-tracking.c: Ditto.
	* cfgloop.c: Ditto.
	* df-problems.c: Ditto.
	* reg-stack.c: Ditto.
	* tlink.c: Ditto.
	* gccspec.c: Ditto.
	* sched-rgn.c: Ditto.
	* tree-ssa-structalias.c: Ditto.
	* tree-ssa-reassoc.c: Ditto.
	* config/darwin-c.c: Ditto.
	* config/darwin.c: Ditto.
	* config/arm/arm.c: Ditto.
	* cfgrtl.c: Ditto.
	* collect2.c: Ditto.
	* reload1.c: Ditto.

From-SVN: r110446
2006-01-31 20:56:55 +01:00
DJ Delorie ff182b5cf7 reload1.c (find_reload_regs): Note the details of reload failures in the dump file.
* reload1.c (find_reload_regs): Note the details of reload
failures in the dump file.
(spill_failure): Likewise.

From-SVN: r110006
2006-01-19 20:16:17 -05:00
Ian Lance Taylor ce99549f58 reload1.c (do_output_reload): Add assertion rejecting a CALL_INSN.
* reload1.c (do_output_reload): Add assertion rejecting a
	CALL_INSN.

From-SVN: r109697
2006-01-14 05:30:32 +00:00
Alan Modra a5ee7cbac4 re PR rtl-optimization/25432 (Reload ICE in gen_add2_insn)
PR rtl-optimization/25432
	* reload1.c (eliminate_regs_in_insn): Update insn code on
	successfully re-recognizing modified insn.

	* gcc.c-torture/compile/20051216-1.c: New test.

From-SVN: r108985
2005-12-23 00:19:49 +01:00
DJ Delorie 4322a86f32 reload1.c (spill_failure): Dump failed reload data to dump file.
* reload1.c (spill_failure): Dump failed reload data to dump file.
(find_reload_regs): Likewise.

From-SVN: r108830
2005-12-19 20:04:24 -05:00
Ulrich Weigand 7efd40b52a re PR rtl-optimization/25310 (ICE in reload_cse_simplify_operands, at postreload.c:393)
PR rtl-optimization/25310
	* reload1.c (eliminate_regs_in_insn): Handle lowpart SUBREGs
	of the eliminable register when substituting into a PLUS.

	PR rtl-optimization/25310
	* gcc.c-torture/compile/pr25310.c: New test.

From-SVN: r108543
2005-12-14 23:34:51 +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
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
Richard Henderson ab156144da re PR rtl-optimization/24160 (ICE with -O1 -ftree-vectorize -msse)
PR rtl-opt/24160
        PR target/24621
        * reload1.c (reg_equiv_invariant): New.
        (reload): Allocate, initialize, and free it.
        (calculate_needs_all_insns): Check it when skipping equivalence
        setting insns.
        (alter_reg): Likewise.
        (eliminate_regs_1): Rename from eliminate_regs.  Add new
        may_use_invariant argument; only use reg_equiv_invariant when true.
        (eliminate_regs): New.
        (eliminate_regs_in_insn): Use eliminate_regs_1; track when we're in
        a context for which may_use_invariant may be true.

Co-Authored-By: J"orn Rennecke <joern.rennecke@st.com>
Co-Authored-By: Ulrich Weigand <uweigand@de.ibm.com>

From-SVN: r107093
2005-11-16 09:23:23 -08:00
Daniel Jacobowitz 3f27846b1c reload1.c (merge_assigned_reloads): Do not change any RELOAD_FOR_OUTPUT_ADDRESS reloads.
* reload1.c (merge_assigned_reloads): Do not change any
	RELOAD_FOR_OUTPUT_ADDRESS reloads.

From-SVN: r104827
2005-09-30 18:09:56 +00:00
Andreas Krebbel b735f45d30 reload1.c (fixup_eh_region_note): Remove assertion.
2005-09-07  Andreas Krebbel  <krebbel1@de.ibm.com>

	* reload1.c (fixup_eh_region_note): Remove assertion.
	(fixup_abnormal_edges): Reverted removal of call to
	find_many_sub_basic_blocks made on 2005-08-31.

From-SVN: r103984
2005-09-07 07:52:48 +00:00
Richard Henderson e3947b349c re PR middle-end/23676 (ICE: "missing REG_EH_REGION note in the end of bb")
PR 23676
        * reload1.c (reload_as_needed): Check !CALL_P before calling
        fixup_eh_region_note.
        * rtlanal.c (may_trap_p): SUBREG by itself cannot trap.

From-SVN: r103751
2005-09-01 16:35:19 -07:00
Richard Henderson be0c514c74 re PR rtl-optimization/23601 (reload may drop non-call exception information)
PR rtl-opt/23601
        * reload1.c (reload): Set MEM_NOTRAP_P in spill slots.
        (fixup_eh_region_note): New.
        (reload_as_needed): Call it.
        (fixup_abnormal_edges): Allow all throwing insns to be deleted;
        don't call find_many_sub_basic_blocks; call verify_flow_info.
        * function.c (assign_stack_local_1): Set MEM_NOTRAP_P.
        (keep_stack_depressed): Likewise.
        (assign_stack_temp_for_type): Likewise; use adjust_address_nv.

From-SVN: r103680
2005-08-31 09:26:51 -07:00
James E Wilson c8f27794b8 Fix uninitialized register read problem.
* builtins.c (expand_builtin_return_addr): Set
current_function_accesses_prior_frames when count != 0.  Use
frame_pointer_rtx when count == 0.
* function.h (struct function): Add accesses_prior_frames field.
(current_function_accesses_prior_frames): Define.
* reload1.c (init_elim_table): Check
current_function_accesses_prior_frames.
* doc/tm.texi (INITIAL_FRAME_ADDRESS_RTX): Update docs.

From-SVN: r103294
2005-08-19 14:16:20 -07:00
Kazu Hirata 569b7f6adb dwarf2out.c, [...]: Fix comment typos.
* dwarf2out.c, fold-const.c, ipa-type-escape.c,
	loop-invariant.c, predict.c, predict.def, reload1.c, reorg.c,
	tree-sra.c, config/arm/arm.c, config/crx/crx.c,
	config/i386/i386.c, config/mips/mips.h,
	config/rs6000/rs6000.h, config/sh/sh.c,
	config/stormy16/stormy16.c: Fix comment typos.

From-SVN: r102620
2005-08-01 03:55:03 +00: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
Bernd Schmidt d7f88d8648 Makefile.in (local-alloc.o): Depend on $(GGC_H) and reload.h.
* Makefile.in (local-alloc.o): Depend on $(GGC_H) and reload.h.
	* local-alloc.c: Include "ggc.h" and "reload.h".
	(struct equivalence): New member is_arg_equivalence.
	(local_alloc): Always call update_equiv_regs.
	(update_equiv_regs): Allocate reg_equiv_init; set reg_equiv_init_size.
	Detect equivalences made by stores to memory in a second pass.
	Return early if not optimizing.
	Initialize reg_equiv_init for all equivalences; treat equivalences for
	REG_EQUIV notes existing before this pass specially.
	(no_equiv): Don't clear reg_equiv_init or remove notes if the
	is_arg_equivalence field is set.
	* reload.h (reg_equiv_init, reg_equiv_init_size): Declare.
	* reload1.c (reg_equiv_init): No longer static.
	(reg_equiv_init_size): New variable.
	(reload): Don't allocate reg_equiv_init; don't free it when done but
	clear it.
	Restructure equivalence set up code not to set reg_equiv_init, but to
	clear it when we can't use an equivalence.
	Undo change disabling equivalences for MEM_READONLY_P memrefs.
	Dump equivalencing insns to dump_file.

From-SVN: r100975
2005-06-15 09:35:15 +00:00