Commit Graph

1102 Commits

Author SHA1 Message Date
David Malcolm 345b82befb Convert set_block_for_insn from a macro to an inline function
gcc/ChangeLog:
2014-09-05  David Malcolm  <dmalcolm@redhat.com>

	* basic-block.h (set_block_for_insn): Eliminate this macro in
	favor of...
	* rtl.h (set_block_for_insn): New inline function, imposing the
	requirement that the "insn" param is an rtx_insn *.

From-SVN: r214963
2014-09-05 14:19:35 +00:00
Trevor Saunders 596f2b172a make several emit functions take an rtx_insn *
gcc/ChangeLog:

2014-09-04  Trevor Saunders  <tsaunders@mozilla.com>

	* emit-rtl.c (emit_insn_before_noloc): Take an rtx_insn * instead of
	an rtx.
	(emit_jump_insn_before_noloc): Likewise.
	(emit_call_insn_before_noloc): Likewise.
	(emit_label_before): Likewise.
	(emit_label_after): Likewise.
	(emit_insn_before_setloc): Likewise.
	(emit_jump_insn_before_setloc): Likewise.
	(emit_call_insn_before_setloc): Likewise.
	(emit_call_insn_before): Likewise.
	* rtl.h: Adjust.

From-SVN: r214933
2014-09-05 02:31:40 +00:00
David Malcolm 8f6bce51a7 Params to modified_between_p
gcc/
2014-09-05  David Malcolm  <dmalcolm@redhat.com>

	* rtl.h (modified_between_p): Strengthen params 2 and 3 from
	const_rtx to const rtx_insn *.
	* rtlanal.c (modified_between_p): Likewise, eliminating a checked
	cast.

From-SVN: r214931
2014-09-05 01:24:47 +00:00
David Malcolm e5b51ca02b fixup_args_size_notes takes a pair of rtx_insn
gcc/
2014-09-05  David Malcolm  <dmalcolm@redhat.com>

	* emit-rtl.c (try_split): Update NULL_RTX to NULL in call to
	fixup_args_size_notes.
	* expr.c (fixup_args_size_notes): Strengthen first two params from
	rtx to rtx_insn *, eliminating a checked cast.
	* rtl.h (fixup_args_size_notes): Strengthen first two params from
	rtx to rtx_insn *.

From-SVN: r214930
2014-09-05 01:14:41 +00:00
Trevor Saunders e4685bc8ca Change the types of arguments and return values for several functions from rtx to rtx_insn *
gcc/ChangeLog:

2014-09-04  Trevor Saunders  <tsaunders@mozilla.com>

	* emit-rtl.c (get_first_nonnote_insn): Return rtx_insn * instead of
	rtx.
	(get_last_nonnote_insn): Likewise.
	(next_nonnote_insn_bb): Take rtx_insn * instead of rtx.
	* resource.c (find_basic_block): Likewise.
	* rtl.h: Adjust.
	* rtlanal.c (keep_with_call_p): Take const rtx_insn * instead of
	const_rtx.

From-SVN: r214922
2014-09-04 21:11:23 +00:00
David Malcolm 8e3177d9a6 eh_returnjump_p takes an rtx_insn
2014-09-04  David Malcolm  <dmalcolm@redhat.com>

gcc/
	* jump.c (eh_returnjump_p): Strengthen param "insn" from rtx to
	rtx_insn *.

	* rtl.h (eh_returnjump_p): Likewise.

From-SVN: r214919
2014-09-04 20:34:36 +00:00
David Malcolm 4ce524a1c1 Make next_insn and previous_insn require an rtx_insn *
gcc/
2014-08-28  David Malcolm  <dmalcolm@redhat.com>

	* rtl.h (previous_insn): Strengthen param from rtx to rtx_insn *.
	(next_insn): Likewise.
	* emit-rtl.c (next_insn): Likewise.
	(previous_insn): Likewise.
	* config/pa/pa.c (remove_useless_addtr_insns): Strenghten locals
	"insn" and "next" from rtx to rtx_insn *.
	* config/picochip/picochip.c (picochip_reorg): Likewise for locals
	"insn", "insn1", "vliw_start",  "prologue_end_note",
	"last_insn_in_packet".

From-SVN: r214708
2014-08-29 00:17:58 +00:00
David Malcolm 3064b94272 Make INSN_HAS_LOCATION require an rtx_insn
gcc/
2014-08-28  David Malcolm  <dmalcolm@redhat.com>

	* rtl.h (INSN_HAS_LOCATION): Strengthen param from const_rtx to
	const rtx_insn *.

	* print-rtl.c (print_rtx): Add checked cast to const rtx_insn *
	in invocation of INSN_HAS_LOCATION.

From-SVN: r214700
2014-08-29 00:02:25 +00:00
David Malcolm b32d518945 NEXT_INSN and PREV_INSN take a const rtx_insn
gcc/
2014-08-28  David Malcolm  <dmalcolm@redhat.com>

	* rtl.h (RTX_PREV): Added checked casts to uses of PREV_INSN and
	NEXT_INSN.
	(PREV_INSN): Strengthen param from const_rtx to const rtx_insn *.
	(NEXT_INSN): Likewise.
	(JUMP_LABEL_AS_INSN): Add a "const" modifier to param.
	(reg_used_between_p): Strengthen params 2 and 3 from const_rtx to
	const rtx_insn *.
	(no_labels_between_p): Likewise for both params.

	* config/aarch64/aarch64.c (aarch64_output_casesi): Add a checked
	cast when using NEXT_INSN on operands[2].
	* config/alpha/alpha.c (alpha_set_memflags): Strengthen local
	"insn" from rtx to rtx_insn *, adding a checked cast.
	(alpha_handle_trap_shadows): Strengthen locals "i", "n" from rtx to
	rtx_insn *.
	* config/arc/arc-protos.h (arc_ccfsm_record_condition): Likewise
	for third param.
	(arc_text_label): Likewise for param "insn".
	* config/arc/arc.c (arc_expand_epilogue): Likewise for local
	"insn".
	(arc_ccfsm_record_condition): Likewise for param "jump".
	(arc_text_label): Likewise for local "label".
	* config/arc/arc.md (doloop_begin_i): Likewise for local "scan".
	Introduce a local "seq" via a dyn_cast to rtx_sequence *, and use
	a method for typesafety.  Add a checked cast.
	* config/arc/constraints.md (Clb): Add a checked cast when getting
	the CODE_LABEL from a LABEL_REF.
	* config/arm/arm.c (require_pic_register): Strengthen locals
	"seq", "insn" from rtx to rtx_insn *.
	(create_fix_barrier): Likewise for locals "selected", "next".
	(thumb1_reorg): Likewise for locals "prev", "insn".
	(arm_expand_prologue): Likewise for local "last".
	(thumb1_output_casesi): Add a checked cast when using NEXT_INSN on
	operands[0].
	(thumb2_output_casesi): Likewise for operands[2].
	* config/avr/avr-log.c (avr_log_vadump): Within 'L' case,
	strengthen local "insn" from rtx to rtx_insn *.
	* config/bfin/bfin.c (find_next_insn_start): Likewise for return
	type and param "insn".
	(find_prev_insn_start): Likewise.
	(hwloop_optimize): Likewise for locals "insn", "last_insn",
	"prev".
	(gen_one_bundle): Likewise for loal "t".
	(find_load): Likewise for param "insn".
	(workaround_speculation): Likewise for locals "insn", "next",
	"target", "next_tgt".
	* config/c6x/c6x.c (assign_reservations): Likewise for both params
	and for locals "insn", "within", "last".
	(count_unit_reqs): Likewise for params "head", "tail" and local
	"insn".
	(try_rename_operands): Likewise for params "head", "tail".
	(reshuffle_units): Likewise for locals "head", "tail", "insn".
	(struct c6x_sched_context): Likewise for fields
	"last_scheduled_insn", "last_scheduled_iter0".
	(init_sched_state): Replace NULL_RTX with NULL.
	(reorg_split_calls): Strengthen local "new_cycle_first" from rtx
	to rtx_insn *.
	(undo_split_delayed_nonbranch): Likewise for param and for local
	"prev".
	(conditionalize_after_sched): Likewise for local "insn".
	(bb_earliest_end_cycle): Likewise.
	(filter_insns_above): Likewise for locals "insn", "next".
	(hwloop_optimize): Remove redundant checked cast.
	(hwloop_fail): Strengthen local "t" from rtx to rtx_insn *.
	* config/cris/cris.c (cris_initial_frame_pointer_offset): Replace
	NULL_RTX with NULL.
	(cris_simple_epilogue): Likewise.
	(cris_expand_prologue): Likewise.
	(cris_expand_epilogue): Likewise.
	* config/frv/frv.c (frv_function_contains_far_jump): Strengthen
	local "insn" from rtx to rtx_insn *.
	(frv_ifcvt_modify_tests): Likewise for locals "last_insn", "insn".
	(struct frv_packet_group): Likewise for the elements within array
	fields "insns", "sorted", and for field "nop".
	(frv_packet): Likewise for the elements within array field
	"insns".
	(frv_add_insn_to_packet): Likewise for param "insn".
	(frv_insert_nop_in_packet): Likewise for param "insn" and local
	"last".
	(frv_for_each_packet): Likewise for locals "insn", "next_insn".
	(frv_sort_insn_group_1): Likewise for local "insn".
	(frv_optimize_membar_local): Likewise.
	(frv_align_label): Likewise for locals "x", "last", "barrier",
	"label".
	* config/ia64/ia64.c (last_scheduled_insn): Likewise for this
	local.
	(ia64_sched_init): Likewise for local "insn".
	(scheduled_good_insn): Likewise for param "last".
	(struct _ia64_sched_context): Likewise for field
	"last_scheduled_insn".
	(ia64_init_sched_context): Replace NULL_RTX with NULL.
	(struct bundle_state): Likewise for field "insn".
	(issue_nops_and_insn): Likewise for param "insn".
	(get_next_important_insn): Likewise for return type and both
	params.
	(ia64_add_bundle_selector_before): Likewise for param "insn".
	(bundling): Likewise for params "prev_head_insn", "tail" and
	locals "insn", "next_insn", "b".  Eliminate top-level local rtx
	"nop" in favor of new locals rtx "nop_pat" and rtx_insn *nop;
	* config/iq2000/iq2000-protos.h (iq2000_fill_delay_slot):
	Strengthen final param from rtx to rtx_insn *.
	(iq2000_move_1word): Likewise for second param.
	* config/iq2000/iq2000.c (iq2000_fill_delay_slot): Likewise for
	param "cur_insn" and local "next_insn".
	(iq2000_move_1word): Likewise for param "insn".
	* config/iq2000/iq2000.md (insn before ADDR_DIFF_VEC): Add checked
	casts when using NEXT_INSN on operands[1].
	* config/m32c/m32c.c (m32c_function_needs_enter): Strengthen local
	"insn" from rtx to rtx_insn *.
	* config/m68k/m68k.c (m68k_jump_table_ref_p): Split out uses of
	"x", introducing local rtx_insn * "insn" for when working with the
	CODE_LABEL of the LABEL_REF.
	(m68k_sched_md_init_global): Strengthen local "insn" from rtx to
	rtx_insn *.
	* config/mcore/mcore-protos.h (mcore_is_dead): Likewise for first
	param.
	* config/mcore/mcore.c (emit_new_cond_insn): Likewise for return
	type.
	(conditionalize_block): Likewise for return type and param.
	(mcore_is_dead): Likewise for param "first" and local "insn".
	(emit_new_cond_insn): Likewise for return type.
	(conditionalize_block): Likewise for return type, param, and
	locals "insn", "blk_1_br", "end_blk_2_insn", "start_blk_3_lab",
	"newinsn".
	(conditionalize_optimization): Likewise for local "insn".
	* config/mep/mep.c (mep_jmp_return_reorg): Add checked cast when
	using NEXT_INSN.
	* config/microblaze/microblaze.md: Add checked casts when using
	NEXT_INSN.
	* config/mips/mips.c (mips_expand_prologue): Eliminate top-level
	rtx "insn" in favor of various more tightly-scoped rtx "insn" and
	and rtx_insn * "insn".
	* config/mips/mips.md (casesi_internal_mips16_<mode>): Add a
	checked cast when using NEXT_INSN on operands[2].
	* config/mn10300/mn10300.c (mn10300_insert_setlb_lcc): Strengthen
	local "insn" from rtx to rtx_insn *.
	* config/nds32/nds32-fp-as-gp.c (nds32_fp_as_gp_check_available):
	Likewise.
	* config/nds32/nds32-md-auxiliary.c (nds32_output_casesi_pc_relative):
	Add a checked cast when using NEXT_INSN on operands[1].
	* config/pa/pa-protos.h (pa_following_call): Strengthen param from
	rtx to rtx_insn *.
	(pa_output_cbranch): Likewise for final param.
	(pa_output_lbranch): Likewise for second param.
	(pa_output_bb): Likewise for third param.
	(pa_output_bvb): Likewise.
	(pa_output_dbra): Likewise for second param.
	(pa_output_movb): Likewise.
	(pa_output_parallel_movb): Likewise.
	(pa_output_parallel_addb): Likewise.
	(pa_output_millicode_call): Likewise for first param.
	(pa_output_mul_insn): Likewise for second param.
	(pa_output_div_insn): Likewise for third param.
	(pa_output_mod_insn): Likewise for second param.
	(pa_jump_in_call_delay): Likewise for param.
	* config/pa/pa.c (pa_output_mul_insn): Likewise for param "insn".
	(pa_output_div_insn): Likewise.
	(pa_output_mod_insn): Likewise.
	(pa_output_cbranch): Likewise.
	(pa_output_lbranch): Likewise.
	(pa_output_bb): Likewise.
	(pa_output_bvb): Likewise.
	(pa_output_dbra): Likewise.
	(pa_output_movb): Likewise.
	(pa_output_millicode_call): Likewise; use method of rtx_sequence *
	to simplify and for typesafety.
	(pa_output_call): Use method of rtx_sequence *.
	(forward_branch_p): Strengthen param "insn" from rtx to rtx_insn *.
	(pa_jump_in_call_delay): Likewise.
	(pa_output_parallel_movb): Likewise.
	(pa_output_parallel_addb): Likewise.
	(pa_following_call): Likewise.
	(pa_combine_instructions): Likewise for locals "anchor",
	"floater".
	(pa_can_combine_p): Likewise for params "anchor", "floater" and
	locals "start", "end".
	* config/picochip/picochip.c (picochip_reset_vliw): Likewise for
	param "insn" and local "local_insn".
	(picochip_final_prescan_insn): Likewise for local "local_insn".
	* config/rs6000/rs6000.c (compute_save_world_info): Likewise for
	local "insn".
	(uses_TOC): Likewise.
	* config/s390/s390.c (get_some_local_dynamic_name): Likewise.
	(s390_mainpool_finish): Eliminate top-level local rtx "insn",
	splitting out to more tightly-scoped locals, 3 as rtx and one as
	rtx_insn *.
	(s390_optimize_nonescaping_tx): Strengthen local "tmp" from rtx
	to rtx_insn *.
	(s390_emit_prologue): Introduce a local "insn" to be an rtx_insn *
	where needed.
	* config/sh/sh-protos.h (barrier_align): Strenghten param from rtx
	to rtx_insn *.
	(fixup_addr_diff_vecs): Likewise.
	(reg_unused_after): Likewise for param 2.
	(sh_can_redirect_branch): Likewise for both params.
	(check_use_sfunc_addr): Likewise for param 1.
	* config/sh/sh.c (fixup_mova): Likewise for local "worker".
	(find_barrier): Likewise for local "last_got".
	(gen_block_redirect): Likewise for return type, param "jump" and
	locals "prev", "scan", "next", "insn".
	(struct far_branch): Likewise for fields "near_label",
	"insert_place", "far_label".
	(gen_far_branch): Likewise for local "jump".
	(fixup_addr_diff_vecs): Likewise for param "first" and locals
	"insn", "prev".
	(barrier_align): Likewise for param and for locals "prev", "x".
	Introduce local rtx_sequence * "prev_seq" and use insn method for
	typesafety and clarity.
	(sh_reorg): Strengthen local "scan" from rtx to rtx_insn *.
	(get_dest_uid): Likewise for local "dest".
	(split_branches): Likewise for locals "next", "beyond", "label",
	"block", "far_label".  Add checked casts when assigning to
	bp->far_label and "far_label".
	(reg_unused_after): Strengthen param "scan" from rtx to rtx_insn *.
	(sequence_insn_p): Likewise.
	(mark_constant_pool_use): Likewise for locals "insn", "lab".  Add a
	more loop-scoped rtx "insn" when walking LABEL_REFS.
	(sh_can_redirect_branch): Strengthen both params from rtx to
	rtx_insn *.
	(check_use_sfunc_addr): Likewise for param "insn".  Introduce a
	new local rtx_sequence * "seq" via a dyn_cast, and use a method
	for clarity and typesafety.
	* config/sh/sh.md (define_expand "epilogue"): Strengthen local
	"insn" from rtx to rtx_insn *.
	(define_insn "casesi_worker_1"): Add a checked cast to rtx_insn *
	when using NEXT_INSN on the CODE_LABEL in operands[2].
	(define_insn "casesi_worker_2"): Likewise.
	(define_insn "casesi_shift_media"): Likewise.
	(define_insn "casesi_load_media"): Likewise for the CODE_LABEL in
	operands[3].
	* config/sh/sh_optimize_sett_clrt.cc (struct ccreg_value):
	Strengthen field "insn" from rtx to rtx_insn *.
	(sh_optimize_sett_clrt::execute): Likewise for locals "next_i", "i".
	(sh_optimize_sett_clrt::find_last_ccreg_values): Likewise for
	param "start_insn" and local "start_insn".
	* config/sh/sh_treg_combine.cc (struct set_of_reg): Likewise for
	field "insn".
	(find_set_of_reg_bb): Likewise for param "insn".
	(trace_reg_uses_1): Likewise for param "start_insn" and local "i".
	(trace_reg_uses): Likewise for param "start_insn".
	(sh_treg_combine::cbranch_trace): Likewise for field
	"cbranch_insn".
	(sh_treg_combine::cbranch_trace::cbranch_trace): Likewise for
	param "insn".
	(sh_treg_combine::record_set_of_reg): Likewise for param
	"start_insn" and local "i".
	(sh_treg_combine::can_remove_cstore): Likewise for local
	"prev_insn".
	(sh_treg_combine::try_optimize_cbranch): Likewise for param
	"insn".
	(sh_treg_combine::execute): Likewise for local "i".
	* config/sparc/sparc-protos.h (empty_delay_slot): Likewise for
	param.
	(sparc_check_64): Likewise for second param.
	* config/sparc/sparc.c (sparc_do_work_around_errata): Likewise for
	locals "insn", "next".  Introduce local rtx_sequence * "seq" via a
	dyn_cast, using its insn method for typesafety and clarity.
	(empty_delay_slot): Strengthen param "insn" from rtx to
	rtx_insn *.
	(set_extends): Likewise.
	(sparc_check_64): Likewise.
	* config/stormy16/stormy16.c (xstormy16_split_cbranch): Likewise
	for locals "seq", "last_insn".
	(combine_bnp): Likewise for param "insn".
	(xstormy16_reorg): Likewise for local "insn".
	* config/v850/v850.c (substitute_ep_register): Likewise for params
	"first_insn", "last_insn" and local "insn".
	(v850_reorg): Likewise for fields "first_insn", "last_insn" within
	elements of "regs" array, and local "insn".
	* except.c (emit_note_eh_region_end): Likewise for param "insn".
	* final.c (final_sequence): Strengthen this global from rtx to
	rtx_sequence *.
	(shorten_branches): Strenthen locals "rel_lab", "prev" from rtx to
	rtx_insn *.
	(final_scan_insn): Update assignment to "final_sequence" to be
	from "seq", the cast version of "body", for type-safety.
	* function.c (assign_parm_setup_reg): Strengthen locals "insn",
	"insns" from rtx to rtx_insn *.
	(thread_prologue_and_epilogue_insns): Likewise for local "seq".
	* genattr.c (main): When writing out generated insn-attr.h,
	strengthen params 1 and 3 of eligible_for_delay,
	eligible_for_annul_true, eligible_for_annul_false from rtx to
	rtx_insn *.
	* genattrtab.c (write_eligible_delay): Likewise when writing out
	generated insn-attrtab.c; also local "insn" the generated
	functions.
	* hw-doloop.c (discover_loops): Strengthen local "insn" from rtx
	to rtx_insn *.
	* hw-doloop.h (struct GTY hwloop_info_d): Strengthen field
	"start_label" from rtx to rtx_insn *.
	* ira.c (decrease_live_ranges_number): Likewise for local "p".
	(ira_update_equiv_info_by_shuffle_insn): Likewise for param
	"insns" and local "insn".
	(validate_equiv_mem): Likewise for param "start" and local "insn".
	(memref_used_between_p): Likewise for params "start", "end" and
	local "insn".
	* ira.h (ira_update_equiv_info_by_shuffle_insn): Likewise for
	final param.
	* loop-doloop.c (doloop_optimize): Within region guarded by
	INSN_P (doloop_pat), introduce a new local rtx_insn *
	"doloop_insn" via a checked cast, and use it for typesafety,
	eventually writing the value back into doloop_pat.
	* output.h (final_sequence): Strengthen this global from rtx to
	rtx_sequence *.
	* recog.c (peep2_attempt): Rename param "insn" to "uncast_insn",
	reintroducing "insn" as an rtx_insn * via a checked cast.
	Strengthen param "attempt" and local "new_insn"from rtx to
	rtx_insn *.
	(peephole2_optimize): Strengthen locals "insn", "attempt" from rtx
	to rtx_insn *.
	* ree.c (emit_note_eh_region_end): Likewise for local "insn".
	* reload1.c (reload_as_needed): Eliminate top-level locals "x" and
	"p" in favor of more tightly-scoped replacements, sometimes rtx
	and sometimes rtx_insn *, as appropriate.
	(delete_output_reload): Eliminate top-level rtx "i1", splitting
	into two loop-scoped locals, one an rtx, the other an rtx_insn *.
	* reorg.c (delete_scheduled_jump): Add checked cast.  Strengthen
	local "trial" from rtx to rtx_insn *.
	(redirect_with_delay_slots_safe_p): Strengthen param "jump" from
	rtx to rtx_insn *.  Strenghten local "pat" from rtx to
	rtx_sequence * and use methods for clarity and typesafety.
	(redirect_with_delay_list_safe_p): Strengthen param "jump" from
	rtx to rtx_insn *.  Strenghten local "li" from rtx to
	rtx_insn_list * and use its methods for clarity and typesafety.
	(steal_delay_list_from_target): Strengthen param "insn" from rtx
	to rtx_insn *.
	(steal_delay_list_from_fallthrough): Likewise.
	(try_merge_delay_insns): Likewise for param "thread" and locals
	"trial", "next_trial", "delay_insn".
	(redundant_insn): Likewise for param "target" and local "trial".
	(own_thread_p): Likewise for param "thread" and locals
	"active_insn", "insn".
	(get_label_before): Likewise for param "insn".
	(fill_simple_delay_slots): Likewise for local "new_label"; use
	JUMP_LABEL_AS_INSN as necessary when calling own_thread_p.
	(label_before_next_insn): Strengthen return type and local "insn"
	from rtx to rtx_insn *.
	(relax_delay_slots): Likewise for locals "other", "tmp".
	(make_return_insns): Likewise for param "first" and locals "insn",
	"jump_insn", "prev".  Move declaration of "pat" to its assignment
	and strengthen from rtx to rtx_sequence *.  Use its methods for
	clarity and typesafety.
	* rtlanal.c (no_labels_between_p): Strengthen params from
	const_rtx to const rtx_insn *.  Strengthen local "p" from rtx to
	rtx_insn *.
	(reg_used_between_p): Strengthen params "from_insn", "to_insn"
	from const_rtx to const rtx_insn *.
	(reg_set_between_p): Rename param "from_insn" to
	"uncast_from_insn", and reintroduce "from_insn" as a
	const rtx_insn * via a checked cast.
	(modified_between_p): Likewise for param "start" as "uncast_start".
	(tablejump_p): Add a cast when invoking NEXT_INSN on "label".
	* sel-sched-ir.c (get_seqno_by_preds): Strengthen param and locals
	"tmp", head" from rtx to rtx_insn *.
	(recompute_rev_top_order): Likewise for local "insn".
	* sel-sched-ir.h (get_seqno_by_preds): Likewise for param.
	* store-motion.c (build_store_vectors): Likewise for local "insn".
	Strengthen local "st" from rtx to rtx_insn_list * and use methods
	for clarity and typesafety.
	* tree-ssa-loop-ivopts.c (seq_cost): Strengthen param "seq" from
	rtx to rtx_insn *.
	(computation_cost): Likewise for local "seq".
	(get_address_cost): Likewise.

/
2014-08-28  David Malcolm  <dmalcolm@redhat.com>

	* rtx-classes-status.txt (TODO): NEXT_INSN/PREV_INSN are done.

From-SVN: r214698
2014-08-28 21:29:38 +00:00
David Malcolm c5241a21a3 tablejump_p takes an rtx_insn
gcc/
2014-08-28  David Malcolm  <dmalcolm@redhat.com>

	* rtl.h (tablejump_p): Strengthen first param from const_rtx to
	const rtx_insn *.
	(label_is_jump_target_p): Likewise for second param.

	* rtlanal.c (tablejump_p): Likewise for param "insn".
	(label_is_jump_target_p): Likewise for param "jump_insn".

From-SVN: r214696
2014-08-28 20:51:33 +00:00
David Malcolm 9321cf00db find_first_parameter_load params and return type
gcc/
2014-08-28  David Malcolm  <dmalcolm@redhat.com>

	* rtl.h (find_first_parameter_load): Strengthen return type and
	both params from rtx to rtx_insn *.
	* rtlanal.c (find_first_parameter_load): Strengthen return type,
	both params and locals "before", "first_set" from rtx to
	rtx_insn *.  Remove now-redundant cast.
	* except.c (sjlj_mark_call_sites): Use NULL rather than NULL_RTX.

From-SVN: r214695
2014-08-28 20:49:58 +00:00
David Malcolm bdda9b179d Delete find_last_value
gcc/
2014-08-28  David Malcolm  <dmalcolm@redhat.com>

	* rtl.h (find_last_value): Delete.
	* rtlanal.c (find_last_value): Delete.

From-SVN: r214694
2014-08-28 20:47:49 +00:00
David Malcolm dc01c3d194 Work towards NEXT_INSN/PREV_INSN requiring insns as their params
gcc/
2014-08-28  David Malcolm  <dmalcolm@redhat.com>

	* cfgexpand.c (pass_expand::execute): Strengthen local "after"
	from rtx to rtx_insn *.
	* cfgrtl.c (force_nonfallthru_and_redirect): Replace use of local
	rtx "note" with new local rtx_insn * "new_head" when calculating
	head insn of new basic block.
	* combine.c (combine_split_insns): Strengthen return type and local
	"ret" from rtx to rtx_insn *.
	(likely_spilled_retval_p): Likewise for locals "use" and "p".
	(try_combine): Eliminate local "m_split", splitting into new
	locals "m_split_insn" and "m_split_pat".
	(find_split_point): Strengthen local "seq" from rtx into
	rtx_insn *.
	* config/spu/spu.c (spu_machine_dependent_reorg): Likewise for
	locals "label", "branch".
	* config/spu/spu.md (define_expand "smulsi3_highpart"): Likewise
	for local "insn".
	(define_expand "umulsi3_highpart"): Likewise for local "insn".
	* dse.c (note_add_store_info): Likewise for fields "first",
	"current".
	(note_add_store): Likewise for local "insn".
	(emit_inc_dec_insn_before): Likewise for locals "insn",
	"new_insn", "cur".
	(find_shift_sequence): Likewise for locals "shift_seq", "insn".
	(replace_read): Likewise for locals "insns", "this_insn".
	* dwarf2cfi.c (dw_trace_info): Likewise for field "eh_head".
	(notice_eh_throw): Likewise for param "insn".
	(before_next_cfi_note): Likewise for return type, param, and local
	"prev".
	(connect_traces): Likewise for local "note".
	* emit-rtl.c (reset_all_used_flags): Likewise for local "p".
	(verify_rtl_sharing): Likewise.
	(unshare_all_rtl_in_chain): Likewise for param "insn".
	(get_first_nonnote_insn): Likewise for local "insn".
	(get_last_nonnote_insn): Likewise.  Introduce local rtx_sequence *
	"seq" and use its methods to clarify things.
	(next_insn): Strengthen return type from rtx to rtx_insn *.
	Rename param "insn" to "uncast_insn" and reintroduce "insn" as a
	local rtx_insn * using a checked cast, dropping a checked cast
	made redundant by this change.  Use a cast to and method of
	rtx_sequence to clarify the code.
	(previous_insn): Rename param "insn" to "uncast_insn" and
	reintroduce "insn" as a local rtx_insn * using a checked cast,
	dropping a checked cast made redundant by this change.  Use a cast
	to and method of rtx_sequence to clarify the code.
	(next_nonnote_insn): Rename param "insn" to "uncast_insn" and
	reintroduce "insn" as a local rtx_insn * using a checked cast,
	dropping a checked cast made redundant by this change.
	(next_nonnote_insn_bb): Likewise.
	(prev_nonnote_insn): Likewise.
	(prev_nonnote_insn_bb): Likewise.
	(next_nondebug_insn): Likewise.
	(prev_nondebug_insn): Likewise.
	(next_nonnote_nondebug_insn): Likewise.
	(prev_nonnote_nondebug_insn): Likewise.
	(next_real_insn): Likewise.
	(prev_real_insn): Likewise.
	(next_active_insn): Likewise.
	(prev_active_insn): Likewise.
	(next_cc0_user): Likewise.  Use rtx_sequence and a method for
	clarity.
	(prev_cc0_setter): Likewise.
	(try_split): Rename param "trial" to "uncast_trial" and
	reintroduce "insn" as a local rtx_insn * using a checked cast,
	dropping checked casts made redundant by this change.
	Strengthen locals "seq", "tem", "insn_last", "insn", "next" from
	rtx to rtx_insn *.
	(remove_insn): Rename param "insn" to "uncast_insn" and
	reintroduce "insn" as a local rtx_insn * using a checked cast.
	(emit_pattern_after_setloc): Likewise for param "after", as
	"uncast_after".
	(emit_pattern_after): Likewise.  Strengthen local "prev" from
	rtx to rtx_insn *.
	(emit_pattern_before_setloc): Rename param "before" to
	"uncast_before" and reintroduce "before" as a local rtx_insn *
	using a checked cast.  Strengthen locals "first", "last" from
	rtx to rtx_insn *.
	(emit_pattern_before): Likewise rename/cast param "before" to
	"uncast_before". Strengthen local "next" from rtx to rtx_insn *.
	* except.c (copy_reg_eh_region_note_forward): Strengthen param
	"first" and local "insn" from rtx to rtx_insn *.
	(copy_reg_eh_region_note_backward): Likewise for param "last"
	and local "insn".
	* expr.c (fixup_args_size_notes): Rename param "last" to
	"uncast_last" and reintroduce "last" as a local rtx_insn *
	using a checked cast.  Strengthen local "insn" from rtx to
	rtx_insn *.
	* function.c (set_insn_locations): Strengthen param "insn" from
	rtx to rtx_insn *.
	(record_insns): Likewise for param "insns" and local "tmp".
	(active_insn_between): Rename param "tail" to
	"uncast_tail" and reintroduce "tail" as a local rtx_insn *
	using a checked cast.
	(thread_prologue_and_epilogue_insns): Split out top-level local
	rtx "seq" into three different rtx_insn * locals.  Strengthen
	local "prologue_seq" from rtx to rtx_insn *.
	* gcse.c (insert_insn_end_basic_block): Strenghen local "insn"
	from rtx to rtx_insn *.
	* haifa-sched.c (initiate_bb_reg_pressure_info): Likewise.
	(priority): Likewise for locals "prev_first", "twin".
	(setup_insn_max_reg_pressure): Likewise for param "after".
	(sched_setup_bb_reg_pressure_info): Likewise.
	(no_real_insns_p): Strengthen params from const_rtx to
	const rtx_insn *.
	(schedule_block): Strengthen local "next_tail" from rtx to
	rtx_insn *.
	* ifcvt.c (find_active_insn_before): Strengthen return type and
	param "insn" from rtx to rtx_insn *.
	(find_active_insn_after): Likewise.
	(cond_exec_process_insns): Likewise for param "start" and local "insn".
	(cond_exec_process_if_block): Likewise for locals "then_start",
	"then_end", "else_start", "else_end", "insn", "start", "end", "from".
	(noce_process_if_block): Likewise for local "jump".
	(merge_if_block): Likewise for two locals named "end".
	(cond_exec_find_if_block): Likewise for local "last_insn".
	* jump.c (delete_related_insns): Rename param "insn" to
	"uncast_insn" and reintroduce "insn" as a local rtx_insn * using a
	checked cast.  Strengthen local "p" from rtx to rtx_insn *.
	* lra-constraints.c (inherit_reload_reg): Replace NULL_RTX with
	NULL.
	(split_reg): Likewise.
	* lra.c (lra_process_new_insns): Likewise.
	* modulo-sched.c (permute_partial_schedule): Strengthen param
	"last" from rtx to rtx_insn *.
	* optabs.c (add_equal_note): Likewise for param "insns" and local
	"last_insn".
	(expand_binop_directly): Add checked casts to rtx_insn * within
	NEXT_INSN (pat) uses.
	(expand_unop_direct): Likewise.
	(maybe_emit_unop_insn): Likewise.
	* recog.c (peep2_attempt): Strengthen locals "last",
	"before_try", "x" from rtx to rtx_insn *.
	* reorg.c (optimize_skip): Strengthen return type and local
	"delay_list" from rtx to rtx_insn_list *.  Strengthen param "insn"
	and locals "trial", "next_trial" from rtx to rtx_insn *.
	* resource.c (next_insn_no_annul): Strengthen return type and
	param "insn" from rtx to rtx_insn *.  Use a cast to and method of
	rtx_sequence to clarify the code.
	(mark_referenced_resources): Add a checked cast to rtx_insn *
	within PREV_INSN (x).
	(find_dead_or_set_registers): Strengthen return type, param
	"target", locals "insn", "next", "jump_insn", "this_jump_insn"
	from rtx to rtx_insn *.  Strengthen param "jump_target" from rtx *
	to rtx_insn **.
	(mark_target_live_regs): Strengthen params "insns" and "target",
	locals "insn", "jump_target", "start_insn", "stop_insn" from rtx
	to rtx_insn *.  Use cast to and method of rtx_sequence to clarify
	the code.
	* resource.h (mark_target_live_regs): Strengthen params 1 and 2
	from rtx to rtx_insn *.
	* rtl.h (copy_reg_eh_region_note_forward): Strengthen second param
	from rtx to rtx_insn *.
	(copy_reg_eh_region_note_backward): Likewise.
	(unshare_all_rtl_in_chain): Likewise for sole param.
	(dump_rtl_slim): Strengthen second and third params from const_rtx
	to const rtx_insn *.
	* sched-deps.c (sched_free_deps): Strengthen params "head" and
	"tail" and locals "insn", "next_tail" from rtx to rtx_insn *.
	* sched-ebb.c (init_ready_list): Strengthen locals "prev_head",
	"next_tail" from rtx to rtx_insn *.
	(begin_move_insn): Likewise for local "next".
	* sched-int.h (sched_free_deps): Likewise for first and second
	params.
	(no_real_insns_p): Strengthen both params from const_rtx to
	const rtx_insn *.
	(sched_setup_bb_reg_pressure_info): Strengthen second params from
	rtx to rtx_insn *.
	* sched-rgn.c (init_ready_list): Likewise for locals "prev_head",
	"next_tail".
	* sched-vis.c (dump_rtl_slim): Strengthen params "first", "last"
	and locals "insn", "tail" from const_rtx to const rtx_insn *.
	(rtl_dump_bb_for_graph): Strengthen local "insn" from rtx to
	rtx_insn *.
	(debug_rtl_slim): Strengthen params "first" and "last" from
	const_rtx to const rtx_insn *.
	* shrink-wrap.c (try_shrink_wrapping): Strengthen param
	"prologue_seq" and locals "seq", "p_insn" from rtx to rtx_insn *.
	(convert_to_simple_return): Likewise for param "returnjump".
	* shrink-wrap.h (try_shrink_wrapping): Likewise for param
	"prologue_seq".
	(convert_to_simple_return): Likewise for param "returnjump".
	* valtrack.c (propagate_for_debug): Likewise for params
	"insn", "last".
	* valtrack.h (propagate_for_debug): Likewise for second param.

From-SVN: r214693
2014-08-28 20:45:40 +00:00
David Malcolm b5241a5a9c Convert nonlocal_goto_handler_labels from an EXPR_LIST to an INSN_LIST
gcc/
2014-08-28  David Malcolm  <dmalcolm@redhat.com>

	* function.h (struct rtl_data): Convert field
	"x_nonlocal_goto_handler_labels" from rtx_expr_list * to
	rtx_insn_list *.
	* rtl.h (remove_node_from_insn_list): New prototype.

	* builtins.c (expand_builtin): When prepending to
	nonlocal_goto_handler_labels, use gen_rtx_INSN_LIST rather than
	gen_rtx_EXPR_LIST.
	* cfgbuild.c (make_edges): Convert local "x" from rtx_expr_list *
	to rtx_insn_list *, and use its "insn" method rather than
	"element" method.
	* cfgrtl.c (delete_insn): Use new function
	remove_node_from_insn_list rather than
	remove_node_from_expr_list.
	(cfg_layout_initialize): Convert local "x" from rtx_expr_list *
	to rtx_insn_list *, and use its "insn" method rather than
	"element" method.
	* dwarf2cfi.c (create_trace_edges): Likewise for local "lab".
	* reload1.c (set_initial_label_offsets): Likewise for local "x".
	* rtlanal.c (remove_node_from_insn_list): New function, adapted
	from remove_node_from_expr_list.
	* stmt.c (expand_label): When prepending to
	nonlocal_goto_handler_labels, use gen_rtx_INSN_LIST rather than
	gen_rtx_EXPR_LIST.

From-SVN: r214687
2014-08-28 19:03:22 +00:00
David Malcolm e6eda74618 Make SET_NEXT_INSN/SET_PREV_INSN require an rtx_insn
gcc/
2014-08-28  David Malcolm  <dmalcolm@redhat.com>

	* rtl.h (SET_PREV_INSN): Strengthen param from rtx to rtx_insn *.
	(SET_NEXT_INSN): Likewise.
	(gen_rtvec_v): Add an overload for param types (int, rtx_insn **).

	* config/c6x/c6x.c (gen_one_bundle): Strengthen param "slot" from
	rtx * to rtx_insn **.  Introduce a new local rtx "seq", using it
	to split out the SEQUENCE from local "bundle", strengthening the
	latter from rtx to rtx_insn * to hold the insn holding the SEQUENCE.
	Strengthen locals "t" and "insn" from rtx to rtx_insn *.
	(c6x_gen_bundles): Strengthen locals "insn", "next", "last_call"
	and the type of the elements of the "slot" array from rtx to
	rtx_insn *.
	(reorg_split_calls): Likewise for locals "insn" and "next", and
	the type of the elements of the "slot" array.

	* config/frv/frv.c (frv_nops): Likewise for the elements of this
	array.
	(frv_function_prologue): Likewise for locals "insn", "next",
	"last_call".
	(frv_register_nop): Introduce a local "nop_insn" to be the
	rtx_insn * containing rtx "nop".

	* config/mep/mep.c (mep_make_bundle): Param "core" is sometimes
	used as an insn and sometimes as a pattern, so rename it to
	"core_insn_or_pat", and introduce local rtx_insn * "core_insn",
	using it where dealing with the core insn.

	* config/picochip/picochip.c (reorder_var_tracking_notes):
	Strengthen locals "insn", "next", "last_insn", "queue",
	"next_queue", "prev" from rtx to rtx_insn *.

	* emit-rtl.c (gen_rtvec_v): Add overloaded implementation for when
	the second param is an rtx_insn ** rather than an rtx **.
	(link_insn_into_chain): Strengthen locals "seq" and "sequence"
	from rtx to rtx_sequence *, and introduce local named "sequence",
	using methods of rtx_sequence to clarify the code.
	(remove_insn): Introduce local rtx_sequence * named "sequence" and
	use its methods.
	(emit_insn_after_1): Strengthen return type from rtx to rtx_insn *.
	Rename param "after" to "uncast_after", reintroducing "after" as a
	local rtx_insn * with a checked cast.
	(emit_pattern_after_noloc): Rename param "after" to "uncast_after",
	reintroducing "after" as a local rtx_insn * with a checked cast.
	Strengthen local "last" from rtx to rtx_insn * and remove the
	now-redundant checked casts.
	(copy_delay_slot_insn): Strengthen return type and param from rtx
	to rtx_insn *.

	* haifa-sched.c (reemit_notes): Strengthen params "insn" and
	"last" from rtx to rtx_insn *.

From-SVN: r214685
2014-08-28 18:59:13 +00:00
Richard Sandiford 6180e3d870 rtl.h (tls_referenced_p): Take a const_rtx rather than an rtx.
gcc/
	* rtl.h (tls_referenced_p): Take a const_rtx rather than an rtx.
	* rtlanal.c (tls_referenced_p_1): Delete.
	(tls_referenced_p): Take a const_rtx rather than an rtx.
	Use FOR_EACH_SUBRTX rather than for_each_rtx.

From-SVN: r214658
2014-08-28 06:24:40 +00:00
Richard Sandiford 8d8e205b92 rtl.h (for_each_inc_dec_fn): Remove special case for -1.
gcc/
	* rtl.h (for_each_inc_dec_fn): Remove special case for -1.
	(for_each_inc_dec): Take an rtx rather than an rtx *.
	* cselib.c (cselib_record_autoinc_cb): Update accordingly.
	(cselib_record_sets): Likewise.
	* dse.c (emit_inc_dec_insn_before, check_for_inc_dec_1)
	(check_for_inc_dec): Likewise.
	* rtlanal.c (for_each_inc_dec_ops): Delete.
	(for_each_inc_dec_find_inc_dec): Take the MEM as argument,
	rather than a pointer to the memory address.  Replace
	for_each_inc_dec_ops argument with separate function and data
	arguments.  Abort on non-autoinc addresses.
	(for_each_inc_dec_find_mem): Delete.
	(for_each_inc_dec): Take an rtx rather than an rtx *.  Use
	FOR_EACH_SUBRTX_VAR to visit every autoinc MEM.

From-SVN: r214657
2014-08-28 06:24:36 +00:00
Richard Sandiford f7d0b0fc77 rtl.h (find_all_hard_regs): Declare.
gcc/
	* rtl.h (find_all_hard_regs): Declare.
	* rtlanal.c (find_all_hard_regs): New function.
	(record_hard_reg_uses_1): Delete.
	(record_hard_reg_uses): Use find_all_hard_regs.

From-SVN: r214656
2014-08-28 06:24:32 +00:00
Richard Sandiford a2b7026c2e rtl.h (replace_label_data): Delete.
gcc/
	* rtl.h (replace_label_data): Delete.
	(replace_label): Take the old label, new label and update-nuses flag
	as direct arguments.  Return void.
	* cfgcleanup.c (outgoing_edges_match): Update accordingly.
	* rtlanal.c (replace_label): Update interface as above.  Handle
	JUMP_TABLE_DATA as a special case.  Handle JUMPs outside the
	iterator.  Use FOR_EACH_SUBRTX_PTR.

From-SVN: r214655
2014-08-28 06:24:27 +00:00
Richard Sandiford e08cf83616 rtl.h (get_pool_constant, [...]): Replace rtx parameters with const_rtx parameters.
gcc/
	* rtl.h (get_pool_constant, rtx_referenced_p): Replace rtx parameters
	with const_rtx parameters.
	* varasm.c (get_pool_constant): Likewise.
	* rtlanal.c (rtx_referenced_p_1): Delete.
	(rtx_referenced_p): Use FOR_EACH_SUBRTX instead of for_each_rtx.
	Assert that the rtx we're looking for is nonnull.  Allow searches
	for constant pool SYMBOL_REFs.

From-SVN: r214654
2014-08-28 06:24:23 +00:00
David Malcolm 710427e290 Add JUMP_LABEL_AS_INSN
gcc/
2014-08-27  David Malcolm  <dmalcolm@redhat.com>

	* rtl.h (JUMP_LABEL_AS_INSN): New.

From-SVN: r214607
2014-08-27 20:44:45 +00:00
David Malcolm 2f33ff0a9d Use rtx_expr_list in various places
gcc/
2014-08-27  David Malcolm  <dmalcolm@redhat.com>

	* rtl.h (free_EXPR_LIST_list): Strengthen param from rtx * to
	rtx_expr_list **.
	(alloc_EXPR_LIST): Strengthen return type from rtx to
	rtx_expr_list *.
	(remove_free_EXPR_LIST_node): Likewise for param.
	* reload.h (struct reg_equivs_t): Strengthen field "alt_mem_list"
	from rtx to rtx_expr_list *.
	* sched-int.h (struct deps_desc): Strengthen fields
	"pending_read_mems" and "pending_write_mems" from rtx to
	rtx_expr_list *.

	* dwarf2out.c (decl_piece_varloc_ptr): Strengthen return type from
	rtx to rtx_expr_list *.
	* lists.c (alloc_INSN_LIST): Likewise, also for local "r".
	(free_EXPR_LIST_list): Strengthen param "listp" from rtx * to
	rtx_expr_list **.
	(remove_free_EXPR_LIST_node): Likewise.  Strengthen local "node"
	from rtx to rtx_expr_list *.
	* loop-iv.c (simplify_using_initial_values): Strengthen local
	"cond_list" from rtx to rtx_expr_list *, and locals "pnode",
	"pnote_next" from rtx * to rtx_expr_list **.
	* sched-deps.c (remove_from_both_dependence_lists):  Strengthen
	param "exprp" from rtx * to rtx_expr_list **.
	(add_insn_mem_dependence): Strengthen local "mem_list" from
	rtx * to rtx_expr_list **.  Strengthen local "mem_node" from rtx
	to rtx_expr_list *.
	* sched-rgn.c (concat_insn_mem_list): Strengthen param "copy_mems"
	and local "new_mems" from rtx to rtx_expr_list *.  Strengthen
	param "old_mems_p" from rtx * to rtx_expr_list **.
	* var-tracking.c (struct adjust_mem_data): Strengthen field
	"side_effects" from rtx to rtx_expr_list *.
	(adjust_insn): Replace NULL_RTX with NULL when assigning to
	rtx_expr_list *.
	(prepare_call_arguments): Likewise.

From-SVN: r214605
2014-08-27 20:40:05 +00:00
David Malcolm 2382940b41 rtl_data.x_nonlocal_goto_handler_labels becomes an rtx_expr_list
gcc/
2014-08-27  David Malcolm  <dmalcolm@redhat.com>

	* function.h (struct rtl_data): Strengthen field
	x_nonlocal_goto_handler_labels from rtx to rtx_expr_list *.
	* rtl.h (remove_node_from_expr_list): Strengthen second param from
	rtx * to rtx_expr_list **.

	* cfgbuild.c (make_edges): In loop over
	nonlocal_goto_handler_labels, strengthen local "x" from rtx to
	rtx_expr_list *, and use methods of the latter class to clarify
	the code.
	* cfgrtl.c (cfg_layout_initialize): Strengthen local "x" from rtx to
	rtx_expr_list *, and use methods of the latter class to clarify
	the code.
	* dwarf2cfi.c (create_trace_edges): Likewise for local "lab".
	* reload1.c (set_initial_label_offsets): Likewise for local "x".
	* rtlanal.c (remove_node_from_expr_list): Strengthen param "listp"
	from rtx * to rtx_expr_list **.  Strengthen local "temp" from rtx
	to rtx_expr_list *.  Use methods of the latter class to clarify
	the code.

From-SVN: r214603
2014-08-27 20:35:53 +00:00
David Malcolm 38e60c554d Introduce rtx_expr_list subclass of rtx_def
gcc/
2014-08-27  David Malcolm  <dmalcolm@redhat.com>

	* coretypes.h (class rtx_expr_list): Add forward declaration.
	* emit-rtl.c (gen_rtx_EXPR_LIST): New.
	* gengenrtl.c (special_rtx): Add EXPR_LIST.
	* rtl.h (class rtx_expr_list): New subclass of rtx_def, adding
	invariant: GET_CODE (X) == EXPR_LIST.
	(is_a_helper <rtx_expr_list *>::test): New.
	(rtx_expr_list::next): New.
	(rtx_expr_list::element): New.
	(gen_rtx_EXPR_LIST): New.

From-SVN: r214601
2014-08-27 20:30:51 +00:00
David Malcolm 84fa8d9c4e Introduce rtx_sequence subclass of rtx_def
gcc/
2014-08-27  David Malcolm  <dmalcolm@redhat.com>

	* coretypes.h (class rtx_sequence): Add forward declaration.
	* rtl.h (class rtx_sequence): New subclass of rtx_def, adding
	invariant: GET_CODE (X) == SEQUENCE.
	(is_a_helper <rtx_sequence *>::test): New.
	(is_a_helper <const rtx_sequence *>::test): New.
	(rtx_sequence::len): New.
	(rtx_sequence::element): New.
	(rtx_sequence::insn): New.

From-SVN: r214591
2014-08-27 19:56:45 +00:00
David Malcolm 3dc99c19a5 Use rtx_insn_list in various places
gcc/
2014-08-27  David Malcolm  <dmalcolm@redhat.com>

	* rtl.h (free_INSN_LIST_list): Strengthen param from rtx * to
	rtx_insn_list **.
	(alloc_INSN_LIST): Strengthen return type from rtx to
	rtx_insn_list *.
	(copy_INSN_LIST): Likewise for return type and param.
	(concat_INSN_LIST): Likewise for both params and return type.
	(remove_free_INSN_LIST_elem): Strenghten first param from rtx to
	rtx_insn *.  Strengthen second param from rtx * to rtx_insn_list **.
	(remove_free_INSN_LIST_node): Strenghten return type from rtx to
	rtx_insn *.  Strengthen param from rtx * to rtx_insn_list **.

	* sched-int.h (struct deps_reg): Strengthen fields "uses", "sets",
	"implicit_sets", "control_uses", "clobbers" from rtx to
	rtx_insn_list *.
	(struct deps_desc): Likewise for fields "pending_read_insns",
	"pending_write_insns", "pending_jump_insns",
	"last_pending_memory_flush", "last_function_call",
	"last_function_call_may_noreturn", "sched_before_next_call",
	"sched_before_next_jump".
	(struct _haifa_deps_insn_data): Likewise for field "cond_deps".
	(remove_from_deps): Strengthen second param from rtx to rtx_insn *.

	* gcse.c (struct ls_expr): Strengthen fields "loads" and "stores"
	from rtx to rtx_insn_list *.
	(ldst_entry): Replace use of NULL_RTX with NULL when dealing with
	rtx_insn_list *.

	* haifa-sched.c (insn_queue): Strengthen this variable from rtx *
	to rtx_insn_list **.
	(dep_cost_1): Strengthen local "dep_cost_rtx_link" from rtx to
	rtx_insn_list *.
	(queue_insn): Likewise for local "link".
	(struct haifa_saved_data): Strengthen field "insn_queue" from
	rtx * to rtx_insn_list **.
	(save_backtrack_point): Update allocation of save->insn_queue to
	reflect the strengthening of elements from rtx to rtx_insn_list *.
	(queue_to_ready): Strengthen local "link" from rtx to
	rtx_insn_list *; use methods "next" and "insn" when traversing the
	list.
	(early_queue_to_ready): Likewise for locals "link", "next_link",
	"prev_link".
	(schedule_block): Update allocation of insn_queue to reflect the
	strengthening of elements from rtx to rtx_insn_list *.  Strengthen
	local "link" from rtx to rtx_insn_list *, and use methods when
	working it.
	(add_to_speculative_block): Strengthen locals "twins" and
	"next_node" from rtx to rtx_insn_list *, and use methods when
	working with them.  Strengthen local "twin" from rtx to
	rtx_insn *, eliminating a checked cast.
	(fix_recovery_deps): Strengthen locals "ready_list" and "link"
	from rtx to rtx_insn_list *, and use methods when working with
	them.

	* lists.c (alloc_INSN_LIST): Strengthen return type and local "r"
	from rtx to rtx_insn_list *, adding a checked cast.
	(free_INSN_LIST_list): Strengthen param "listp" from rtx * to
	rtx_insn_list **.
	(copy_INSN_LIST): Strengthen return type and locals "new_queue",
	"newlink" from rtx to rtx_insn_list *.  Strengthen local
	"pqueue" from rtx * to rtx_insn_list **.  Strengthen local "x"
	from rtx to rtx_insn *.
	(concat_INSN_LIST): Strengthen return type and local "new_rtx",
	from rtx to rtx_insn_list *.  Use methods of the latter class.
	(remove_free_INSN_LIST_elem): Strengthen param "elem" from rtx to
	rtx_insn *, and param "listp" from rtx * to rtx_insn_list **.
	(remove_free_INSN_LIST_node): Strengthen return type and local
	"elem" from rtx to rtx_insn *.  Strenghten param "listp" from
	rtx * to rtx_insn_list **.  Strengthen local "node" from rtx to
	rtx_insn_list *, using "insn" method.

	* sched-deps.c (add_dependence_list):  Strengthen param "list"
	from rtx to rtx_insn_list *, and use methods when working with it.
	(add_dependence_list_and_free):  Strengthen param "listp" from
	rtx * to rtx_insn_list **.
	(remove_from_dependence_list): Strenghten param "listp" from rtx *
	to rtx_insn_list **, and use methods when working with *listp.
	(remove_from_both_dependence_lists): Strengthen param "listp" from
	rtx * to rtx_insn_list **
	(add_insn_mem_dependence): Strengthen local "insn_list" from rtx *
	to rtx_insn_list **.  Eliminate local "link", in favor of two new
	locals "insn_node" and "mem_node", an rtx_insn_list * and an rtx
	respectively.
	(deps_analyze_insn): Split out uses 'f local "t" as an INSN_LIST
	by introducing local "cond_deps".
	(remove_from_deps): Strengthen param "insn" from rtx to
	rtx_insn *.

	* sched-rgn.c (concat_insn_mem_list): Strengthen param
	"copy_insns" and local "new_insns" from rtx to rtx_insn_list *.
	Strengthen param "old_insns_p" from rtx * to rtx_insn_list **.
	Use methods of rtx_insn_list.

	* store-motion.c (struct st_expr): Strengthen fields
	"antic_stores" and "avail_stores" from rtx to rtx_insn_list *.
	(st_expr_entry): Replace NULL_RTX with NULL when dealing with
	rtx_insn_list *.
	(find_moveable_store): Split out "tmp" into multiple more-tightly
	scoped locals.  Use methods of rtx_insn_list *.
	(compute_store_table): Strengthen local "tmp" from rtx to
	rtx_insn *.  Use methods of rtx_insn_list *.

From-SVN: r214590
2014-08-27 19:53:39 +00:00
David Malcolm a756c6be31 Introduce rtx_insn_list subclass of rtx_def
gcc/
2014-08-27  David Malcolm  <dmalcolm@redhat.com>

	* coretypes.h (class rtx_insn_list): Add forward declaration.
	* rtl.h (class rtx_insn_list): New subclass of rtx_def
	(is_a_helper <rtx_insn_list *>::test): New.
	(rtx_insn_list::next): New.
	(rtx_insn_list::insn): New.
	(gen_rtx_INSN_LIST): Add prototype.
	* emit-rtl.c (gen_rtx_INSN_LIST): New.
	* gengenrtl.c (special_rtx): Add INSN_LIST.

From-SVN: r214589
2014-08-27 19:49:43 +00:00
David Malcolm f11723d8cb Convert various INSN accessors in rtl.h to inline functions
gcc/
2014-08-27  David Malcolm  <dmalcolm@redhat.com>

	* rtl.h (INSN_UID): Convert from a macro to a pair of inline
	functions.  Require merely an rtx for now, not an rtx_insn *.
	(BLOCK_FOR_INSN): Likewise.
	(INSN_LOCATION): Likewise.
	(INSN_HAS_LOCATION): Convert from a macro to an inline function.

From-SVN: r214586
2014-08-27 19:40:43 +00:00
David Malcolm bd59c195f6 Convert PATTERN from a macro to a pair of inline functions
gcc/
2014-08-27  David Malcolm  <dmalcolm@redhat.com>

	* rtl.h (PATTERN): Convert this macro into a pair of inline
	functions, for now, requiring const_rtx and rtx.

From-SVN: r214585
2014-08-27 19:38:19 +00:00
David Malcolm b2908ba6db Remove DF_REF_INSN scaffolding
gcc/
2014-08-26  David Malcolm  <dmalcolm@redhat.com>

	* df.h (df_dump_insn_problem_function): Strengthen first param of
	this callback from const_rtx to const rtx_insn *.
	(struct df_insn_info): Strengthen field "insn" from rtx to
	rtx_insn *.
	(DF_REF_INSN): Eliminate this function, reinstating the older
	macro definition.
	(df_find_def): Strengthen param 1 from rtx to rtx_insn *.
	(df_reg_defined): Likewise.
	(df_find_use): Likewise.
	(df_reg_used): Likewise.
	(df_dump_insn_top): Strengthen param 1 from const_rtx to
	const rtx_insn *.
	(df_dump_insn_bottom): Likewise.
	(df_insn_debug): Strengthen param 1 from rtx to rtx_insn *.
	(df_insn_debug_regno): Likewise.
	(debug_df_insn): Likewise.
	(df_rd_simulate_one_insn): Likewise for param 2.
	(df_word_lr_simulate_defs): Likewise for param 1.
	(df_word_lr_simulate_uses): Likewise.
	(df_md_simulate_one_insn): Likewise for param 2.
	(df_simulate_find_noclobber_defs): Likewise for param 1.
	(df_simulate_find_defs): Likewise.
	(df_simulate_defs): Likewise.
	(df_simulate_uses): Likewise.
	(df_simulate_one_insn_backwards): Likewise for param 2.
	(df_simulate_one_insn_forwards): Likewise.
	(df_uses_create): Likewise for param 2.
	(df_insn_create_insn_record): Likewise for param 1.
	(df_insn_delete): Likewise.
	(df_insn_rescan): Likewise.
	(df_insn_rescan_debug_internal): Likewise.
	(df_insn_change_bb): Likewise.
	(df_notes_rescan): Likewise.
	* rtl.h (remove_death): Likewise for param 2.
	(print_rtl_with_bb): Strengthen param 2 from const_rtx to
	const rtx_insn *.
	* sched-int.h (reemit_notes): Strengthen param from rtx to
	rtx_insn *.
	* valtrack.h (propagate_for_debug): Likewise for param 1.

	* cfgrtl.c (print_rtl_with_bb): Strengthen param "rtx_first" and
	local "tmp_rtx" from const_rtx to const rtx_insn *.
	* combine.c (remove_death): Strengthen param "insn" from rtx to
	rtx_insn *.
	(move_deaths): Likewise for local "where_dead".
	* cse.c (delete_trivially_dead_insns): Introduce local
	"bind_var_loc" so that "bind" can be strengthened to an rtx_insn *.
	* df-core.c (df_find_def): Strengthen param "insn" from rtx to
	rtx_insn *.
	(df_reg_defined): Likewise.
	(df_find_use): Likewise.
	(df_reg_used): Likewise.
	(df_dump_insn_problem_data): Strengthen param "insn" from
	const_rtx to const rtx_insn *.
	(df_dump_insn_top): Likewise.
	(df_dump_insn_bottom): Likewise.
	(df_insn_debug): Strengthen param "insn" from rtx to rtx_insn *.
	(df_insn_debug_regno): Likewise.
	(debug_df_insn): Likewise.
	(DF_REF_INSN): Delete.
	* df-problems.c (df_rd_simulate_one_insn): Strengthen param "insn"
	from rtx to rtx_insn *.
	(df_chain_insn_top_dump): Strengthen param "insn" from
	const_rtx to const rtx_insn *.
	(df_chain_insn_bottom_dump): Likewise.
	(df_word_lr_simulate_defs): Strengthen param "insn" from rtx to
	rtx_insn *.
	(df_word_lr_simulate_uses): Likewise.
	(df_print_note): Likewise.
	(df_remove_dead_and_unused_notes): Likewise.
	(df_set_unused_notes_for_mw): Likewise.
	(df_set_dead_notes_for_mw): Likewise.
	(df_create_unused_note): Likewise.
	(df_simulate_find_defs): Likewise.
	(df_simulate_find_uses): Likewise.
	(df_simulate_find_noclobber_defs): Likewise.
	(df_simulate_defs): Likewise.
	(df_simulate_uses): Likewise.
	(df_simulate_one_insn_backwards): Likewise.
	(df_simulate_one_insn_forwards): Likewise.
	(df_md_simulate_one_insn): Likewise.
	* df-scan.c (df_uses_create): Likewise.
	(df_insn_create_insn_record): Likewise.
	(df_insn_delete): Likewise.
	(df_insn_rescan): Likewise.
	(df_insn_rescan_debug_internal): Likewise.
	(df_insn_change_bb): Likewise.
	(df_notes_rescan): Likewise.
	(df_refs_add_to_chains): Likewise.
	(df_insn_refs_verify): Likewise.
	* emit-rtl.c (set_insn_deleted): Add checked cast to rtx_insn *
	when invoking df_insn_delete.
	(reorder_insns): Strengthen local "x" from rtx to rtx_insn *.
	(set_unique_reg_note): Add checked cast.
	* final.c (cleanup_subreg_operands): Likewise.
	* gcse.c (update_ld_motion_stores): Likewise, strengthening local
	"insn" from rtx to rtx_insn *.
	* haifa-sched.c (reemit_notes): Strengthen param "insn" and local
	"last" from rtx to rtx_insn *.
	* ira-emit.c (change_regs_in_insn): New function.
	(change_loop): Strengthen local "insn" from rtx to rtx_insn *.
	Invoke change_regs_in_insn rather than change_regs.
	* ira.c (update_equiv_regs): Strengthen locals "insn",
	"init_insn", "new_insn" from rtx to rtx_insn *.  Invoke
	for_each_rtx_in_insn rather than for_each_rtx.
	* recog.c (confirm_change_group): Add checked casts.
	(peep2_update_life): Strengthen local "x" from rtx to rtx_insn *.
	Add checked cast.
	(peep2_fill_buffer): Add checked cast.
	* rtlanal.c (remove_note): Likewise.
	* valtrack.c (propagate_for_debug): Strengthen param "insn" and
	locals "next" "end" from rtx to rtx_insn *.

/
2014-08-26  David Malcolm  <dmalcolm@redhat.com>

	* rtx-classes-status.txt (TODO): DF_REF_INSN is done.

From-SVN: r214548
2014-08-26 20:39:42 +00:00
David Malcolm 5d34b05026 duplicate_insn_chain accepts rtx_insn
gcc/
2014-08-26  David Malcolm  <dmalcolm@redhat.com>

	* rtl.h (duplicate_insn_chain): Strengthen both params from rtx to
	rtx_insn *.
	* cfgrtl.c (duplicate_insn_chain): Likewise for  params "from",
	"to" and locals "insn", "next", "copy".  Remove now-redundant
	checked cast.

From-SVN: r214544
2014-08-26 19:51:02 +00:00
David Malcolm 61aa0978e2 Various condition-handling calls
gcc/
2014-08-26  David Malcolm  <dmalcolm@redhat.com>

	* rtl.h (canonicalize_condition): Strengthen param 1 from rtx to
	rtx_insn * and param 4 from rtx * to rtx_insn **.
	(get_condition): Strengthen param 1 from rtx to rtx_insn * and
	param 2 from rtx * to rtx_insn **.

	* df.h (can_move_insns_across): Strengthen params 1-4 from rtx to
	rtx_insn * and final param from rtx * to rtx_insn **.

	* cfgcleanup.c (try_head_merge_bb): Strengthen local "move_before"
	from rtx to rtx_insn *.
	(try_head_merge_bb): Likewise for both locals named "move_upto".
	* df-problems.c (can_move_insns_across): Likewise for params
	"from", "to", "across_from", "across_to" and locals "insn",
	"next", "max_to".  Strengthen param "pmove_upto" from rtx * to
	rtx_insn **.
	* ifcvt.c (struct noce_if_info): Strengthen field "cond_earliest"
	from rtx to rtx_insn *.
	(noce_get_alt_condition): Strengthen param "earliest" from rtx *
	to rtx_insn **.  Strengthen local "insn" from rtx to rtx_insn *.
	(noce_try_minmax): Strengthen locals "earliest", "seq" from rtx to
	rtx_insn *.
	(noce_try_abs): Likewise.
	(noce_get_condition): Likewise for param "jump".  Strengthen param
	"earliest" from rtx * to rtx_insn **.
	(noce_find_if_block): Strengthen local "cond_earliest" from rtx to
	rtx_insn *.
	(find_cond_trap): Likewise.
	(dead_or_predicable): Likewise for local "earliest".
	* loop-iv.c (check_simple_exit): Likewise for local "at".  Add
	checked cast.
	* rtlanal.c (canonicalize_condition): Likewise for param "insn"
	and local "prev".  Strengthen param "earliest" from rtx * to
	rtx_insn **.
	(get_condition): Strengthen param "jump" from rtx to rtx_insn *
	Strengthen param "earliest" from rtx * to rtx_insn **.

From-SVN: r214542
2014-08-26 19:38:42 +00:00
David Malcolm fee3e72cdf Strengthen various insn emission functions
gcc/
2014-08-26  David Malcolm  <dmalcolm@redhat.com>

	* rtl.h (push_to_sequence): Strengthen param from rtx to
	rtx_insn *.
	(push_to_sequence2): Likewise for both params.
	(delete_insns_since): Likewise for param.
	(reorder_insns_nobb): Likewise for all three params.
	(set_new_first_and_last_insn): Likewise for both params.

	* emit-rtl.h (set_first_insn): Strengthen param "insn" from rtx to
	rtx_insn *.  Remove now-redundant cast.
	(set_last_insn): Likewise.

	* builtins.c (expand_builtin_return): Strengthen local
	"call_fusage" from rtx to rtx_insn *.
	* cfgrtl.c (create_basic_block_structure): Likewise for local
	"after".
	* emit-rtl.c (set_new_first_and_last_insn): Likewise for params
	"first", "last" and local "insn".
	(delete_insns_since): Likewise for param "from".
	(reorder_insns_nobb): Likewise for params "from", "to", "after"
	and local "x".
	(push_to_sequence): Likewise for param "first" and local "last".
	(push_to_sequence2): Likewise for params "first" and "last".
	* lra.c (emit_add3_insn): Likewise for local "last".
	(lra_emit_add): Likewise.
	* lra-constraints.c (base_to_reg): Likewise for locals "insn",
	"last_insn".
	(process_address_1): Likewise for locals "insn", last".
	* modulo-sched.c (ps_first_note): Likewise for return type.
	* optabs.c (expand_binop_directly): Likewise for param "last".

From-SVN: r214539
2014-08-26 19:31:29 +00:00
David Malcolm db76cf1e63 get_last_insn_anywhere returns an rtx_insn
gcc/
2014-08-26  David Malcolm  <dmalcolm@redhat.com>

	* rtl.h (get_last_insn_anywhere): Strengthen return type from rtx
	to rtx_insn*.
	* emit-rtl.c (get_last_insn_anywhere): Likewise.

From-SVN: r214538
2014-08-26 19:25:31 +00:00
David Malcolm 9152e0aa1b Params of add_insn and unlink_insn_chain
gcc/
2014-08-26  David Malcolm  <dmalcolm@redhat.com>

	* rtl.h (add_insn): Strengthen param from rtx to rtx_insn *.
	(unlink_insn_chain): Strengthen both params from rtx to
	rtx_insn *.

	* cfgrtl.c (cfg_layout_function_header): Likewise for this
	variable.
	(unlink_insn_chain): Likewise for params "first" and "last".
	Remove now-redundant checked cast.
	(record_effective_endpoints): Replace use of NULL_RTX with NULL.
	(fixup_reorder_chain): Strengthen local "insn" from rtx to
	rtx_insn *.
	* emit-rtl.c (link_insn_into_chain): Likewise for all three
	params.
	(add_insn): Likewise for param "insn" and local "prev".
	(add_insn_after_nobb): Likewise for both params and local "next".
	(add_insn_before_nobb): Likewise for both params and local "prev".
	(add_insn_after): Rename param "after" to "uncast_after",
	introducing local "after" with another checked cast.
	(add_insn_before): Rename params "insn" and "before", giving them
	"uncast_" prefixes, adding the old names back using checked casts.
	(emit_note_after): Likewise for param "after".
	(emit_note_before): Likewise for param "before".
	(emit_label): Add a checked cast.

From-SVN: r214536
2014-08-26 19:12:49 +00:00
David Malcolm dd60a84ce0 cselib and incdec
gcc/
	* rtl.h (for_each_inc_dec): Strengthen param 1 from rtx * to
	rtx_insn **.
	(check_for_inc_dec): Strengthen param "insn" from rtx to
	rtx_insn *.

	* cselib.h (cselib_process_insn): Likewise.

	* cselib.c (cselib_record_sets): Likewise.
	(cselib_process_insn): Likewise.

	* dse.c (struct insn_info): Likewise for field "insn".
	(check_for_inc_dec_1): Likewise for local "insn".
	(check_for_inc_dec): Likewise for param "insn".
	(scan_insn): Likewise.
	(dse_step1): Likewise for local "insn".

	* rtlanal.c (for_each_inc_dec): Strengthen param 1 from rtx * to
	rtx_insn **.  Use for_each_rtx_in_insn rather than for_each_rtx.

From-SVN: r214531
2014-08-26 18:03:09 +00:00
David Malcolm 95c43227c5 Add rtx_jump_table_data::get_labels method
gcc/
	* rtl.h (rtx_jump_table_data::get_labels): New method.
	* cfgbuild.c (make_edges): Replace hand-coded lookup of labels
	with use of the new rtx_jump_table_data::get_labels method.
	(purge_dead_tablejump_edges): Strengthen param "table" from rtx
	to rtx_jump_table_data *.  Simplify by using get_labels method.
	* cfgrtl.c (delete_insn): Replace use of JUMP_TABLE_DATA_P with
	a dyn_cast, introducing local "table", using it to replace
	label-lookup logic with a get_labels method call.
	(patch_jump_insn): Simplify using get_labels method.
	* dwarf2cfi.c (create_trace_edges): Likewise.
	* rtlanal.c (label_is_jump_target_p): Likewise.

From-SVN: r214476
2014-08-25 20:45:08 +00:00
David Malcolm 6bb9bf637a unshare_all_rtl_again takes an rtx_insn *
gcc/
	* rtl.h (unshare_all_rtl_again): Strengthen param "insn" from rtx
	to rtx_insn *.

	* emit-rtl.c (unshare_all_rtl_1): Likewise.
	(unshare_all_rtl_again): Likewise, also for local "p".

From-SVN: r214475
2014-08-25 20:40:19 +00:00
David Malcolm 373fc786c2 delete_insn_and_edges takes an rtx_insn *
gcc/
	* rtl.h (delete_insn_and_edges): Strengthen param "insn" from rtx
	to rtx_insn *.
	* cfgrtl.c (delete_insn_and_edges): Likewise.

From-SVN: r214474
2014-08-25 20:36:57 +00:00
David Malcolm ac9d2d2c35 reorder_insns requires rtx_insn *
gcc/
	* rtl.h (reorder_insns): Strengthen params "from", "to", "after"
	from rtx to rtx_insn *.

	* emit-rtl.c (reorder_insns): Likewise, also for local "insn".

From-SVN: r214473
2014-08-25 20:31:34 +00:00
David Malcolm f695656902 reginfo.c: Use rtx_insn (also touches rtl.h)
gcc/
	* rtl.h (reg_scan): Strengthen param "f" from rtx to rtx_insn *.
	* reginfo.c (reg_scan): Likewise, also for local "insn".
	(reg_scan_mark_refs): Likewise for param "insn".
	(init_subregs_of_mode): Likewise for local "insn".

From-SVN: r214367
2014-08-22 20:19:07 +00:00
David Malcolm f719babc10 print-rtl.c: Use rtx_insn for various debug_ functions
gcc/
	* rtl.h (debug_rtx_list): Strengthen param 1 "x" from const_rtx to
	const rtx_insn *.
	(debug_rtx_range): Likewise for params 1 and 2 "start" and "end".
	(debug_rtx_find): Likewise for param 1 "x".

	* print-rtl.c (debug_rtx_list): Strengthen param 1 "x" from
	const_rtx to const rtx_insn *.  Likewise for local "insn".
	(debug_rtx_range): Likewise for params 1 and 2 "start" and "end".
	(debug_rtx_find): Likewise for param 1 "x".
	(print_rtl): Likewise for local "tmp_rtx", adding a checked cast
	from const_rtx to const rtx_insn * within the appropriate cases of
	the switch statement.

	* config/rs6000/rs6000.c (rs6000_debug_legitimize_address):
	Strengthen local "insns" from rtx to rtx_insn * since this is
	passed to a call to debug_rtx_list.

From-SVN: r214362
2014-08-22 20:06:25 +00:00
David Malcolm f90af2e020 postreload.c: Use rtx_insn (also touches rtl.h and cprop.c)
gcc/
	* rtl.h (fis_get_condition): Strengthen param "jump" from rtx to
	rtx_insn *.

	* cprop.c (fis_get_condition): Likewise.

	* postreload.c (reload_cse_regs): Likewise for param "first".
	(reload_cse_simplify): Likewise for param "insn".
	(reload_cse_regs_1): Likewise for local "insn".
	(reload_cse_simplify_set): Likewise for param "insn".
	(reload_cse_simplify_operands): Likewise.
	(struct reg_use): Likewise for field "insn".
	(reload_combine_purge_insn_uses): Likewise for param "insn".
	(fixup_debug_insns): Likewise for params "from", "to" and local
	"insn".
	(try_replace_in_use): Likewise for local "use_insn".
	(reload_combine_recognize_const_pattern): Likewise for param
	"insn" and locals "add_moved_after_insn", "use_insn".
	(reload_combine_recognize_pattern): Likewise for param "insn" and
	local "prev".
	(reload_combine): Likewise for locals "insn", "prev".
	(reload_combine_note_use): Likewise for param "insn".
	(move2add_use_add2_insn): Likewise.
	(move2add_use_add3_insn): Likewise.
	(reload_cse_move2add): Likewise, also for local "next".
	(move2add_note_store): Likewise for local "insn".

From-SVN: r214358
2014-08-22 19:38:50 +00:00
David Malcolm b47f38a520 jump.c: Use rtx_insn in a few places (also touches rtl.h and cfgexpand.c)
gcc/
	* rtl.h (rebuild_jump_labels): Strengthen param "f" from rtx to
	rtx_insn *.
	(rebuild_jump_labels_chain): Likewise for param "chain".

	* cfgexpand.c (pass_expand::execute): Add checked cast to
	rtx_insn * when calling rebuild_jump_labels_chain in region where
	we know e->insns.r is non-NULL.

	* jump.c (rebuild_jump_labels_1): Strengthen param "f" from rtx to
	rtx_insn *.
	(rebuild_jump_labels): Likewise.
	(rebuild_jump_labels_chain): Likewise for param "chain".
	(cleanup_barriers): Likewise for locals "insn", "next", "prev".
	(init_label_info): Likewise for param "f".
	(maybe_propagate_label_ref): Likewise for params "jump_insn",
	"prev_nonjump_insn".
	(mark_all_labels): Likewise for param "f" and locals "insn",
	"prev_nonjump_insn".

From-SVN: r214341
2014-08-22 18:03:59 +00:00
David Malcolm bba2490b5f delete_related_insns returns an rtx_insn
2014-08-21  David Malcolm  <dmalcolm@redhat.com>

	* rtl.h (delete_related_insns): Strengthen return type from rtx to
	rtx_insn *.

	* jump.c (delete_related_insns): Likewise, also for locals "next"
	and "prev".

From-SVN: r214275
2014-08-21 15:00:09 +00:00
David Malcolm 579f75aefa peephole returns an rtx_insn
2014-08-21  David Malcolm  <dmalcolm@redhat.com>

	* output.h (peephole): Strengthen return type from rtx to
	rtx_insn *.
	* rtl.h (delete_for_peephole): Likewise for both params.
	* genpeep.c (main): In generated "peephole" function, strengthen
	return type and local "insn" from rtx to rtx_insn *.  For now,
	rename param "ins1" to "uncast_ins1", adding "ins1" back as an
	rtx_insn *, with a checked cast.
	* jump.c (delete_for_peephole): Strengthen params "from", "to" and
	locals "insn", "next", "prev" from rtx to rtx_insn *.

From-SVN: r214264
2014-08-21 09:40:09 +00:00
David Malcolm 53f0468805 try_split returns an rtx_insn
2014-08-21  David Malcolm  <dmalcolm@redhat.com>

	* rtl.h (try_split): Strengthen return type from rtx to rtx_insn *.

	* emit-rtl.c (try_split): Likewise, also for locals "before" and
	"after".  For now, don't strengthen param "trial", which requires
	adding checked casts when returning it.

From-SVN: r214260
2014-08-21 08:53:25 +00:00
David Malcolm 62fc98cc67 find_first_parameter_load returns an rtx_insn
2014-08-21  David Malcolm  <dmalcolm@redhat.com>

	* rtl.h (find_first_parameter_load): Strengthen return type from
	rtx to rtx_insn *.
	* rtlanal.c (find_first_parameter_load): Strengthen return type
	from rtx to rtx_insn *.  Add checked cast for now, to postpone
	strengthening the params.

From-SVN: r214252
2014-08-21 00:59:41 +00:00
David Malcolm a90c614ae3 Return types of unlink_insn_chain and duplicate_insn_chain
2014-08-19  David Malcolm  <dmalcolm@redhat.com>

	* rtl.h (unlink_insn_chain): Strengthen return type from rtx to
	rtx_insn *.
	(duplicate_insn_chain): Likewise.
	* cfgrtl.c (unlink_insn_chain): Strengthen return type from rtx to
	rtx_insn *, also for locals "prevfirst" and "nextlast".  Add a
	checked cast for now (until we can strengthen the params in the
	same way).
	(duplicate_insn_chain): Likewise.

From-SVN: r214197
2014-08-19 21:22:25 +00:00
David Malcolm 75b46023e7 next_cc0_user and prev_cc0_setter scaffolding
2014-08-19  David Malcolm  <dmalcolm@redhat.com>

	* rtl.h (next_cc0_user): Strengthen return type from rtx to
	rtx_insn *.
	(prev_cc0_setter): Likewise.

	* emit-rtl.c (next_cc0_user): Strengthen return type from rtx to
	rtx_insn *, adding checked casts for now as necessary.
	(prev_cc0_setter): Likewise.

From-SVN: r214196
2014-08-19 21:08:18 +00:00
David Malcolm cd459bf87c emit_* functions return rtx_insn
2014-08-19  David Malcolm  <dmalcolm@redhat.com>

	* emit-rtl.h (emit_copy_of_insn_after): Strengthen return type
	from rtx to rtx_insn *.

	* rtl.h (emit_insn_before): Likewise.
	(emit_insn_before_noloc): Likewise.
	(emit_insn_before_setloc): Likewise.
	(emit_jump_insn_before): Likewise.
	(emit_jump_insn_before_noloc): Likewise.
	(emit_jump_insn_before_setloc): Likewise.
	(emit_call_insn_before): Likewise.
	(emit_call_insn_before_noloc): Likewise.
	(emit_call_insn_before_setloc): Likewise.
	(emit_debug_insn_before): Likewise.
	(emit_debug_insn_before_noloc): Likewise.
	(emit_debug_insn_before_setloc): Likewise.
	(emit_label_before): Likewise.
	(emit_insn_after): Likewise.
	(emit_insn_after_noloc): Likewise.
	(emit_insn_after_setloc): Likewise.
	(emit_jump_insn_after): Likewise.
	(emit_jump_insn_after_noloc): Likewise.
	(emit_jump_insn_after_setloc): Likewise.
	(emit_call_insn_after): Likewise.
	(emit_call_insn_after_noloc): Likewise.
	(emit_call_insn_after_setloc): Likewise.
	(emit_debug_insn_after): Likewise.
	(emit_debug_insn_after_noloc): Likewise.
	(emit_debug_insn_after_setloc): Likewise.
	(emit_label_after): Likewise.
	(emit_insn): Likewise.
	(emit_debug_insn): Likewise.
	(emit_jump_insn): Likewise.
	(emit_call_insn): Likewise.
	(emit_label): Likewise.
	(gen_clobber): Likewise.
	(emit_clobber): Likewise.
	(gen_use): Likewise.
	(emit_use): Likewise.
	(emit): Likewise.

	(emit_barrier_before): Strengthen return type from rtx to
	rtx_barrier *.
	(emit_barrier_after): Likewise.
	(emit_barrier): Likewise.

	* emit-rtl.c (emit_pattern_before_noloc):  Strengthen return type
	from rtx to rtx_insn *.  Add checked casts for now when converting
	"last" from rtx to rtx_insn *.
	(emit_insn_before_noloc): Likewise for return type.
	(emit_jump_insn_before_noloc): Likewise.
	(emit_call_insn_before_noloc): Likewise.
	(emit_debug_insn_before_noloc): Likewise.
	(emit_barrier_before): Strengthen return type and local "insn"
	from rtx to rtx_barrier *.
	(emit_label_before): Strengthen return type from rtx to
	rtx_insn *.  Add checked cast for now when returning param
	(emit_pattern_after_noloc): Strengthen return type from rtx to
	rtx_insn *.  Add checked casts for now when converting "last" from
	rtx to rtx_insn *.
	(emit_insn_after_noloc): Strengthen return type from rtx to
	rtx_insn *.
	(emit_jump_insn_after_noloc): Likewise.
	(emit_call_insn_after_noloc): Likewise.
	(emit_debug_insn_after_noloc): Likewise.
	(emit_barrier_after): Strengthen return type from rtx to
	rtx_barrier *.
	(emit_label_after): Strengthen return type from rtx to rtx_insn *.
	Add checked cast for now when converting "label" from rtx to
	rtx_insn *.
	(emit_pattern_after_setloc): Strengthen return type from rtx to
	rtx_insn *.  Add checked casts for now when converting "last" from
	rtx to rtx_insn *.
	(emit_pattern_after): Strengthen return type from rtx to
	rtx_insn *.
	(emit_insn_after_setloc): Likewise.
	(emit_insn_after): Likewise.
	(emit_jump_insn_after_setloc): Likewise.
	(emit_jump_insn_after): Likewise.
	(emit_call_insn_after_setloc): Likewise.
	(emit_call_insn_after): Likewise.
	(emit_debug_insn_after_setloc): Likewise.
	(emit_debug_insn_after): Likewise.
	(emit_pattern_before_setloc): Likewise.  Add checked casts for now
	when converting "last" from rtx to rtx_insn *.
	(emit_pattern_before): Strengthen return type from rtx to
	rtx_insn *.
	(emit_insn_before_setloc): Likewise.
	(emit_insn_before): Likewise.
	(emit_jump_insn_before_setloc): Likewise.
	(emit_jump_insn_before): Likewise.
	(emit_call_insn_before_setloc): Likewise.
	(emit_call_insn_before): Likewise.
	(emit_debug_insn_before_setloc): Likewise.
	(emit_debug_insn_before): Likewise.
	(emit_insn): Strengthen return type and locals "last", "insn",
	"next" from rtx to rtx_insn *.  Add checked cast to rtx_insn
	within cases where we know we have an insn.
	(emit_debug_insn): Likewise.
	(emit_jump_insn): Likewise.
	(emit_call_insn): Strengthen return type and local "insn" from rtx
	to rtx_insn *.
	(emit_label): Strengthen return type from rtx to rtx_insn *.  Add
	a checked cast to rtx_insn * for now on "label".
	(emit_barrier): Strengthen return type from rtx to rtx_barrier *.
	(emit_clobber): Strengthen return type from rtx to rtx_insn *.
	(emit_use): Likewise.
	(gen_use): Likewise, also for local "seq".
	(emit): Likewise for return type and local "insn".
	(rtx_insn): Likewise for return type and local "new_rtx".

	* cfgrtl.c (emit_barrier_after_bb): Strengthen local "barrier"
	from rtx to rtx_barrier *.

	* config/sh/sh.c (output_stack_adjust): Since emit_insn has
	changed return type from rtx to rtx_insn *, we must update
	"emit_fn" type, and this in turn means updating...
	(frame_insn): ...this.  Strengthen return type from rtx to
	rtx_insn *.  Introduce a new local "insn" of the appropriate type.

From-SVN: r214194
2014-08-19 20:36:20 +00:00
David Malcolm 4598afdd15 emit_jump_table_data returns an rtx_jump_table_data *
2014-08-19  David Malcolm  <dmalcolm@redhat.com>

	* emit-rtl.c (emit_jump_table_data): Strengthen return type from
	rtx to rtx_jump_table_data *.  Also for local.
	* rtl.h (emit_jump_table_data): Likewise.

From-SVN: r214193
2014-08-19 20:22:09 +00:00
David Malcolm 66e8df5354 Convert various rtx to rtx_note *
2014-08-19  David Malcolm  <dmalcolm@redhat.com>

	* basic-block.h (create_basic_block_structure): Strengthen third
	param "bb_note" from rtx to rtx_note *.
	* rtl.h (emit_note_before): Strengthen return type from rtx to
	rtx_note *.
	(emit_note_after): Likewise.
	(emit_note): Likewise.
	(emit_note_copy): Likewise.  Also, strengthen param similarly.
	* function.h (struct rtl_data): Strengthen field
	"x_stack_check_probe_note" from rtx to rtx_note *.

	* cfgexpand.c (expand_gimple_basic_block): Strengthen local "note"
	from rtx to rtx_note *.
	* cfgrtl.c (create_basic_block_structure): Strengthen third param
	"bb_note" from rtx to rtx_note *.
	(duplicate_insn_chain): Likewise for local "last".  Add a checked cast
	when calling emit_note_copy.
	* emit-rtl.c (make_note_raw): Strengthen return type from rtx to
	rtx_note *.
	(emit_note_after): Likewise.
	(emit_note_before): Likewise.
	(emit_note_copy): Likewise.  Also, strengthen param similarly.
	(emit_note): Likewise.
	* except.c (emit_note_eh_region_end): Likewise for return type.
	Strengthen local "next" from rtx to rtx_insn *.
	(convert_to_eh_region_ranges): Strengthen local "note"
	from rtx to rtx_note *.
	* final.c (change_scope): Likewise.
	(reemit_insn_block_notes): Likewise, for both locals named "note".
	Also, strengthen local "insn" from rtx to rtx_insn *.
	* haifa-sched.c (sched_extend_bb): Strengthen local "note" from
	rtx to rtx_note *.
	* reg-stack.c (compensate_edge): Likewise for local "after". Also,
	strengthen local "seq" from rtx to rtx_insn *.
	* reload1.c (reload_as_needed): Strengthen local "marker" from rtx
	to rtx_note *.
	* sel-sched-ir.c (bb_note_pool): Strengthen from rtx_vec_t to
	vec<rtx_note *>.
	(get_bb_note_from_pool): Strengthen return type from rtx to
	rtx_note *.
	(sel_create_basic_block): Strengthen local "new_bb_note" from
	insn_t to rtx_note *.
	* var-tracking.c (emit_note_insn_var_location): Strengthen local
	"note" from rtx to rtx_note *.
	(emit_notes_in_bb): Likewise.

From-SVN: r214192
2014-08-19 20:08:20 +00:00
David Malcolm 167b9fae86 make_insn_raw returns an rtx_insn
2014-08-19  David Malcolm  <dmalcolm@redhat.com>

	* rtl.h (make_insn_raw): Strengthen return type from rtx to
	rtx_insn *.

	* emit-rtl.c (make_insn_raw): Strengthen return type and local
	"insn" from rtx to rtx_insn *.
	(make_debug_insn_raw): Strengthen return type from rtx to
	rtx_insn *; strengthen local "insn" from rtx to rtx_debug_insn *.
	(make_jump_insn_raw):  Strengthen return type from rtx to
	rtx_insn *; strengthen local "insn" from rtx to rtx_jump_insn *.
	(make_call_insn_raw):  Strengthen return type from rtx to
	rtx_insn *; strengthen local "insn" from rtx to rtx_call_insn *.
	(emit_pattern_before_noloc): Strengthen return type of "make_raw"
	callback from rtx to rtx_insn *; likewise for local "insn" and
	"next", adding a checked cast to rtx_insn in the relevant cases of
	the switch statement.
	(emit_pattern_after_noloc): Strengthen return type of "make_raw"
	callback from rtx to rtx_insn *.
	(emit_pattern_after_setloc): Likewise.
	(emit_pattern_after): Likewise.
	(emit_pattern_before_setloc): Likewise.
	(emit_pattern_before): Likewise.

From-SVN: r214187
2014-08-19 19:38:12 +00:00
David Malcolm 049cfc4a1d last_call_insn returns an rtx_call_insn *
2014-08-19  David Malcolm  <dmalcolm@redhat.com>

	* emit-rtl.c (last_call_insn): Strengthen return type from rtx to
	rtx_call_insn *.
	* rtl.h (is_a_helper <rtx_call_insn *>::test): New overload,
	accepting an rtx_insn *.
	(last_call_insn): Strengthen return type from rtx to
	rtx_call_insn *.

From-SVN: r214186
2014-08-19 19:33:21 +00:00
David Malcolm 169d13f576 delete_trivially_dead_insns works on insns
2014-08-19  David Malcolm  <dmalcolm@redhat.com>

	* rtl.h (delete_trivially_dead_insns): Strengthen initial param
	"insns" from rtx to rtx_insn *.
	* cse.c (delete_trivially_dead_insns): Likewise, also do it for
	locals "insn" and "prev".

From-SVN: r214185
2014-08-19 19:27:29 +00:00
David Malcolm 8942ee0fbf Make tablejump_p accept a rtx_jump_table_data **
2014-08-19  David Malcolm  <dmalcolm@redhat.com>

	* rtl.h (tablejump_p): Strengthen third param from rtx * to
	rtx_jump_table_data **.

	* cfgbuild.c (make_edges): Introduce local "table", using it in
	place of "tmp" for jump table data.
	(find_bb_boundaries): Strengthen local "table" from rtx to
	rtx_jump_table_data *.
	* cfgcleanup.c (merge_blocks_move_successor_nojumps): Likewise.
	(outgoing_edges_match): Likewise for locals "table1" and "table2".
	(try_crossjump_to_edge): Likewise.
	* cfgrtl.c (try_redirect_by_replacing_jump): Likewise for local
	"table".
	(patch_jump_insn): Introduce local "table", using it in place of
	"tmp" for jump table data.
	(force_nonfallthru_and_redirect): Introduce local "table", so that
	call to tablejump_p can receive an rtx_jump_table_data **.  Update
	logic around the call to overwrite "note" appropriately if
	tablejump_p returns non-zero.
	(get_last_bb_insn): Introduce local "table", using it in place of
	"tmp" for jump table data.
	* dwarf2cfi.c (create_trace_edges): Likewise.

	* config/arm/arm.c (get_jump_table_size): Strengthen param "insn"
	from rtx to rtx_jump_table_data *.
	(create_fix_barrier): Strengthen local "tmp" from rtx to
	rtx_jump_table_data *.
	(arm_reorg): Likewise for local "table".

	* config/s390/s390.c (s390_chunkify_start): Likewise.

	* config/spu/spu.c (spu_emit_branch_hint): Likewise.

	* jump.c (delete_related_insns): Strengthen local "lab_next" from
	rtx to rtx_jump_table_data *.

	* rtlanal.c (tablejump_p): Strengthen param "tablep" from rtx * to
	rtx_jump_table_data **.  Add a checked cast when writing through
	the pointer: we know there that local "table" is non-NULL and that
	JUMP_TABLE_DATA_P (table) holds.
	(label_is_jump_target_p): Introduce local "table", using it in
	place of "tmp" for jump table data.

From-SVN: r214184
2014-08-19 19:19:13 +00:00
David Malcolm 8a2e8325e4 entry_of_function returns an insn
2014-08-19  David Malcolm  <dmalcolm@redhat.com>

	* rtl.h (entry_of_function): Strengthen return type from rtx to
	rtx_insn *.
	* cfgrtl.c (entry_of_function): Likewise.

From-SVN: r214182
2014-08-19 18:44:41 +00:00
David Malcolm 7dcc3ab587 Strengthen return type of gen_label_rtx
2014-08-19  David Malcolm  <dmalcolm@redhat.com>

	* rtl.h (gen_label_rtx): Strengthen return type from rtx to
	rtx_code_label *.

	* emit-rtl.c (gen_label_rtx): Likewise.

From-SVN: r214179
2014-08-19 18:12:51 +00:00
David Malcolm eb51c837dd Strengthen return types of various {next|prev}_*insn from rtx to rtx_insn *
2014-08-19  David Malcolm  <dmalcolm@redhat.com>

	* rtl.h (previous_insn): Strengthen return type from rtx to
	rtx_insn *.
	(next_insn): Likewise.
	(prev_nonnote_insn): Likewise.
	(prev_nonnote_insn_bb): Likewise.
	(next_nonnote_insn): Likewise.
	(next_nonnote_insn_bb): Likewise.
	(prev_nondebug_insn): Likewise.
	(next_nondebug_insn): Likewise.
	(prev_nonnote_nondebug_insn): Likewise.
	(next_nonnote_nondebug_insn): Likewise.
	(prev_real_insn): Likewise.
	(next_real_insn): Likewise.
	(prev_active_insn): Likewise.
	(next_active_insn): Likewise.

	* emit-rtl.c (next_insn): Strengthen return type from rtx to
	rtx_insn *, adding a checked cast.
	(previous_insn): Likewise.
	(next_nonnote_insn): Likewise.
	(next_nonnote_insn_bb): Likewise.
	(prev_nonnote_insn): Likewise.
	(prev_nonnote_insn_bb): Likewise.
	(next_nondebug_insn): Likewise.
	(prev_nondebug_insn): Likewise.
	(next_nonnote_nondebug_insn): Likewise.
	(prev_nonnote_nondebug_insn): Likewise.
	(next_real_insn): Likewise.
	(prev_real_insn): Likewise.
	(next_active_insn): Likewise.
	(prev_active_insn): Likewise.

	* config/sh/sh-protos.h (sh_find_set_of_reg): Convert function ptr
	param "stepfunc" so that it returns an rtx_insn * rather than an
	rtx, to track the change to prev_nonnote_insn_bb, which is the
	only function this is called with.
	* config/sh/sh.c (sh_find_set_of_reg): Likewise.

From-SVN: r214178
2014-08-19 17:39:08 +00:00
David Malcolm 6f983e6098 Add subclasses for the various kinds of instruction
2014-08-19  David Malcolm  <dmalcolm@redhat.com>

	* coretypes.h (class rtx_debug_insn): Add forward declaration.
	(class rtx_nonjump_insn): Likewise.
	(class rtx_jump_insn): Likewise.
	(class rtx_call_insn): Likewise.
	(class rtx_jump_table_data): Likewise.
	(class rtx_barrier): Likewise.
	(class rtx_code_label): Likewise.
	(class rtx_note): Likewise.

	* rtl.h (class rtx_debug_insn): New, a subclass of rtx_insn,
	adding the invariant DEBUG_INSN_P (X).
	(class rtx_nonjump_insn): New, a subclass of rtx_insn, adding
	the invariant NONJUMP_INSN_P (X).
	(class rtx_jump_insn): New, a subclass of rtx_insn, adding
	the invariant JUMP_P (X).
	(class rtx_call_insn): New, a subclass of rtx_insn, adding
	the invariant CALL_P (X).
	(class rtx_jump_table): New, a subclass of rtx_insn, adding the
	invariant JUMP_TABLE_DATA_P (X).
	(class rtx_barrier): New, a subclass of rtx_insn, adding the
	invariant BARRIER_P (X).
	(class rtx_code_label): New, a subclass of rtx_insn, adding
	the invariant LABEL_P (X).
	(class rtx_note): New, a subclass of rtx_insn, adding
	the invariant NOTE_P(X).
	(is_a_helper <rtx_debug_insn *>::test): New.
	(is_a_helper <rtx_nonjump_insn *>::test): New.
	(is_a_helper <rtx_jump_insn *>::test): New.
	(is_a_helper <rtx_call_insn *>::test): New.
	(is_a_helper <rtx_jump_table_data *>::test): New functions,
	overloaded for both rtx and rtx_insn *.
	(is_a_helper <rtx_barrier *>::test): New.
	(is_a_helper <rtx_code_label *>::test): New functions, overloaded
	for both rtx and rtx_insn *.
	(is_a_helper <rtx_note *>::test): New.

From-SVN: r214172
2014-08-19 16:57:10 +00:00
David Malcolm 6306c300db Replace PREV_INSN et al macros with functions
gcc/
2014-08-19  David Malcolm  <dmalcolm@redhat.com>

	* rtl.h (PREV_INSN): Convert to an inline function.  Strengthen
	the return type from rtx to rtx_insn *,  which will enable various
	conversions in followup patches.  For now this is is done by a
	checked cast.
	(NEXT_INSN): Likewise.
	(SET_PREV_INSN): Convert to an inline function.  This is intended
	for use as an lvalue, and so returns an rtx& to allow in-place
	modification.
	(SET_NEXT_INSN): Likewise.

From-SVN: r214152
2014-08-19 14:47:55 +00:00
David Malcolm 0f82e5c9fb Split NEXT_INSN/PREV_INSN into lvalue and rvalue forms
/
2014-08-19  David Malcolm  <dmalcolm@redhat.com>

	* rtx-classes-status.txt: Add SET_NEXT_INSN, SET_PREV_INSN.

gcc/
2014-08-19  David Malcolm  <dmalcolm@redhat.com>

	* rtl.h (PREV_INSN): Split macro in two: the existing one,
	for rvalues, and...
	(SET_PREV_INSN): New macro, for use as an lvalue.
	(NEXT_INSN, SET_NEXT_INSN): Likewise.

	* caller-save.c (save_call_clobbered_regs): Convert lvalue use of
	PREV_INSN/NEXT_INSN into SET_PREV_INSN/SET_NEXT_INSN.
	* cfgrtl.c (try_redirect_by_replacing_jump): Likewise.
	(fixup_abnormal_edges): Likewise.
	(unlink_insn_chain): Likewise.
	(fixup_reorder_chain): Likewise.
	(cfg_layout_delete_block): Likewise.
	(cfg_layout_merge_blocks): Likewise.
	* combine.c (update_cfg_for_uncondjump): Likewise.
	* emit-rtl.c (link_insn_into_chain): Likewise.
	(remove_insn): Likewise.
	(delete_insns_since): Likewise.
	(reorder_insns_nobb): Likewise.
	(emit_insn_after_1): Likewise.
	* final.c (rest_of_clean_state): Likewise.
	(final_scan_insn): Likewise.
	* gcse.c (can_assign_to_reg_without_clobbers_p): Likewise.
	* haifa-sched.c (concat_note_lists): Likewise.
	(remove_notes): Likewise.
	(restore_other_notes): Likewise.
	(move_insn): Likewise.
	(unlink_bb_notes): Likewise.
	(restore_bb_notes): Likewise.
	* jump.c (delete_for_peephole): Likewise.
	* optabs.c (emit_libcall_block_1): Likewise.
	* reorg.c (emit_delay_sequence): Likewise.
	(fill_simple_delay_slots): Likewise.
	* sel-sched-ir.c (sel_move_insn): Likewise.
	(sel_remove_insn): Likewise.
	(get_bb_note_from_pool): Likewise.
	* sel-sched.c (move_nop_to_previous_block): Likewise.

	* config/bfin/bfin.c (reorder_var_tracking_notes): Likewise.
	* config/c6x/c6x.c (gen_one_bundle): Likewise.
	(c6x_gen_bundles): Likewise.
	(hwloop_optimize): Likewise.
	* config/frv/frv.c (frv_function_prologue): Likewise.
	(frv_register_nop): Likewise.
	* config/ia64/ia64.c (ia64_init_dfa_pre_cycle_insn): Likewise.
	(ia64_reorg): Likewise.
	* config/mep/mep.c (mep_reorg_addcombine): Likewise.
	(mep_make_bundle): Likewise.
	(mep_bundle_insns): Likewise.
	* config/picochip/picochip.c (reorder_var_tracking_notes): Likewise.
	* config/tilegx/tilegx.c (reorder_var_tracking_notes): Likewise.
	* config/tilepro/tilepro.c (reorder_var_tracking_notes): Likewise.

From-SVN: r214128
2014-08-19 00:54:22 +00:00
David Malcolm 70e7f57d38 New function: for_each_rtx_in_insn
gcc/
2014-08-18  David Malcolm  <dmalcolm@redhat.com>

	* rtl.h (for_each_rtx_in_insn): New function.
	* rtlanal.c (for_each_rtx_in_insn): Likewise.

From-SVN: r214119
2014-08-18 20:25:45 +00:00
David Malcolm 15f8d3ab4a Introduce rtx_insn subclass of rtx_def
gcc/
2014-08-18  David Malcolm  <dmalcolm@redhat.com>

	* coretypes.h (class rtx_insn): Add forward declaration.

	* rtl.h: Include is-a.h.
	(struct rtx_def): Add dummy "desc" and "tag" GTY options as a
	workaround to ensure gengtype knows inheritance is occurring,
	whilst continuing to use the pre-existing special-casing for
	rtx_def.
	(class rtx_insn): New subclass of rtx_def, adding the
	invariant that we're dealing with something we can sanely use
	INSN_UID, NEXT_INSN, PREV_INSN on.
	(is_a_helper <rtx_insn *>::test): New.
	(is_a_helper <const rtx_insn *>::test): New.

From-SVN: r214118
2014-08-18 20:02:17 +00:00
Kugan Vivekanandarajah 362d42dcc9 calls.c (precompute_arguments): Use new SUBREG_PROMOTED_SET instead of SUBREG_PROMOTED_UNSIGNED_SET.
gcc/
2014-08-08  Kugan Vivekanandarajah  <kuganv@linaro.org>

	* calls.c (precompute_arguments): Use new SUBREG_PROMOTED_SET
	instead of SUBREG_PROMOTED_UNSIGNED_SET.
	(expand_call): Likewise.
	* cfgexpand.c (expand_gimple_stmt_1): Use SUBREG_PROMOTED_SIGN
	to get promoted mode.
	* combine.c (record_promoted_value): Skip > 0 comparison with
	SUBREG_PROMOTED_UNSIGNED_P as it now returns only 0 or 1.
	* expr.c (convert_move): Use SUBREG_CHECK_PROMOTED_SIGN instead
	of SUBREG_PROMOTED_UNSIGNED_P.
	(convert_modes): Likewise.
	(store_expr): Use SUBREG_PROMOTED_SIGN to get promoted mode.
	Use SUBREG_CHECK_PROMOTED_SIGN instead of SUBREG_PROMOTED_UNSIGNED_P.
	(expand_expr_real_1): Use new SUBREG_PROMOTED_SET instead of
	SUBREG_PROMOTED_UNSIGNED_SET.
	* function.c (assign_parm_setup_reg): Use new SUBREG_PROMOTED_SET
	instead of SUBREG_PROMOTED_UNSIGNED_SET.
	* ifcvt.c (noce_emit_cmove): Updated to use SUBREG_PROMOTED_GET and
	SUBREG_PROMOTED_SET.
	* internal-fn.c (ubsan_expand_si_overflow_mul_check): Use
	SUBREG_PROMOTED_SET instead of SUBREG_PROMOTED_UNSIGNED_SET.
	* optabs.c (widen_operand): Use SUBREG_CHECK_PROMOTED_SIGN instead
	of SUBREG_PROMOTED_UNSIGNED_P.
	* rtl.h (SUBREG_PROMOTED_UNSIGNED_SET): Remove.
	(SUBREG_PROMOTED_SET): New define.
	(SUBREG_PROMOTED_GET): Likewise.
	(SUBREG_PROMOTED_SIGN): Likewise.
	(SUBREG_PROMOTED_SIGNED_P): Likewise.
	(SUBREG_CHECK_PROMOTED_SIGN): Likewise.
	(SUBREG_PROMOTED_UNSIGNED_P): Updated.
	* rtlanal.c (unsigned_reg_p): Use new SUBREG_PROMOTED_GET
	instead of SUBREG_PROMOTED_UNSIGNED_GET.
	(nonzero_bits1): Skip > 0 comparison with the results as
	SUBREG_PROMOTED_UNSIGNED_P now returns only 0 or 1.
	(num_sign_bit_copies1): Use SUBREG_PROMOTED_SIGNED_P instead
	of !SUBREG_PROMOTED_UNSIGNED_P.
	* simplify-rtx.c (simplify_unary_operation_1): Use new
	SUBREG_PROMOTED_SIGNED_P instead of !SUBREG_PROMOTED_UNSIGNED_P.
	(simplify_subreg): Use new SUBREG_PROMOTED_SIGNED_P,
	SUBREG_PROMOTED_UNSIGNED_P and SUBREG_PROMOTED_SET instead of
	SUBREG_PROMOTED_UNSIGNED_P and SUBREG_PROMOTED_UNSIGNED_SET.

From-SVN: r213749
2014-08-08 05:24:12 +00:00
Andi Kleen f768061c4c RTL & dwarf2out changes
Convert dwarf2out and rtl.c to the new inchash interface.

gcc/:

2014-07-31  Andi Kleen  <ak@linux.intel.com>

	* Makefile.in (OBJS): Add rtlhash.o
	* dwarf2out.c (addr_table_entry_do_hash): Convert to inchash.
	(loc_checksum): Dito.
	(loc_checksum_ordered): Dito.
	(hash_loc_operands): Dito.
	(hash_locs): Dito.
	(hash_loc_list): Dito.
	* rtl.c (iterative_hash_rtx): Moved to rtlhash.c
	* rtl.h (iterative_hash_rtx): Moved to rtlhash.h
	* rtlhash.c: New file.
	* rtlhash.h: New file.

From-SVN: r213395
2014-08-01 02:51:57 +00:00
Richard Sandiford 093a6c996e rtl.h (tls_referenced_p): Declare.
gcc/
	* rtl.h (tls_referenced_p): Declare.
	* rtlanal.c (tls_referenced_p_1, tls_referenced_p): New functions.
	* config/mips/mips.c (mips_tls_symbol_ref_1): Delete.
	(mips_cannot_force_const_mem): Use tls_referenced_p.
	* config/pa/pa-protos.h (pa_tls_referenced_p): Delete.
	* config/pa/pa.h (CONSTANT_ADDRESS_P): Use tls_referenced_p
	instead of pa_tls_referenced_p.
	* config/pa/pa.c (hppa_legitimize_address, pa_cannot_force_const_mem)
	(pa_emit_move_sequence, pa_emit_move_sequence): Likewise.
	(pa_legitimate_constant_p): Likewise.
	(pa_tls_symbol_ref_1, pa_tls_referenced_p): Delete.
	* config/rs6000/rs6000.c (rs6000_tls_referenced_p): Delete.
	(rs6000_cannot_force_const_mem, rs6000_emit_move)
	(rs6000_address_for_altivec): Use tls_referenced_p instead of
	rs6000_tls_referenced_p.
	(rs6000_tls_symbol_ref_1): Delete.

From-SVN: r213077
2014-07-26 09:47:33 +00:00
Richard Sandiford d4cf94779f rtl.h (target_rtl): Remove lang_dependent_initialized.
gcc/
	* rtl.h (target_rtl): Remove lang_dependent_initialized.
	* toplev.c (initialize_rtl): Don't use it.  Move previously
	"language-dependent" calls to...
	(backend_init): ...here.
	(lang_dependent_init_target): Don't set lang_dependent_initialized.
	Assert that RTL initialization hasn't happend yet.

From-SVN: r213004
2014-07-24 15:18:09 +00:00
Jan Hubicka b9b5f43367 toplev.c (backend_init_target): Move init_emit_regs and init_regs to...
* toplev.c (backend_init_target): Move init_emit_regs and init_regs to...
	(backend_init) ... here; skip ira_init_once and backend_init_target.
	(target_reinit) ... and here; clear this_target_rtl->lang_dependent_initialized.
	(lang_dependent_init_target): Clear this_target_rtl->lang_dependent_initialized;
	break out rtl initialization to ...
	(initialize_rtl): ... here; call also backend_init_target and ira_init_once.
	* toplev.h (initialize_rtl): New function.
	* function.c: Include toplev.h
	(init_function_start): Call initialize_rtl.
	* rtl.h (target_rtl): Add target_specific_initialized,
	lang_dependent_initialized.

From-SVN: r212007
2014-06-26 02:28:37 +00:00
Eric Botcazou ffa4602f4d rtl.h (insn_location): Declare.
* rtl.h (insn_location): Declare.
	* cfgcleanup.c (try_forward_edges): Compare the locus of locations
	with UNKNOWN_LOCATION.
	* emit-rtl.c (insn_location): New function.
	* final.c (notice_source_line): Check that the instruction has a
	location before retrieving it and use insn_location.
	* modulo-sched.c (loop_single_full_bb_p): Likewise.
	* print-rtl.c (print_rtx): Likewise.

From-SVN: r211305
2014-06-06 07:32:25 +00:00
Tom de Vries ed00b1fb97 Fix rtl-check build
2014-05-29  Tom de Vries  <tom@codesourcery.com>

	* rtl.h (BLOCK_SYMBOL_CHECK): Use SYMBOL_REF_FLAGS.

From-SVN: r211057
2014-05-29 16:32:16 +00:00
Richard Sandiford c8912e539b rtl.h (set_for_reg_notes): Declare.
2014-05-26  Richard Sandiford  <rdsandiford@googlemail.com>
            Olivier Hainque  <hainque@adacore.com>

        * rtl.h (set_for_reg_notes): Declare.
        * emit-rtl.c (set_for_reg_notes): New function.
        (set_unique_reg_note): Use it.
        * optabs.c (add_equal_note): Likewise


Co-Authored-By: Olivier Hainque <hainque@adacore.com>

From-SVN: r210998
2014-05-28 08:41:27 +00:00
Richard Sandiford 339ba33b4f reg-notes.def (CROSSING_JUMP): Likewise.
gcc/
	* reg-notes.def (CROSSING_JUMP): Likewise.
	* rtl.h (rtx_def): Update comment for jump flag.
	(CROSSING_JUMP_P): Define.
	* cfgcleanup.c (try_forward_edges, try_optimize_cfg): Use it instead
	of a REG_CROSSING_JUMP note.
	* cfghooks.c (tidy_fallthru_edges): Likewise.
	* cfgrtl.c (fixup_partition_crossing, rtl_verify_edges): Likewise.
	* emit-rtl.c (try_split): Likewise.
	* haifa-sched.c (sched_create_recovery_edges): Likewise.
	* ifcvt.c (find_if_case_1, find_if_case_2): Likewise.
	* jump.c (redirect_jump_2): Likewise.
	* reorg.c (follow_jumps, fill_slots_from_thread): Likewise.
	(relax_delay_slots): Likewise.
	* config/arc/arc.md (jump_i, cbranchsi4_scratch, *bbit): Likewise.
	(bbit_di): Likewise.
	* config/arc/arc.c (arc_reorg, arc_can_follow_jump): Likewise.
	* config/sh/sh.md (jump_compact): Likewise.
	* bb-reorder.c (rotate_loop): Likewise.
	(pass_duplicate_computed_gotos::execute): Likewise.
	(add_reg_crossing_jump_notes): Rename to...
	(update_crossing_jump_flags): ...this.
	(pass_partition_blocks::execute): Update accordingly.

From-SVN: r210603
2014-05-19 06:49:58 +00:00
Trevor Saunders 766090c20f use templates instead of gengtype for typed allocation functions
gcc/ChangeLog:

	* alias.c (record_alias_subset): Adjust.
	* bitmap.c (bitmap_element_allocate): Likewise.
	(bitmap_gc_alloc_stat): Likewise.
	* cfg.c (init_flow): Likewise.
	(alloc_block): Likewise.
	(unchecked_make_edge): Likewise.
	* cfgloop.c (alloc_loop): Likewise.
	(flow_loops_find): Likewise.
	(rescan_loop_exit): Likewise.
	* cfgrtl.c (init_rtl_bb_info): Likewise.
	* cgraph.c (insert_new_cgraph_node_version): Likewise.
	(cgraph_allocate_node): Likewise.
	(cgraph_create_edge_1): Likewise.
	(cgraph_allocate_init_indirect_info): Likewise.
	* cgraphclones.c (cgraph_clone_edge): Likewise.
	* cgraphunit.c (add_asm_node): Likewise.
	(init_lowered_empty_function): Likewise.
	* config/aarch64/aarch64.c (aarch64_init_machine_status):
	Likewise.
	* config/alpha/alpha.c (alpha_init_machine_status): Likewise.
	(alpha_use_linkage): Likewise.
	* config/arc/arc.c (arc_init_machine_status): Likewise.
	* config/arm/arm.c (arm_init_machine_status): Likewise.
	* config/avr/avr.c (avr_init_machine_status): Likewise.
	* config/bfin/bfin.c (bfin_init_machine_status): Likewise.
	* config/c6x/c6x.c (c6x_init_machine_status): Likewise.
	* config/cris/cris.c (cris_init_machine_status): Likewise.
	* config/darwin.c (machopic_indirection_name): Likewise.
	(darwin_build_constant_cfstring): Likewise.
	(darwin_enter_string_into_cfstring_table): Likewise.
	* config/epiphany/epiphany.c (epiphany_init_machine_status):
	* Likewise.
	* config/frv/frv.c (frv_init_machine_status): Likewise.
	* config/i386/i386.c (get_dllimport_decl): Likewise.
	(ix86_init_machine_status): Likewise.
	(assign_386_stack_local): Likewise.
	* config/i386/winnt.c (i386_pe_record_external_function):
	Likewise.
	(i386_pe_maybe_record_exported_symbol): Likewise.
	(i386_pe_record_stub): Likewise.
	* config/ia64/ia64.c (ia64_init_machine_status): Likewise.
	* config/iq2000/iq2000.c (iq2000_init_machine_status): Likewise.
	* config/m32c/m32c.c (m32c_init_machine_status): Likewise.
	(m32c_note_pragma_address): Likewise.
	* config/mep/mep.c (mep_init_machine_status): Likewise.
	(mep_note_pragma_flag): Likewise.
	* config/mips/mips.c (mflip_mips16_use_mips16_p): Likewise.
	(mips16_local_alias): Likewise.
	(mips_init_machine_status): Likewise.
	* config/mmix/mmix.c (mmix_init_machine_status): Likewise.
	* config/moxie/moxie.c (moxie_init_machine_status): Likewise.
	* config/msp430/msp430.c (msp430_init_machine_status): Likewise.
	* config/nds32/nds32.c (nds32_init_machine_status): Likewise.
	* config/nios2/nios2.c (nios2_init_machine_status): Likewise.
	* config/pa/pa.c (pa_init_machine_status): Likewise.
	(pa_get_deferred_plabel): Likewise.
	* config/rl78/rl78.c (rl78_init_machine_status): Likewise.
	* config/rs6000/rs6000.c (builtin_function_type): Likewise.
	(rs6000_init_machine_status): Likewise.
	(output_toc): Likewise.
	* config/s390/s390.c (s390_init_machine_status): Likewise.
	* config/score/score.c (score_output_external): Likewise.
	* config/sparc/sparc.c (sparc_init_machine_status): Likewise.
	* config/spu/spu.c (spu_init_machine_status): Likewise.
	* config/tilegx/tilegx.c (tilegx_init_machine_status): Likewise.
	* config/tilepro/tilepro.c (tilepro_init_machine_status):
	* Likewise.
	* config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise.
	* coverage.c (coverage_end_function): Likewise.
	* dbxout.c (dbxout_init): Likewise.
	* doc/gty.texi: Don't mention variable_size attribute.
	* dwarf2cfi.c (new_cfi): Adjust.
	(new_cfi_row): Likewise.
	(copy_cfi_row): Likewise.
	(create_cie_data): Likewise.
	* dwarf2out.c (dwarf2out_alloc_current_fde): Likewise.
	(new_loc_descr): Likewise.
	(find_AT_string_in_table): Likewise.
	(add_addr_table_entry): Likewise.
	(new_die): Likewise.
	(add_var_loc_to_decl): Likewise.
	(clone_die): Likewise.
	(clone_as_declaration): Likewise.
	(break_out_comdat_types): Likewise.
	(new_loc_list): Likewise.
	(add_loc_descr_to_each): Likewise.
	(add_location_or_const_value_attribute): Likewise.
	(add_linkage_name): Likewise.
	(lookup_filename): Likewise.
	(dwarf2out_var_location): Likewise.
	(new_line_info_table): Likewise.
	(dwarf2out_init): Likewise.
	(mem_loc_descriptor): Likewise.
	(loc_descriptor): Likewise.
	(add_const_value_attribute): Likewise.
	(tree_add_const_value_attribute): Likewise.
	(comp_dir_string): Likewise.
	(dwarf2out_vms_debug_main_pointer): Likewise.
	(string_cst_pool_decl): Likewise.
	* emit-rtl.c (set_mem_attrs): Likewise.
	(get_reg_attrs): Likewise.
	(start_sequence): Likewise.
	(init_emit): Likewise.
	(init_emit_regs): Likewise.
	* except.c (init_eh_for_function): Likewise.
	(gen_eh_region): Likewise.
	(gen_eh_region_catch): Likewise.
	(gen_eh_landing_pad): Likewise.
	(add_call_site): Likewise.
	* function.c (add_frame_space): Likewise.
	(insert_temp_slot_address): Likewise.
	(assign_stack_temp_for_type): Likewise.
	(get_hard_reg_initial_val): Likewise.
	(allocate_struct_function): Likewise.
	(prepare_function_start): Likewise.
	(types_used_by_var_decl_insert): Likewise.
	* gengtype.c (variable_size_p): Remove function.
	(enum alloc_quantity): Remove enum.
	(write_typed_alloc_def): Remove function.
	(write_typed_struct_alloc_def): Likewise.
	(write_typed_typedef_alloc_def): Likewise.
	(write_typed_alloc_defns): Likewise.
	(main): Adjust.
	* ggc-common.c (ggc_cleared_alloc_htab_ignore_args): Adjust.
	(ggc_cleared_alloc_ptr_array_two_args): Likewise.
	* ggc.h (ggc_alloc): new function.
	(ggc_cleared_alloc): Likewise.
	(ggc_vec_alloc): Template on type of vector element, and remove
	element size argument.
	(ggc_cleared_vec_alloc): Likewise.
	* gimple.c (gimple_build_omp_for): Adjust.
	(gimple_copy): Likewise.
	* ipa-cp.c (get_replacement_map): Likewise.
	(find_aggregate_values_for_callers_subset): Likewise.
	(known_aggs_to_agg_replacement_list): Likewise.
	* ipa-devirt.c (get_odr_type): Likewise.
	* ipa-prop.c (ipa_node_duplication_hook): Likewise.
	(read_agg_replacement_chain): Likewise.
	* loop-iv.c (get_simple_loop_desc): Likewise.
	* lto-cgraph.c (input_node_opt_summary): Likewise.
	* lto-section-in.c (lto_new_in_decl_state): Likewise.
	* lto-streamer-in.c (lto_input_eh_catch_list): Likewise.
	(input_eh_region): Likewise.
	(input_eh_lp): Likewise.
	(input_cfg): Likewise.
	* optabs.c (set_optab_libfunc): Likewise.
	(init_tree_optimization_optabs): Likewise.
	(set_conv_libfunc): Likewise.
	* passes.c (do_per_function_toporder): Likewise.
	* rtl.h: Don't use variable_size gty attribute.
	* sese.c (if_region_set_false_region): Adjust.
	* stringpool.c (gt_pch_save_stringpool): Likewise.
	* target-globals.c (save_target_globals): Likewise.
	* toplev.c (general_init): Likewise.
	* trans-mem.c (record_tm_replacement): Likewise.
	(split_bb_make_tm_edge): Likewise.
	* tree-cfg.c (move_sese_region_to_fn): Likewise.
	* tree-data-ref.h (lambda_vector_new): Likewise.
	* tree-eh.c (add_stmt_to_eh_lp_fn): Likewise.
	* tree-iterator.c (tsi_link_before): Likewise.
	(tsi_link_after): Likewise.
	* tree-scalar-evolution.c (new_scev_info_str): Likewise.
	* tree-ssa-loop-niter.c (record_estimate): Likewise.
	* tree-ssa-operands.c (ssa_operand_alloc): Likewise.
	* tree-ssa-operands.h: Don't use variable_size gty attribute.
	* tree-ssa.c (init_tree_ssa): Adjust.
	* tree-ssanames.c (set_range_info): Likewise.
	(get_ptr_info): Likewise.
	(duplicate_ssa_name_ptr_info): Likewise.
	(duplicate_ssa_name_range_info): Likewise.
	* tree-streamer-in.c (unpack_ts_real_cst_value_fields): Likewise.
	(unpack_ts_fixed_cst_value_fields): Likewise.
	* tree.c (build_fixed): Likewise.
	(build_real): Likewise.
	(build_string): Likewise.
	(decl_priority_info): Likewise.
	(decl_debug_expr_insert): Likewise.
	(decl_value_expr_insert): Likewise.
	(decl_debug_args_insert): Likewise.
	(type_hash_add): Likewise.
	(build_omp_clause): Likewise.
	* ubsan.c (decl_for_type_insert): Likewise.
	* varasm.c (get_unnamed_section): Likewise.
	(get_noswitch_section): Likewise.
	(get_section): Likewise.
	(get_block_for_section): Likewise.
	(create_block_symbol): Likewise.
	(build_constant_desc): Likewise.
	(create_constant_pool): Likewise.
	(force_const_mem): Likewise.
	(record_tm_clone_pair): Likewise.
	* varpool.c (varpool_create_empty_node): Likewise.

gcc/c/ChangeLog:

	* c-decl.c (finish_struct): Adjust.
	(finish_enum): Likewise.
	(bind): Adjust.
	(record_inline_static): Likewise.
	(push_scope): Likewise.
	(make_label): Likewise.
	(lookup_label_for_goto): Likewise.
	(finish_struct): Likewise.
	(finish_enum): Likewise.
	(store_parm_decls): Likewise.
	(c_push_function_context): Likewise.
	* c-lang.h: Remove usage of variable_size gty attribute.
	* c-parser.c (c_parse_init): Adjust.
	(c_parse_file): Likewise.

gcc/java/ChangeLog:

	* class.c (add_method_1): Adjust.
	(java_treetreehash_new): Likewise.
	* constants.c (set_constant_entry): Likewise.
	(cpool_for_class): Likewise.
	* decl.c (make_binding_level): Likewise.
	(java_dup_lang_specific_decl): Likewise.
	* expr.c (add_type_assertion): Likewise.
	* java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): Likewise.
	(lang_decl): don't use variable_size gty attribute.
	(MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Adjust.
	(lang_type): Don't use variable_size gty attribute.
	* jcf-parse.c (java_parse_file): Adjust.
	(process_zip_dir): Likewise.
	* jcf.h: Remove usage of variable_size gty attribute.
	* jcf-reader.c (jcf_parse_constant_pool): Adjust.
	(jcf_parse_bootstrap_methods): Likewise.

gcc/objc/ChangeLog:

	* objc-act.c (objc_build_string_object): Adjust.
	(continue_class): Likewise.
	* objc-act.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Likewise.
	* objc-map.c (objc_map_alloc_ggc): Likewise.
	(objc_map_private_resize): Likewise.
	* objc-next-runtime-abi-02.c (objc_next_runtime_abi_02_init):
	Likewise.
	(hash_name_enter): Likewise.

gcc/cp/ChangeLog:

	* class.c (sorted_fields_type_new): Adjust.
	* cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Likewise.
	* cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
	* cp-tree.h: Remove usage of variable_size gty attribute.
	* decl.c (make_label_decl): Adjust.
	(check_goto): Likewise.
	(start_preparsed_function): Likewise.
	(save_function_data): Likewise.
	* lex.c (init_reswords): Likewise.
	(retrofit_lang_decl): Likewise.
	(cxx_dup_lang_specific_decl): Likewise.
	(copy_lang_type): Likewise.
	(cxx_make_type): Likewise.
	* name-lookup.c (binding_entry_make): Likewise.
	(binding_table_construct): Likewise.
	(binding_table_new): Likewise.
	(cxx_binding_make): Likewise.
	(pushdecl_maybe_friend_1): Likewise.
	(begin_scope): Likewise.
	(push_to_top_level): Likewise.
	* parser.c (cp_lexer_alloc): Likewise.
	(cp_lexer_new_from_tokens): Likewise.
	(cp_token_cache_new): Likewise.
	(cp_parser_context_new): Likewise.
	(cp_parser_new): Likewise.
	(cp_parser_nested_name_specifier_opt): Likewise.
	(cp_parser_template_id): Likewise.
	* pt.c (maybe_process_partial_specialization): Likewise.
	(register_specialization): Likewise.
	(add_pending_template): Likewise.
	(lookup_template_class_1): Likewise.
	(push_tinst_level): Likewise.
	* semantics.c (register_constexpr_fundef): Likewise.
	(cxx_eval_call_expression): Likewise.
	* typeck2.c (abstract_virtuals_error_sfinae): Likewise.

gcc/fortran/ChangeLog:

	* f95-lang.c (pushlevel): Adjust.
	* trans-decl.c (gfc_allocate_lang_decl): Adjust.
	(gfc_find_module): Likewise.
	* trans-types.c (gfc_get_nodesc_array_type): Likewise.
	(gfc_get_array_type_bounds): Likewise.
	(gfc_nonrestricted_type): Likewise.
	* trans.h: Don't use variable_size gty attribute.

gcc/ada/ChangeLog:

	* gcc-interface/ada-tree.h: Remove usage of variable_size gty
	annotation.
	* gcc-interface/decl.c (annotate_value): Adjust.
	* gcc-interface/trans.c (Attribute_to_gnu): Likewise.
	(push_range_check_info): Likewise.
	(Loop_Statement_to_gnu): Likewise.
	(Subprogram_Body_to_gnu): Likewise.
	(Compilation_Unit_to_gnu): Likewise.
	(start_stmt_group): Likewise.
	* gcc-interface/utils.c (init_gnat_utils): Likewise.
	(gnat_pushlevel): Likewise.
	(maybe_pad_type): Likewise.

gcc/go/ChangeLog:

	* go-lang.c (struct GTY): Don't use variable_size gty attribute.

gcc/c-family/ChangeLog:

	* c-common.h (sorted_fields_type): Remove variable_size GTY attribute.
	* c-pragma.c (push_alignment): Adjust.
	(handle_pragma_push_options): Likewise.

gcc/lto/ChangeLog:

	* lto-tree.h: Don't use variable_size gty attribute.
	* lto.c (lto_read_in_decl_state): Adjust.
	(create_subid_section_table): Likewise.
	(lto_flatten_files): Likewise.
	(read_cgraph_and_symbols): Likewise.

gcc/objcp/ChangeLog:

	* objcp-decl.h: Adjust.

From-SVN: r210566
2014-05-17 23:07:23 +00:00
Richard Sandiford 23b3372508 emit-rtl.h (replace_equiv_address, [...]): Add an inplace argument.
gcc/
	* emit-rtl.h (replace_equiv_address, replace_equiv_address_nv): Add an
	inplace argument.  Store the new address in the original MEM when true.
	* emit-rtl.c (change_address_1): Likewise.
	(adjust_address_1, adjust_automodify_address_1, offset_address):
	Update accordingly.
	* rtl.h (plus_constant): Add an inplace argument.
	* explow.c (plus_constant): Likewise.  Try to reuse the original PLUS
	when true.  Avoid generating (plus X (const_int 0)).
	* function.c (instantiate_virtual_regs_in_rtx): Adjust the PLUS
	in-place.  Pass true to plus_constant.
	(instantiate_virtual_regs_in_insn): Pass true to replace_equiv_address.

From-SVN: r210543
2014-05-17 07:00:02 +00:00
Richard Sandiford da3cd11361 rtl.def (SYMBOL_REF): Remove middle "0" field.
gcc/
	* rtl.def (SYMBOL_REF): Remove middle "0" field.
	* rtl.h (block_symbol): Reduce number of fields to 2.
	(rtx_def): Add u2.symbol_ref_flags.
	(SYMBOL_REF_FLAGS): Use it.
	(SYMBOL_REF_DATA, SET_SYMBOL_REF_DECL, SYMBOL_REF_DECL)
	(SET_SYMBOL_REF_CONSTANT, SYMBOL_REF_CONSTANT): Lower index.
	* gengtype.c (adjust_field_rtx_def): Remove SYMBOL_REF_FLAGS handling.
	Lower index of SYMBOL_REF_DATA.
	* print-rtl.c (print_rtx): Lower index for SYMBOL_REF_DATA.
	Print SYMBOL_REF_FLAGS at the same time.
	* genattrtab.c (attr_rtx_1): Only initialize 1 "0" SYMBOL_REF field.

From-SVN: r210363
2014-05-13 10:39:16 +00:00
Richard Sandiford fcc74520d0 rtl.def (VAR_LOCATION): Remove "i" field.
gcc/
	* rtl.def (VAR_LOCATION): Remove "i" field.
	* rtl.h (rtx_def): Add u2.var_location_status.
	(PAT_VAR_LOCATION_STATUS): Use it.
	(gen_rtx_VAR_LOCATION): Declare.
	* gengenrtl.c (excluded_rtx): Add VAR_LOCATION.
	* emit-rtl.c (gen_rtx_VAR_LOCATION): New function.
	* var-tracking.c (emit_note_insn_var_location): Remove casts.

From-SVN: r210362
2014-05-13 10:39:08 +00:00
Richard Sandiford ed8921dc73 gcc/
* rtl.def (DEBUG_INSN, INSN, JUMP_INSN, CALL_INSN, JUMP_TABLE_DATA)
	(BARRIER, CODE_LABEL, NOTE): Remove first "i" field.
	* rtl.h (rtx_def): Add insn_uid to u2 field.
	(RTX_FLAG_CHECK8): Delete in favor of...
	(RTL_INSN_CHAIN_FLAG_CHECK): ...this new macro.
	(INSN_DELETED_P): Update accordingly.
	(INSN_UID): Use u2.insn_uid.
	(INSN_CHAIN_CODE_P): Define.
	(PREV_INSN, NEXT_INSN, BLOCK_FOR_INSN, PATTERN, INSN_LOCATION)
	(INSN_CODE, REG_NOTES, CALL_INSN_FUNCTION_USAGE, CODE_LABEL_NUMBER)
	(NOTE_DATA, NOTE_DELETED_LABEL_NAME, NOTE_BLOCK, NOTE_EH_HANDLER)
	(NOTE_BASIC_BLOCK, NOTE_VAR_LOCATION, NOTE_CFI, NOTE_LABEL_NUMBER)
	(NOTE_KIND, LABEL_NAME, LABEL_NUSES, JUMP_LABEL, LABEL_REFS): Lower
	indices accordingly.
	* print-rtl.c (print_rtx): Print INSN_UIDs before the main loop.
	Update indices for insn-chain rtxes.
	* gengtype.c (gen_rtx_next): Adjust test for insn-chain rtxes.
	(adjust_field_rtx_def): Lower '0' indices for all insn-chain rtxes.
	* emit-rtl.c (gen_label_rtx): Update gen_rtx_LABEL call.
	* caller-save.c (init_caller_save): Update gen_rtx_INSN calls.
	* combine.c (try_combine): Likewise.
	* ira.c (setup_prohibited_mode_move_regs): Likewise.

From-SVN: r210360
2014-05-13 10:38:50 +00:00
Richard Sandiford fccc55155d rtl.def (REG): Remove middle field.
gcc/
	* rtl.def (REG): Remove middle field.
	* rtl.h (rtx_def): Add orignal_regno to u2.
	(ORIGINAL_REGNO): Use it instead of field 1.
	(REG_ATTRS): Lower field index accordingly.
	* gengtype.c (adjust_field_rtx_def): Remove handling of
	ORIGINAL_REGNO.  Move REG_ATTRS index down.
	* print-rtl.c (print_rtx): Move ORIGINAL_REGNO handling to the
	code that prints the REGNO.

From-SVN: r210359
2014-05-13 10:38:38 +00:00
Richard Sandiford 13b0c5ac1e rtl.h (rtx_def): Mark u2 as GTY ((skip)).
gcc/
	* rtl.h (rtx_def): Mark u2 as GTY ((skip)).

From-SVN: r210357
2014-05-13 10:38:17 +00:00
Richard Sandiford aa3a12d66e emit-rtl.c (init_derived_machine_modes): New functionm, split out from...
gcc/
	* emit-rtl.c (init_derived_machine_modes): New functionm, split
	out from...
	(init_emit_once): ...here.
	* rtl.h (init_derived_machine_modes): Declare.
	* toplev.c (do_compile): Call it even if no_backend.

From-SVN: r210118
2014-05-06 17:44:15 +00:00
Kenneth Zadeck 807e902eea Merge in wide-int.
From-SVN: r210113
2014-05-06 16:25:05 +00:00
Radovan Obradovic 356bf59349 Add implicit parameter to find_all_hard_reg_sets
2014-04-25  Radovan Obradovic  <robradovic@mips.com>
            Tom de Vries  <tom@codesourcery.com>

	* rtlanal.c (find_all_hard_reg_sets): Add bool implicit parameter and
	handle.
	* rtl.h (find_all_hard_reg_sets): Add bool parameter.
	* haifa-sched.c (recompute_todo_spec, check_clobbered_conditions): Add
	new argument to find_all_hard_reg_sets call.

Co-Authored-By: Tom de Vries <tom@codesourcery.com>

From-SVN: r209798
2014-04-25 11:21:18 +00:00
Richard Biener da4cfeacb0 Makefile.in (OBJS): Remove loop-unswitch.o.
2014-04-23  Richard Biener  <rguenther@suse.de>

	* Makefile.in (OBJS): Remove loop-unswitch.o.
	* loop-unswitch.c: Delete.
	* tree-pass.h (make_pass_rtl_unswitch): Remove.
	* passes.def (pass_rtl_unswitch): Likewise.
	* loop-init.c (gate_rtl_unswitch): Likewise.
	(rtl_unswitch): Likewise.
	(pass_data_rtl_unswitch): Likewise.
	(pass_rtl_unswitch): Likewise.
	(make_pass_rtl_unswitch): Likewise.
	* rtl.h (reversed_condition): Likewise.
	(compare_and_jump_seq): Likewise.
	* loop-iv.c (reversed_condition): Move here from loop-unswitch.c
	and make static.
	* loop-unroll.c (compare_and_jump_seq): Likewise.

From-SVN: r209698
2014-04-23 13:48:12 +00:00
Richard Sandiford f9ae4df84e re PR target/52125 (Problems with LO16 asm operands on MIPS)
gcc/
	PR target/52125
	* rtl.h (get_referenced_operands): Declare.
	* recog.c (get_referenced_operands): New function.
	* config/mips/mips.c (mips_reorg_process_insns): Check which asm
	operands have been referenced when recording LO_SUM references.

gcc/testsuite/
	PR target/52125
	* gcc.dg/pr48774.c: Remove skip for mips_rel.
	* gcc.target/mips/pr52125.c: New test.

From-SVN: r206955
2014-01-23 08:24:38 +00:00
Richard Henderson af6e846774 re PR debug/54694 (internal compiler error: in dwarf2out_frame_debug_expr, at dwarf2out.c:2387)
PR debug/54694

Diagnose frame_pointer_required vs fixed hfp

From-SVN: r206647
2014-01-15 13:41:03 -08:00
Richard Sandiford 23a5b65a92 Update copyright years in gcc/
From-SVN: r206289
2014-01-02 22:23:26 +00:00
Oleg Endo 84562394e2 cgraph.h (cgraph_node_set_iterator, [...]): Remove typedef.
* gcc/cgraph.h (cgraph_node_set_iterator, varpool_node_set_iterator):
	Remove typedef.
	(cgraph_inline_failed_enum, cgraph_inline_failed_t): Remove typedef and
	rename to cgraph_inline_failed_t.
	* gcc/tree-ssa-alias.h (ao_ref_s, ao_ref): Remove typedef and rename
	to ao_ref.
	* gcc/reload.h (reg_equivs_s, reg_equivs_t): Remove typedef and rename
	to reg_equivs_t.
	* gcc/conditions.h (CC_STATUS): Remove typedef.
	* gcc/bitmap.h (bitmap_obstack): Remove typedef.
	(bitmap_element_def, bitmap_element): Remove typedef and rename to
	bitmap_element.
	(bitmap_head_def, bitmap_head): Remove typedef and rename to
	bitmap_head.
	(bitmap_iterator): Remove typedef.
	* gcc/target.h (cumulative_args_t, print_switch_type,
	secondary_reload_info): Remove typedef.
	* gcc/dwarf2out.h (dw_cfi_oprnd_struct, dw_cfi_oprnd): Remove
	dw_cfi_oprnd_struct alias.
	(dw_cfi_struct, dw_cfi_node): Remove typedef and rename to dw_cfi_node.
	(dw_fde_struct, dw_fde_node): Remove typedef and rename to dw_fde_node.
	(cfa_loc, dw_cfa_location): Remove typedef and rename to
	dw_cfa_location.
	(dw_vec_struct, dw_vec_const): Remove typedef and rename to
	dw_vec_const.
	(dw_val_struct, dw_val_node): Remove typedef and rename to dw_val_node.
	(dw_loc_descr_struct, dw_loc_descr_node): Remove typedef and rename to
	dw_loc_descr_node.
	* gcc/params.h (param_info, compiler_param): Remove typedef.
	* gcc/opts.h (cl_deferred_param): Remove typedef.
	* gcc/sreal.h (sreal): Remove typedef.
	* gcc/ddg.h (dep_type, dep_data_type): Remove typedef.
	* gcc/graphite-clast-to-gimple.h (cloog_prog_clast, bb_pbb_def): Remove
	typedef.
	* gcc/lto-streamer.h (lto_decl_stream_e_t, lto_encoder_entry,
	lto_symtab_encoder_iterator, res_pair): Remove typedef.
	* gcc/tree-affine.h (affine_tree_combination, aff_tree): Remove typedef
	and rename to aff_tree.
	* gcc/sched-int.h (region): Remove typedef.
	* gcc/diagnostic.h (diagnostic_info,
	diagnostic_classification_change_t): Remove typedef.
	* gcc/tree-ssa-loop.h (affine_iv_d): Remove typedef and rename to
	affine_iv.
	* gcc/sbitmap.h (sbitmap_iterator): Remove typedef.
	* gcc/ssa-iterators.h (immediate_use_iterator_d, imm_use_iterator):
	Remove typedef and rename to imm_use_iterator.
	(ssa_operand_iterator_d, ssa_op_iter): Remove typedef and rename to
	ssa_op_iter.
	* gcc/ggc-internal.h (ggc_statistics): Remove typedef.
	* gcc/cselib.h (cselib_val_struct, cselib_val): Remove typedef and
	rename to cselib_val.
	* gcc/tree-core.h (alias_pair): Remove typedef.
	(constructor_elt_d, constructor_elt): Remove typedef and rename to
	constructor_elt.
	(ssa_use_operand_d, ssa_use_operand_t): Remove typedef and rename to
	ssa_use_operand_t.
	* gcc/graphite-sese-to-poly.h (base_alias_pair): Remove typedef.
	* gcc/tree-data-ref.h (conflict_function): Remove typedef.
	* gcc/tree-inline.h (copy_body_data): Remove typedef.
	* gcc/ipa-inline.h (condition, size_time_entry, inline_param_summary_t,
	edge_growth_cache_entry): Remove typedef.
	* gcc/regrename.h (operand_rr_info, insn_rr_info): Remove typedef.
	* gcc/gimple-iterator.h (gimple_stmt_iterator_d, gimple_stmt_iterator):
	Remove typedef and rename to gimple_stmt_iterator.
	* gcc/basic-block.h (ce_if_block, ce_if_block_t): Remove typedef and
	rename to ce_if_block.
	(edge_iterator): Remove typedef.
	* gcc/ipa-prop.h (ipa_agg_jf_item, ipa_agg_jf_item_t): Remove typedef
	and rename to ipa_agg_jf_item.
	(ipa_agg_jump_function_t, ipa_param_descriptor_t, ipa_node_params_t,
	ipa_parm_adjustment_t): Remove typedef.
	(ipa_jump_func, ipa_jump_func_t): Remove typedef and rename to
	ipa_jump_func.
	(ipa_edge_args, ipa_edge_args_t): Remove typedef and rename to
	ipa_edge_args.
	* gcc/gcov-io.h (gcov_bucket_type): Remove typedef.
	(gcov_working_set_info, gcov_working_set_t): Remove typedef and rename
	to gcov_working_set_t.
	* gcc/ira-int.h (minmax_set_iterator, ira_allocno_iterator,
	ira_object_iterator, ira_allocno_object_iterator, ira_pref_iterator,
	ira_copy_iterator, ira_object_conflict_iterator): Remove typedef.
	* gcc/tree-iterator.h (tree_stmt_iterator): Remove typedef.
	* gcc/rtl.h (addr_diff_vec_flags, mem_attrs, reg_attrs,
	replace_label_data): Remove typedef.
	(rtunion_def, rtunion): Remove typedef and rename to rtunion.
	* gcc/hard-reg-set.h (hard_reg_set_iterator): Remove typedef.
	* gcc/sel-sched-ir.h (_list_iterator, sel_global_bb_info_def,
	sel_region_bb_info_def, succ_iterator): Remove typedef.
	(deps_where_def, deps_where_t): Remove typedef and rename to
	deps_where_t.
	* gcc/coretypes.h: Adapt forward declarations.
	* gcc/tree-scalar-evolution.h: Likewise.
	* gcc/tree-ssa-address.h: Likewise.
	* gcc/tree-ssa-operands.h: Likewise.
	* gcc/function.h: Likewise.
	* gcc/config/frv/frv-protos.h: Likewise.
	* gcc/targhooks.h: Likewise.
	* gcc/basic_block.h: Likewise.
	* gcc/rtl.def: Adapt documentation.
	* gcc/doc/tm.texi: Likewise.
	* gcc/ipa-cp.c: Adapt uses.
	* gcc/bitmap.c: Likewise.
	* gcc/dwarf2out.c: Likewise.
	* gcc/target.def: Likewise.
	* gcc/ipa-inline-analysis.c: Likewise.
	* gcc/dwarf2cfi.c: Likewise.
	* gcc/tree-ssa-loop-ivopts.c: Likewise.
	* gcc/lto-cgraph.c: Likewise.
	* gcc/config/frv/frv.c: Likewise.
	* gcc/ifcvt.c: Likewise.
	* gcc/ipa-prop.c: Likewise.

From-SVN: r205863
2013-12-10 16:48:44 +00:00
Ilya Enkovich 089d122746 revert: cgraph.h (varpool_node): Add need_bounds_init field.
Reverted:
	2013-11-20  Ilya Enkovich  <ilya.enkovich@intel.com>
	* cgraph.h (varpool_node): Add need_bounds_init field.
	* lto-cgraph.c (lto_output_varpool_node): Output
	need_bounds_init value.
	(input_varpool_node): Read need_bounds_init value.
	* varpool.c (dump_varpool_node): Dump need_bounds_init field.

	Reverted:
	2013-11-20  Ilya Enkovich  <ilya.enkovich@intel.com>
	* dbxout.c (dbxout_type): Ignore POINTER_BOUNDS_TYPE.
	* dwarf2out.c (gen_subprogram_die): Ignore bound args.
	(gen_type_die_with_usage): Skip pointer bounds.
	(dwarf2out_global_decl): Likewise.

	Reverted:
	2013-11-18  Ilya Enkovich  <ilya.enkovich@intel.com>
	* builtin-types.def (BT_FN_PTR_CONST_PTR_VAR): New.
	* chkp-builtins.def (BUILT_IN_CHKP_BIND_BOUNDS): New.
	* cfgexpand.c (expand_call_stmt): Expand BUILT_IN_CHKP_BIND_BOUNDS.
	* gimple.c (gimple_call_get_nobnd_arg_index): Remove.
	* gimple.h (gf_mask): Add GF_CALL_WITH_BOUNDS.
	(gimple_call_with_bounds_p): New.
	(gimple_call_set_with_bounds): New.
	(gimple_call_num_nobnd_args): Remove.
	(gimple_call_nobnd_arg): Remove.
	* tree.h (CALL_WITH_BOUNDS_P): New.
	* rtl.h (CALL_EXPR_WITH_BOUNDS_P): New.

	Reverted:
	2013-11-08  Ilya Enkovich  <ilya.enkovich@intel.com>
	* common.opt (fcheck-pointer-bounds): Move to ...
	* c-family/c.opt: ... here.
	* langhooks-def.h (LANG_HOOKS_CHKP_SUPPORTED): Remove.
	(LANG_HOOKS_INITIALIZER): Remove LANG_HOOKS_CHKP_SUPPORTED.
	* langhooks.h (lang_hooks): Remove chkp_supported field.
	* toplev.c (process_options): Remove chkp_supported check.

	Reverted:
	2013-10-30  Ilya Enkovich  <ilya.enkovich@intel.com>
	* tree-core.h (tree_index): Add TI_POINTER_BOUNDS_TYPE.
	* tree.h (POINTER_BOUNDS_P): New.
	(BOUNDED_TYPE_P): New.
	(BOUNDED_P): New.
	(pointer_bounds_type_node): New.
	* tree.c (build_common_tree_nodes): Initialize
	pointer_bounds_type_node.
	* gimple.h (gimple_call_get_nobnd_arg_index): New.
	(gimple_call_num_nobnd_args): New.
	(gimple_call_nobnd_arg): New.
	(gimple_return_retbnd): New.
	(gimple_return_set_retbnd): New
	* gimple.c (gimple_build_return): Increase number of ops
	for return statement.
	(gimple_call_get_nobnd_arg_index): New.
	* gimple-pretty-print.c (dump_gimple_return): Print second op.

	Reverted:
	2013-10-30  Ilya Enkovich  <ilya.enkovich@intel.com>
	* ipa.c (cgraph_build_static_cdtor_1): Support contructors
	with "chkp ctor" and "bnd_legacy" attributes.
	* gimplify.c (gimplify_init_constructor): Avoid infinite
	loop during gimplification of bounds initializer.

	Reverted:
	2013-10-30  Ilya Enkovich  <ilya.enkovich@intel.com>
	* c-family/c-common.c (handle_bnd_variable_size_attribute): New.
	(handle_bnd_legacy): New.
	(c_common_attribute_table): Add bnd_variable_size and bnd_legacy.
	* doc/extend.texi: Document bnd_variable_size and bnd_legacy
	attributes.

	Reverted:
	2013-10-29  Ilya Enkovich  <ilya.enkovich@intel.com>
	* builtin-types.def (BT_FN_VOID_CONST_PTR): New.
	(BT_FN_PTR_CONST_PTR): New.
	(BT_FN_CONST_PTR_CONST_PTR): New.
	(BT_FN_PTR_CONST_PTR_SIZE): New.
	(BT_FN_PTR_CONST_PTR_CONST_PTR): New.
	(BT_FN_VOID_PTRPTR_CONST_PTR): New.
	(BT_FN_VOID_CONST_PTR_SIZE): New.
	(BT_FN_PTR_CONST_PTR_CONST_PTR_SIZE): New.
	* chkp-builtins.def: New.
	* builtins.def: include chkp-builtins.def.
	(DEF_CHKP_BUILTIN): New.
	* builtins.c (expand_builtin): Support BUILT_IN_CHKP_INIT_PTR_BOUNDS,
	BUILT_IN_CHKP_NULL_PTR_BOUNDS, BUILT_IN_CHKP_COPY_PTR_BOUNDS,
	BUILT_IN_CHKP_CHECK_PTR_LBOUNDS, BUILT_IN_CHKP_CHECK_PTR_UBOUNDS,
	BUILT_IN_CHKP_CHECK_PTR_BOUNDS, BUILT_IN_CHKP_SET_PTR_BOUNDS,
	BUILT_IN_CHKP_NARROW_PTR_BOUNDS, BUILT_IN_CHKP_STORE_PTR_BOUNDS,
	BUILT_IN_CHKP_GET_PTR_LBOUND, BUILT_IN_CHKP_GET_PTR_UBOUND,
	BUILT_IN_CHKP_BNDMK, BUILT_IN_CHKP_BNDSTX, BUILT_IN_CHKP_BNDCL,
	BUILT_IN_CHKP_BNDCU, BUILT_IN_CHKP_BNDLDX, BUILT_IN_CHKP_BNDRET,
	BUILT_IN_CHKP_INTERSECT, BUILT_IN_CHKP_ARG_BND, BUILT_IN_CHKP_NARROW,
	BUILT_IN_CHKP_EXTRACT_LOWER, BUILT_IN_CHKP_EXTRACT_UPPER.
	* common.opt (fcheck-pointer-bounds): New.
	* toplev.c (process_options): Check Pointer Bounds Checker is
	supported.
	* doc/extend.texi: Document Pointer Bounds Checker built-in functions.

	Reverted:
	2013-10-30  Ilya Enkovich  <ilya.enkovich@intel.com>
	* target.def (builtin_chkp_function): New.
	(chkp_bound_type): New.
	(chkp_bound_mode): New.
	(fn_abi_va_list_bounds_size): New.
	(load_bounds_for_arg): New.
	(store_bounds_for_arg): New.
	* targhooks.h (default_load_bounds_for_arg): New.
	(default_store_bounds_for_arg): New.
	(default_fn_abi_va_list_bounds_size): New.
	(default_chkp_bound_type): New.
	(default_chkp_bound_mode): New.
	(default_builtin_chkp_function): New.
	* targhooks.c (default_load_bounds_for_arg): New.
	(default_store_bounds_for_arg): New.
	(default_fn_abi_va_list_bounds_size): New.
	(default_chkp_bound_type): New.
	(default_chkp_bound_mode); New.
	(default_builtin_chkp_function): New.
	* doc/tm.texi.in (TARGET_FN_ABI_VA_LIST_BOUNDS_SIZE): New.
	(TARGET_LOAD_BOUNDS_FOR_ARG): New.
	(TARGET_STORE_BOUNDS_FOR_ARG): New.
	(TARGET_BUILTIN_CHKP_FUNCTION): New.
	(TARGET_CHKP_BOUND_TYPE): New.
	(TARGET_CHKP_BOUND_MODE): New.
	* doc/tm.texi: Regenerated.
	* langhooks.h (lang_hooks): Add chkp_supported field.
	* langhooks-def.h (LANG_HOOKS_CHKP_SUPPORTED): New.
	(LANG_HOOKS_INITIALIZER); Add LANG_HOOKS_CHKP_SUPPORTED.

	Reverted:
	2013-10-24  Ilya Enkovich  <ilya.enkovich@intel.com>
	* config/i386/constraints.md (B): New.
	(Ti): New.
	(Tb): New.
	* config/i386/i386-c.c (ix86_target_macros_internal): Add __MPX__.
	* config/i386/i386-modes.def (BND32): New.
	(BND64): New.
	* config/i386/i386-protos.h (ix86_bnd_prefixed_insn_p): New.
	* config/i386/i386.c (isa_opts): Add mmpx.
	(regclass_map): Add bound registers.
	(dbx_register_map): Likewise.
	(dbx64_register_map): Likewise.
	(svr4_dbx_register_map): Likewise.
	(PTA_MPX): New.
	(ix86_option_override_internal): Support MPX ISA.
	(ix86_conditional_register_usage): Support bound registers.
	(print_reg): Likewise.
	(ix86_code_end): Add MPX bnd prefix.
	(output_set_got): Likewise.
	(ix86_output_call_insn): Likewise.
	(ix86_print_operand): Add '!' (MPX bnd) print prefix support.
	(ix86_print_operand_punct_valid_p): Likewise.
	(ix86_print_operand_address): Support UNSPEC_BNDMK_ADDR and
	UNSPEC_BNDMK_ADDR.
	(ix86_class_likely_spilled_p): Add bound regs support.
	(ix86_hard_regno_mode_ok): Likewise.
	(x86_order_regs_for_local_alloc): Likewise.
	(ix86_bnd_prefixed_insn_p): New.
	* config/i386/i386.h (FIRST_PSEUDO_REGISTER): Fix to new value.
	(FIXED_REGISTERS): Add bound registers.
	(CALL_USED_REGISTERS): Likewise.
	(REG_ALLOC_ORDER): Likewise.
	(HARD_REGNO_NREGS): Likewise.
	(TARGET_MPX): New.
	(VALID_BND_REG_MODE): New.
	(FIRST_BND_REG): New.
	(LAST_BND_REG): New.
	(reg_class): Add BND_REGS.
	(REG_CLASS_NAMES): Likewise.
	(REG_CLASS_CONTENTS): Likewise.
	(BND_REGNO_P): New.
	(ANY_BND_REG_P): New.
	(BNDmode): New.
	(HI_REGISTER_NAMES): Add bound registers.
	* config/i386/i386.md (UNSPEC_BNDMK): New.
	(UNSPEC_BNDMK_ADDR): New.
	(UNSPEC_BNDSTX): New.
	(UNSPEC_BNDLDX): New.
	(UNSPEC_BNDLDX_ADDR): New.
	(UNSPEC_BNDCL): New.
	(UNSPEC_BNDCU): New.
	(UNSPEC_BNDCN): New.
	(UNSPEC_MPX_FENCE): New.
	(BND0_REG): New.
	(BND1_REG): New.
	(type): Add mpxmov, mpxmk, mpxchk, mpxld, mpxst.
	(length_immediate): Likewise.
	(prefix_0f): Likewise.
	(memory): Likewise.
	(prefix_rep): Check for bnd prefix.
	(length_nobnd): New.
	(length): Use length_nobnd if specified.
	(BND): New.
	(bnd_ptr): New.
	(BNDCHECK): New.
	(bndcheck): New.
	(*jcc_1): Add bnd prefix and rename length attr to length_nobnd.
	(*jcc_2): Likewise.
	(jump): Likewise.
	(simple_return_internal): Likewise.
	(simple_return_pop_internal): Likewise.
	(*indirect_jump): Add MPX bnd prefix.
	(*tablejump_1): Likewise.
	(simple_return_internal_long): Likewise.
	(simple_return_indirect_internal): Likewise.
	(<mode>_mk): New.
	(*<mode>_mk): New.
	(mov<mode>): New.
	(*mov<mode>_internal_mpx): New.
	(<mode>_<bndcheck>): New.
	(*<mode>_<bndcheck>): New.
	(<mode>_ldx): New.
	(*<mode>_ldx): New.
	(<mode>_stx): New.
	(*<mode>_stx): New.
	* config/i386/predicates.md (lea_address_operand): Rename to...
	(address_no_seg_operand): ... this.
	(address_mpx_no_base_operand): New.
	(address_mpx_no_index_operand): New.
	(bnd_mem_operator): New.
	* config/i386/i386.opt (mmpx): New.
	* doc/invoke.texi: Add documentation for the flags -mmpx, -mno-mpx.
	* doc/rtl.texi Add documentation for BND32mode and BND64mode.

	Reverted:
	2013-10-24  Ilya Enkovich  <ilya.enkovich@intel.com>
	* mode-classes.def (MODE_POINTER_BOUNDS): New.
	* tree.def (POINTER_BOUNDS_TYPE): New.
	* genmodes.c (complete_mode): Support MODE_POINTER_BOUNDS.
	(POINTER_BOUNDS_MODE): New.
	(make_pointer_bounds_mode): New.
	* machmode.h (POINTER_BOUNDS_MODE_P): New.
	* stor-layout.c (int_mode_for_mode): Support MODE_POINTER_BOUNDS.
	(layout_type): Support POINTER_BOUNDS_TYPE.
	* tree-pretty-print.c (dump_generic_node): Support POINTER_BOUNDS_TYPE.
	* tree.c (build_int_cst_wide): Support POINTER_BOUNDS_TYPE.
	(type_contains_placeholder_1): Likewise.
	* tree.h (POINTER_BOUNDS_TYPE_P): New.
	* varasm.c (output_constant): Support POINTER_BOUNDS_TYPE.
	* doc/rtl.texi (MODE_POINTER_BOUNDS): New.

From-SVN: r205522
2013-11-29 12:12:39 +00:00
Ilya Enkovich 01156003a9 builtin-types.def (BT_FN_PTR_CONST_PTR_VAR): New.
* builtin-types.def (BT_FN_PTR_CONST_PTR_VAR): New.
        * chkp-builtins.def (BUILT_IN_CHKP_BIND_BOUNDS): New.
        * cfgexpand.c (expand_call_stmt): Expand BUILT_IN_CHKP_BIND_BOUNDS.
        * gimple.c (gimple_call_get_nobnd_arg_index): Remove.
        * gimple.h (gf_mask): Add GF_CALL_WITH_BOUNDS.
        (gimple_call_with_bounds_p): New.
        (gimple_call_set_with_bounds): New.
        (gimple_call_num_nobnd_args): Remove.
        (gimple_call_nobnd_arg): Remove.
        * tree.h (CALL_WITH_BOUNDS_P): New.
        * rtl.h (CALL_EXPR_WITH_BOUNDS_P): New.

From-SVN: r204947
2013-11-18 12:30:52 +00:00
Andrew MacLeod bdaaa1f177 expr.h: Revert change and include tree-core.h.
* expr.h: Revert change and include tree-core.h.
	* rtl.h: Revert change and don't include tree-core.h.

From-SVN: r204167
2013-10-29 16:37:01 +00:00
Andrew MacLeod 8e9055ae62 tree-outof-ssa.h: Remove include files.
* tree-outof-ssa.h: Remove include files.
	* tree-outof-ssa.c: Add required include files from tree-outof-ssa.h.
	* expr.c: Likewise.
	* tree-ssa-coalesce.c: Likewise.
	* cfgexpand.c: Likewise.
	* tree-ssa-ter.c: Likewise.
	* ipa-prop.h: Remove gimple.h and tree-core.h from include list.
	* lto-streamer.h: Likewise.
	* cgraphbuild.c: Add gimple.h to include list.
	* data-streamer-in.c: Likewise.
	* ipa-cp.c: Likewise.
	* tree-streamer.c: Likewise.
	* lto-compress.c: Likewise.
	* ipa-reference.c: Likewise.
	* data-streamer-out.c: Likewise.
	* lto-cgraph.c: Likewise.
	* cgraphclones.c: Likewise.
	* ipa-utils.c: Likewise.
	* data-streamer.c: Likewise.
	* ipa-split.c: Likewise.
	* lto-section-in.c: Likewise.
	* tree-streamer-out.c: Likewise.
	* ipa-prop.c: Likewise.
	* tree-streamer-in.c: Likewise.
	* symtab.c: Likewise.
	* opts-global.c: Likewise.
	* lto-opts.c: Likewise.
	* lto-section-out.c: Likewise.
	* lto-streamer.c: Likewise.
	* rtl.h: Add tree-core.h to include list.
	* expr.h: Remove tree-core.h from include list.
	* gimple.h: Likewise.
	* ipa-utils.h: Likewise.
	* streamer-hooks.h: Likewise.
	* streamer-hooks.c: Include input.h.

	* lto/lto-object.c: Add gimple.h to include list.
	* lto/lto-partition.c: Likewise.

From-SVN: r204158
2013-10-29 12:55:50 +00:00
Richard Sandiford c328471880 alloc-pool.c, [...]: Add missing whitespace before "(".
gcc/
	* alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c,
	bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c,
	cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c,
	cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c,
	combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h,
	cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c,
	df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c,
	dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c,
	errors.c, except.c, expmed.c, expr.c, file-find.c, final.c,
	fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c,
	gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c,
	genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c,
	genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c,
	genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c,
	gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c,
	gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c,
	gimple.h, godump.c, graphite-clast-to-gimple.c,
	graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c,
	graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c,
	hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h,
	ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c,
	ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c,
	ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c,
	loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c,
	lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c,
	mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c,
	pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c,
	predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c,
	profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c,
	regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c,
	reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c,
	sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c,
	statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h,
	system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c,
	tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c,
	tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h,
	tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c,
	tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c,
	tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c,
	tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c,
	tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c,
	tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c,
	tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c,
	tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c,
	tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c,
	tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c,
	tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c,
	tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c,
	tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c,
	tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c,
	tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c,
	tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c,
	tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c,
	tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c,
	varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing
	whitespace before "(".

From-SVN: r203004
2013-09-28 08:42:34 +00:00
Richard Sandiford e5af9ddd01 rtl.texi (REG_NOTES): Say that int_list can also be used.
gcc/
	* doc/rtl.texi (REG_NOTES): Say that int_list can also be used.
	(REG_BR_PROB): Say that the probability is stored in an int_list.
	* reg-notes.def: Update commentary to mention INT_LIST.
	* rtl.def (EXPR_LIST, INSN_LIST): Capitalize comments.
	(INT_LIST): New rtx.
	* rtl.h (add_int_reg_note, add_shallow_copy_of_reg_note): Declare.
	* rtlanal.c (int_reg_note_p): New function.
	(alloc_reg_note): Assert that the note does not have an int argument.
	(add_int_reg_note, add_shallow_copy_of_reg_note): New functions.
	* combine.c (distribute_notes): Use add_shallow_copy_of_rtx.
	* cse.c (cse_process_notes_1): Expect REG_EQUAL to be an EXPR_LIST
	rather than an INSN_LIST.  Handle INT_LIST.
	* ifcvt.c (cond_exec_process_insns): Take the probability as an int
	rather than an rtx.  Use gen_rtx_INT_LIST to create a REG_BR_PROB note.
	(cond_exec_process_if_block): Use XINT to extract REG_BR_PROB values.
	Manipulate them as ints rather than rtxes.
	* reg-stack.c (subst_asm_stack_regs): Only handle EXPR_LIST notes.
	* regmove.c (copy_src_to_dest): Likewise.
	* sched-vis.c (print_insn_with_notes): Handle INT_LIST.

	* config/i386/winnt.c (i386_pe_seh_unwind_emit): Sink pat assignment
	into the cases that need it.
	* config/arm/arm.c (arm_unwind_emit): Likewise.

	* asan.c (asan_clear_shadow): Use add_int_reg_note for REG_BR_PROB.
	* emit-rtl.c (try_split, emit_copy_of_insn_after): Likewise.
	* loop-doloop.c (add_test, doloop_modify): Likewise.
	* loop-unswitch.c (compare_and_jump_seq): Likewise.
	* optabs.c (emit_cmp_and_jump_insn_1): Likewise.
	* predict.c (combine_predictions_for_insn): Likewise.
	* print-rtl.c (print_rtx): Handle INT_LIST.
	* config/aarch64/aarch64.c (aarch64_emit_unlikely_jump): Likewise.
	* config/alpha/alpha.c (emit_unlikely_jump): Likewise.
	* config/arm/arm.c (emit_unlikely_jump): Likewise.
	* config/i386/i386.c (ix86_expand_split_stack_prologue): Likewise.
	(ix86_split_fp_branch, predict_jump): Likewise.
	* config/rs6000/rs6000.c (emit_unlikely_jump): Likewise.
	* config/sh/sh.c (expand_cbranchsi4): Likewise.
	* config/spu/spu.c (ea_load_store_inline): Likewise.

	* cfgbuild.c (compute_outgoing_frequencies): Use XINT to access the
	value of a REG_BR_PROB note.
	* cfgrtl.c (force_nonfallthru_and_redirect): Likewise.
	(update_br_prob_note, rtl_verify_edges, purge_dead_edges): Likewise.
	* emit-rtl.c (try_split): Likewise.
	* predict.c (br_prob_note_reliable_p): Likewise.
	(invert_br_probabilities, combine_predictions_for_insn): Likewise.
	* reorg.c (mostly_true_jump): Likewise.
	* config/bfin/bfin.c (cbranch_predicted_taken_p): Likewise.
	* config/frv/frv.c (frv_print_operand_jump_hint): Likewise.
	* config/i386/i386.c (ix86_print_operand): Likewise.
	* config/ia64/ia64.c (ia64_print_operand): Likewise.
	* config/mmix/mmix.c (mmix_print_operand): Likewise.
	* config/rs6000/rs6000.c (output_cbranch): Likewise.
	* config/s390/s390.c (s390_expand_tbegin): Likewise.
	* config/sh/sh.c (sh_print_operand, sh_adjust_cost): Likewise.
	* config/sparc/sparc.c (output_cbranch): Likewise.
	* config/spu/spu.c (get_branch_target): Likewise.
	* config/tilegx/tilegx.c (cbranch_predicted_p): Likewise.
	* config/tilepro/tilepro.c (cbranch_predicted_p): Likewise.

From-SVN: r202839
2013-09-23 17:41:02 +00:00
Eric Botcazou 5cf6635b26 rtl.h (update_alignments): Declare.
* rtl.h (update_alignments): Declare.
	* final.c (grow_label_align): New function extracted from...
	(shorten_branches): ...here.  Call it.
	(update_alignments): New function.
	* reorg.c (sibling_labels): New variable.
	(get_label_before): Add SIBLING parameter.  If it is non-zero, push
	the new label along with it onto the sibling_labels vector.
	(fill_simple_delay_slots): Adjust call to get_label_before.
	(fill_slots_from_thread): Likewise.
	(relax_delay_slots): Likewise.
	(make_return_insns): Likewise.
	(dbr_schedule): Invoke update_alignment on the sibling_labels vector.

From-SVN: r201575
2013-08-07 17:17:07 +00:00
Joern Rennecke bd280792f0 re PR rtl-optimization/57425 (RTL alias analysis unprepared to handle stack slot sharing)
PR rtl-optimization/57425
        PR rtl-optimization/57569
        * alias.c (write_dependence_p): Remove parameters mem_mode and
        canon_mem_addr.  Add parameters x_mode, x_addr and x_canonicalized.
        Changed all callers.
        (canon_anti_dependence): Get comments and semantics in sync.
        Add parameter mem_canonicalized.  Changed all callers.
        * rtl.h (canon_anti_dependence): Update prototype.

From-SVN: r200241
2013-06-20 13:43:29 +01:00
Joern Rennecke 393f9fedf3 re PR rtl-optimization/57425 (RTL alias analysis unprepared to handle stack slot sharing)
gcc:
	PR rtl-optimization/57425
	PR rtl-optimization/57569
	* alias.c (write_dependence_p): Add new parameters mem_size,
	canon_mem_addr and mem_canonicalized.  Change type of writep to bool.
	Changed all callers.
	(canon_anti_dependence): New function.
	* cse.c (check_dependence): Use canon_anti_dependence.
	* cselib.c (cselib_invalidate_mem): Likewise.
	* rtl.h (canon_anti_dependence): Declare.
gcc/testsuite:
	PR rtl-optimization/57425
	PR rtl-optimization/57569
	* gcc.dg/torture/pr57425-1.c, gcc.dg/torture/pr57425-2.c: New files.
	* gcc.dg/torture/pr57425-3.c, gcc.dg/torture/pr57569.c: Likewise.
Index: alias.c
===================================================================
--- alias.c	(revision 200126)

From-SVN: r200133
2013-06-16 15:59:41 +01:00
Steven Bosscher 61216c2608 rtl.h (next_label, [...]): Remove prototypes.
* rtl.h (next_label, skip_consecutive_labels, link_cc0_insns):
	Remove prototypes.
	* emit-rtl.c (next_label): Remove unused function.
	(skip_consecutive_labels, link_cc0_insns): Move to ...
	* reorg.c (skip_consecutive_labels, link_cc0_insns): ... here, the
	only place where these functions are used, and make them static.

From-SVN: r198894
2013-05-14 17:20:08 +00:00
Steven Bosscher fb0d5c60f5 mips.c: Include tree-pass.h.
* config/mips/mips.c: Include tree-pass.h.
	(mips_reorg): Split in pre- and post-dbr_schedule parts.
	(mips_machine_reorg2): Move mips_reorg post-dbr_schedule parts here.
	(pass_mips_machine_reorg2): New machine specific pass.
	(insert_pass_mips_machine_reorg2): New pass plugin definition.
	(mips_option_override): Register the new pass.
	* rtl.h (cleanup_barriers): Remove prototype.
	(dbr_schedule): Likewise.
	* jump.c (cleanup_barriers): Make static.
	* reorg.c (dbr_schedule): Likewise.

From-SVN: r198640
2013-05-06 19:02:12 +00:00
Vladimir Makarov 2c62cbaaf1 rtl.h (struct rtx_def): Add comment for field jump.
2013-04-26  Vladimir Makarov  <vmakarov@redhat.com>

	* rtl.h (struct rtx_def): Add comment for field jump.
	(LRA_SUBREG_P): New macro.
	* recog.c (register_operand): Check LRA_SUBREG_P.
	* lra.c (lra): Add note at the end of RTL code. Align non-empty
	stack frame.
	* lra-spills.c (lra_spill): Align stack after spilling pseudos.
	(lra_final_code_change): Skip subreg change for operators.
	* lra-eliminations.c (eliminate_regs_in_insn): Make return earlier
	if there are no operand changes.
	* lra-constraints.c (curr_insn_set): New.
	(match_reload): Set LRA_SUBREG_P.
	(emit_spill_move): Ditto.
	(check_and_process_move): Use curr_insn_set. Process only single
	set insns.  Don't initialize sec_mem_p and change_p.
	(simplify_operand_subreg): Use LRA_SUBREG_P.
	(reg_in_class_p): New function.
	(process_alt_operands): Use it.  Use #if HAVE_ATTR_enabled instead
	of #ifdef.  Add code to remove cycling.
	(process_address): Check EXTRA_CONSTRAINT_STR. Process even if
	non-null disp.  Reload inner instead of disp when base and index
	are null.  Try to put lo_sum into register.
	(EBB_PROBABILITY_CUTOFF): Redefine probability in percents.
	(check_and_process_move): Move code for move cost check to
	simple_move_p.  Remove equiv_substitution.
	(simple_move_p): New function.
	(curr_insn_transform): Initialize sec_mem_p and change_p.  Set up
	curr_insn_set.  Call check_and_process_move only for single set
	insns.  Use the new function.  Move call of check_and_process_move
	after operand equiv substitution and address process.

From-SVN: r198344
2013-04-26 18:11:35 +00:00
Vladimir Makarov 0ae24cc897 revert: rtl.h (struct rtx_def): ...
2013-04-24  Vladimir Makarov  <vmakarov@redhat.com>

	Revert:
	2013-04-24  Vladimir Makarov  <vmakarov@redhat.com>
	* rtl.h (struct rtx_def): ...

From-SVN: r198266
2013-04-24 22:33:06 +00:00
Vladimir Makarov f6ce35ac7c rtl.h (struct rtx_def): Add comment for field jump.
2013-04-24  Vladimir Makarov  <vmakarov@redhat.com>

        * rtl.h (struct rtx_def): Add comment for field jump.
	(LRA_SUBREG_P): New macro.
	* recog.c (register_operand): Check LRA_SUBREG_P.
	* lra.c (lra): Add note at the end of RTL code. Align non-empty
	stack frame.
	* lra-spills.c (lra_spill): Align stack after spilling pseudos.
	(lra_final_code_change): Skip subreg change for operators.
	* lra-eliminations.c (eliminate_regs_in_insn): Make return earlier
	if there are no operand changes.
	* lra-constraints.c (curr_insn_set): New.
	(match_reload): Set LRA_SUBREG_P.
	(emit_spill_move): Ditto.
	(check_and_process_move): Use curr_insn_set. Process only single
	set insns.  Don't initialize sec_mem_p and change_p.
	(simplify_operand_subreg): Use LRA_SUBREG_P.
	(reg_in_class_p): New function.
	(process_alt_operands): Use it.  Use #if HAVE_ATTR_enabled instead
	of #ifdef.  Add code to remove cycling.
	(process_address): Check EXTRA_CONSTRAINT_STR. Process even if
	non-null disp.  Reload inner instead of disp when base and index
	are null.  Try to put lo_sum into register.
	(EBB_PROBABILITY_CUTOFF): Redefine probability in percents.
        (check_and_process_move): Move code for move cost check to
	simple_move_p.  Remove equiv_substitution.
        (simple_move_p): New function.
	(curr_insn_transform): Initialize sec_mem_p and change_p.  Set up
	curr_insn_set.  Call check_and_process_move only for single set
	insns.  Use the new function.  Move call of check_and_process_move
	after operand equiv substitution and address process.

From-SVN: r198252
2013-04-24 15:45:42 +00:00
Bin Cheng ec9202a887 * rtl.h (AUTO_INC_DEC): Fix typo of HAVE_POST_MODIFY_DISP.
From-SVN: r197398
2013-04-03 10:25:08 +00:00
Steven Bosscher 397186076b cfgrtl.c (fixup_reorder_chain): Do not emit barriers to BB_FOOTER.
* cfgrtl.c (fixup_reorder_chain): Do not emit barriers to BB_FOOTER.

	* postreload-gcse.c (bb_has_well_behaved_predecessors): Correct test
	for table jump at the end of a basic block using tablejump_p.
	* targhooks.c (default_invalid_within_doloop): Likewise.
	* config/rs6000/rs6000.c (TARGET_INVALID_WITHIN_DOLOOP): Remove
	target hook implementation that is identical to the default hook.
	(rs6000_invalid_within_doloop): Remove.

	* bb-reorder.c (fix_crossing_unconditional_branches): Remove set but
	unused variable from tablejump_p call.

	* rtl.def (JUMP_TABLE_DATA): New RTX_INSN object.
	* rtl.h (RTX_PREV, RTX_NEXT): Adjust for new JUMP_TABLE_DATA.
	(INSN_DELETED_P): Likewise.
	(emit_jump_table_data): New prototype.
	* gengtype.c (adjust_field_rtx_def): Handle JUMP_TABLE_DATA fields
	after 4th as unused.
	* print-rtl.c (print_rtl): Handle JUMP_TABLE_DATA.
	* sched-vis.c (print_insn): Likewise.
	* emit-rtl.c (active_insn_p): Consider JUMP_TABLE_DATA an active
	insn for compatibility with back ends that use next_active_insn to
	identify jump table data.
	(set_insn_deleted): Remove no longer useful JUMP_TABLE_DATA_P check.
	(remove_insn): Likewise.
	(emit_insn): Do not accept JUMP_TABLE_DATA objects in insn chains
	to be emitted.
	(emit_debug_insn, emit_jump_insn, emit_call_insn, emit_label): Idem.
	(emit_jump_table_data): New function.

	* cfgbuild.c (inside_basic_block_p): A JUMP_INSN is always inside a
	basic block, a JUMP_TABLE_DATA never is.
	(control_flow_insn_p): JUMP_TABLE_DATA is not a control flow insn.
	* cfgrtl.c (duplicate_insn_chain): Split handling of JUMP_TABLE_DATA
	off from code handling real insns.
	* final.c (get_attr_length_1): Simplify for JUMP_INSNs.
	* function.c (instantiate_virtual_regs): Remove JUMP_TABLE_DATA_P
	test, now redundant because JUMP_TABLE_DATA is not an INSN_P insn.
	* gcse.c (insert_insn_end_basic_block): Likewise, JUMP_TABLE_DATA_P
	is not a NONDEBUG_INSN_P.
	* ira-costs.c (scan_one_insn): Likewise.
	* jump.c (mark_all_labels): Likewise.
	(mark_jump_label_1): Likewise.
	* lra-eliminations.c (eliminate_regs_in_insn): Likewise.
	* lra.c (get_insn_freq): Expect all insns reaching here to be in
	a basic block.
	(check_rtl): Remove JUMP_TABLE_DATA_P test, not a NONDEBUG_INSN_P insn.
	* predict.c (expensive_function_p): Use FOR_BB_INSNS.
	* reload1.c (calculate_needs_all_insns): Call set_label_offsets for
	JUMP_TABLE_DATA_P insns.
	(calculate_elim_costs_all_insns): Likewise.
	(set_label_offsets): Recurse on the PATTERN of JUMP_TABLE_DATA insns.
	(elimination_costs_in_insn): Remove redundant JUMP_TABLE_DATA_P test.
	(delete_output_reload): Code style fixups.
	* reorg.c (dbr_schedule): Move JUMP_TABLE_DATA_P up to avoid setting
	insn flags on this non-insn.
	* sched-rgn.c (add_branch_dependences): Treat JUMP_TABLE_DATA insns
	as scheduling barriers, for pre-change compatibility.
	* stmt.c (emit_case_dispatch_table): Emit jump table data not as
	JUMP_INSN objects but instead as JUMP_TABLE_DATA objects.

	* config/alpha/alpha.c (alpha_does_function_need_gp): Remove
	redundant JUMP_TABLE_DATA_P test.
	* config/arm/arm.c (thumb_far_jump_used_p): Likewise.
	* config/frv/frv.c (frv_function_contains_far_jump): Likewise.
	(frv_for_each_packet): Likewise.
	* config/i386/i386.c (min_insn_size): Likewise.
	(ix86_avoid_jump_mispredicts): Likewise.
	* config/m32r/m32r.c (m32r_is_insn): Likewise.
	* config/mep/mep.c (mep_reorg_erepeat): Likewise.
	* config/mips/mips.c (USEFUL_INSN_P): Likewise.
	(mips16_insn_length): Robustify.
	(mips_has_long_branch_p): Remove redundant JUMP_TABLE_DATA_P test.
	(mips16_split_long_branches): Likewise.
	* config/pa/pa.c (pa_combine_instructions): Likewise.
	* config/rs6000/rs6000.c (get_next_active_insn): Treat
	JUMP_TABLE_DATA objects as active insns, like in active_insn_p.
	* config/s390/s390.c (s390_chunkify_start): Treat JUMP_TABLE_DATA
	as contributing to pool range lengths.
	* config/sh/sh.c (find_barrier): Restore check for ADDR_DIFF_VEC.
	Remove redundant JUMP_TABLE_DATA_P test.
	(sh_loop_align): Likewise.
	(split_branches): Likewise.
	(sh_insn_length_adjustment): Likewise.
	* config/spu/spu.c (get_branch_target): Likewise.

From-SVN: r197266
2013-03-30 14:26:42 +00:00
Lawrence Crowl 7b3b6ae441 Add uniform debug dump function names.
Add some overloaded functions that provide uniform debug dump
function names.  These names are:

  debug: the general debug dumper
  debug_verbose: for more details
  debug_raw: for the gory details
  debug_head: for the heads of declarations, e.g. function heads
  debug_body: for the bodies of declarations, e.g. function bodies

Not all types have the last four versions.

The debug functions come in two flavors, those that take pointers
to the type, and those that take references to the type.  The first
handles printing of '<nil>' for null pointers.  The second assumes
a valid reference, and prints the content.


Example uses are as follows:

  cp_token t, *p;
  debug (t);
  debug (p);

From the debugger, use

  call debug (t)


The functions sets implemented are:

debug (only)

    basic_block_def, const bitmap_head_def, cp_binding_level,
    cp_parser, cp_token, data_reference, die_struct, edge_def,
    gimple_statement_d, ira_allocno, ira_allocno_copy, live_range,
    lra_live_range, omega_pb_d, pt_solution, const rtx_def, sreal,
    tree_live_info_d, _var_map,

    vec<cp_token, va_gc>, vec<data_reference_p>, vec<ddr_p>,
    vec<rtx>, vec<tree, va_gc>,

debug and debug_raw

    simple_bitmap_def

debug and debug_verbose

    expr_def, struct loop, vinsn_def

debug, debug_raw, debug_verbose, debug_head, debug_body

    const tree_node


This patch is somewhat different from the original plan at
gcc.gnu.org/wiki/cxx-conversion/debugging-dumps.  The reason
is that gdb has an incomplete implementation of C++ call syntax;
requiring explicit specification of template arguments and explicit
specification of function arguments even when they have default
values.  So, the original plan would have required typing

  call dump <cp_token> (t, 0, 0, stderr)

which is undesireable.  Instead instead of templates, we overload
plain functions.  This adds a small burden of manually adding
the pointer version of dump for each type.  Instead of default
function arguments, we simply assume the default values.  Most of
the underlying dump functions did not use the options and indent
parameters anyway.  Several provide FILE* parameters, but we expect
debugging to use stderr anyway.  So, the explicit specification of
arguments was not as valuable as we thought initially.  Finally,
a change of name from dump to debug reflect the implicit output
to stderr.


Index: gcc/ChangeLog

2013-03-28  Lawrence Crowl  <crowl@google.com>

	* Makefile.in: Add several missing include dependences.
	(DUMPFILE_H): New.
	(test-dump.o): New.  This object is not added to any executable,
	but is present for ad-hoc testing.
	* bitmap.c
	(debug (const bitmap_head_def &)): New.
	(debug (const bitmap_head_def *)): New.
	* bitmap.h
	(extern debug (const bitmap_head_def &)): New.
	(extern debug (const bitmap_head_def *)): New.
	* cfg.c
	(debug (edge_def &)): New.
	(debug (edge_def *)): New.
	* cfghooks.c
	(debug (basic_block_def &)): New.
	(debug (basic_block_def *)): New.
	* dumpfile.h
	(dump_node (const_tree, int, FILE *)): Correct source file.
	* dwarf2out.c
	(debug (die_struct &)): New.
	(debug (die_struct *)): New.
	* dwarf2out.h
	(extern debug (die_struct &)): New.
	(extern debug (die_struct *)): New.
	* gimple-pretty-print.c
	(debug (gimple_statement_d &)): New.
	(debug (gimple_statement_d *)): New.
	* gimple-pretty-print.h
	(extern debug (gimple_statement_d &)): New.
	(extern debug (gimple_statement_d *)): New.
	* ira-build.c
	(debug (ira_allocno_copy &)): New.
	(debug (ira_allocno_copy *)): New.
	(debug (ira_allocno &)): New.
	(debug (ira_allocno *)): New.
	* ira-int.h
	(extern debug (ira_allocno_copy &)): New.
	(extern debug (ira_allocno_copy *)): New.
	(extern debug (ira_allocno &)): New.
	(extern debug (ira_allocno *)): New.
	* ira-lives.c
	(debug (live_range &)): New.
	(debug (live_range *)): New.
	* lra-int.h
	(debug (lra_live_range &)): New.
	(debug (lra_live_range *)): New.
	* lra-lives.c
	(debug (lra_live_range &)): New.
	(debug (lra_live_range *)): New.
	* omega.c
	(debug (omega_pb_d &)): New.
	(debug (omega_pb_d *)): New.
	* omega.h
	(extern debug (omega_pb_d &)): New.
	(extern debug (omega_pb_d *)): New.
	* print-rtl.c
	(debug (const rtx_def &)): New.
	(debug (const rtx_def *)): New.
	* print-tree.c
	(debug_tree (tree): Move within file.
	(debug_raw (const tree_node &)): New.
	(debug_raw (const tree_node *)): New.
	(dump_tree_via_hooks (const tree_node *, int)): New.
	(debug (const tree_node &)): New.
	(debug (const tree_node *)): New.
	(debug_verbose (const tree_node &)): New.
	(debug_verbose (const tree_node *)): New.
	(debug_head (const tree_node &)): New.
	(debug_head (const tree_node *)): New.
	(debug_body (const tree_node &)): New.
	(debug_body (const tree_node *)): New.
	(debug_vec_tree (tree): Move and reimplement in terms of dump.
	(debug (vec<tree, va_gc> &)): New.
	(debug (vec<tree, va_gc> *)): New.
	* rtl.h
	(extern debug (const rtx_def &)): New.
	(extern debug (const rtx_def *)): New.
	* sbitmap.c
	(debug_raw (simple_bitmap_def &)): New.
	(debug_raw (simple_bitmap_def *)): New.
	(debug (simple_bitmap_def &)): New.
	(debug (simple_bitmap_def *)): New.
	* sbitmap.h
	(extern debug (simple_bitmap_def &)): New.
	(extern debug (simple_bitmap_def *)): New.
	(extern debug_raw (simple_bitmap_def &)): New.
	(extern debug_raw (simple_bitmap_def *)): New.
	* sel-sched-dump.c
	(debug (vinsn_def &)): New.
	(debug (vinsn_def *)): New.
	(debug_verbose (vinsn_def &)): New.
	(debug_verbose (vinsn_def *)): New.
	(debug (expr_def &)): New.
	(debug (expr_def *)): New.
	(debug_verbose (expr_def &)): New.
	(debug_verbose (expr_def *)): New.
	(debug (vec<rtx> &)): New.
	(debug (vec<rtx> *)): New.
	* sel-sched-dump.h
	(extern debug (vinsn_def &)): New.
	(extern debug (vinsn_def *)): New.
	(extern debug_verbose (vinsn_def &)): New.
	(extern debug_verbose (vinsn_def *)): New.
	(extern debug (expr_def &)): New.
	(extern debug (expr_def *)): New.
	(extern debug_verbose (expr_def &)): New.
	(extern debug_verbose (expr_def *)): New.
	(extern debug (vec<rtx> &)): New.
	(extern debug (vec<rtx> *)): New.
	* sel-sched-ir.h
	(_list_iter_cond_expr): Make inline instead of static.
	* sreal.c
	(debug (sreal &)): New.
	(debug (sreal *)): New.
	* sreal.h
	(extern debug (sreal &)): New.
	(extern debug (sreal *)): New.
	* tree.h
	(extern debug_raw (const tree_node &)): New.
	(extern debug_raw (const tree_node *)): New.
	(extern debug (const tree_node &)): New.
	(extern debug (const tree_node *)): New.
	(extern debug_verbose (const tree_node &)): New.
	(extern debug_verbose (const tree_node *)): New.
	(extern debug_head (const tree_node &)): New.
	(extern debug_head (const tree_node *)): New.
	(extern debug_body (const tree_node &)): New.
	(extern debug_body (const tree_node *)): New.
	(extern debug (vec<tree, va_gc> &)): New.
	(extern debug (vec<tree, va_gc> *)): New.
	* tree-cfg.c
	(debug (struct loop &)): New.
	(debug (struct loop *)): New.
	(debug_verbose (struct loop &)): New.
	(debug_verbose (struct loop *)): New.
	* tree-dump.c: Add header dependence.
	* tree-flow.h
	(extern debug (struct loop &)): New.
	(extern debug (struct loop *)): New.
	(extern debug_verbose (struct loop &)): New.
	(extern debug_verbose (struct loop *)): New.
	* tree-data-ref.c
	(debug (data_reference &)): New.
	(debug (data_reference *)): New.
	(debug (vec<data_reference_p> &)): New.
	(debug (vec<data_reference_p> *)): New.
	(debug (vec<ddr_p> &)): New.
	(debug (vec<ddr_p> *)): New.
	* tree-data-ref.h
	(extern debug (data_reference &)): New.
	(extern debug (data_reference *)): New.
	(extern debug (vec<data_reference_p> &)): New.
	(extern debug (vec<data_reference_p> *)): New.
	(extern debug (vec<ddr_p> &)): New.
	(extern debug (vec<ddr_p> *)): New.
	* tree-ssa-alias.c
	(debug (pt_solution &)): New.
	(debug (pt_solution *)): New.
	* tree-ssa-alias.h
	(extern debug (pt_solution &)): New.
	(extern debug (pt_solution *)): New.
	* tree-ssa-alias.c
	(debug (_var_map &)): New.
	(debug (_var_map *)): New.
	(debug (tree_live_info_d &)): New.
	(debug (tree_live_info_d *)): New.
	* tree-ssa-alias.h
	(extern debug (_var_map &)): New.
	(extern debug (_var_map *)): New.
	(extern debug (tree_live_info_d &)): New.
	(extern debug (tree_live_info_d *)): New.

Index: gcc/cp/ChangeLog

2013-03-28  Lawrence Crowl  <crowl@google.com>

	* Make-lang.in
	(CXX_PARSER_H): Add header dependence.
	* cp-tree.h
	(extern debug (cp_binding_level &)): New.
	(extern debug (cp_binding_level *)): New.
	* name-lookup.h
	(debug (cp_binding_level &)): New.
	(debug (cp_binding_level *)): New.
	* parser.c
	(debug (cp_parser &)): New.
	(debug (cp_parser *)): New.
	(debug (cp_token &)): New.
	(debug (cp_token *)): New.
	(debug (vec<cp_token, va_gc> &)): New.
	(debug (vec<cp_token, va_gc> *)): New.
	* parser.c: Add header dependence.
	(extern debug (cp_parser &)): New.
	(extern debug (cp_parser *)): New.
	(extern debug (cp_token &)): New.
	(extern debug (cp_token *)): New.
	(extern debug (vec<cp_token, va_gc> &)): New.
	(extern debug (vec<cp_token, va_gc> *)): New.

From-SVN: r197224
2013-03-29 03:42:21 +00:00
Steven Bosscher b64925dc4b avr.c, [...]: Where applicable...
* config/avr/avr.c, config/bfin/bfin.c, config/c6x/c6x.c,
	config/epiphany/epiphany.c, config/frv/frv.c, config/ia64/ia64.c,
	config/iq2000/iq2000.c, config/mcore/mcore.c, config/mep/mep.c,
	config/mmix/mmix.c, config/pa/pa.c, config/rs6000/rs6000.c,
	config/s390/s390.c, config/sparc/sparc.c, config/spu/spu.c,
	config/stormy16/stormy16.c, config/v850/v850.c, config/xtensa/xtensa.c,
	dwarf2out.c, hw-doloop.c, resource.c, rtl.h : Where applicable, use
	the predicates NOTE_P, NONJUMP_INSN_P, JUMP_P, CALL_P, LABEL_P, and
	BARRIER_P instead of GET_CODE.

From-SVN: r197005
2013-03-23 12:11:10 +00:00
Richard Sandiford d1e082c2c2 Update copyright years in gcc/
From-SVN: r195098
2013-01-10 20:38:27 +00:00
Steve Ellcey 2cd45f0e68 re PR target/54061 (gcc.c-torture/compile/mipscop-*.c ICEs with -g)
2012-12-10  Steve Ellcey  <sellcey@mips.com>

	PR target/54061
	rtl.h (IGNORED_DWARF_REGNUM): New.
	* dwarf2out.c (reg_loc_descriptor): Check for IGNORED_DWARF_REGNUM.
	(mem_loc_descriptor): Ditto.
	* config/mips/mips.h (ALL_COP_REG_FIRST): New.
	(ALL_COP_REG_LAST): New.
	(ALL_COP_REG_NUM): Redefine using above macros.
	* config/mips/mips.c (mips_option_override): Set mips_dbx_regno
	coprocessor entries to IGNORED_DWARF_REGNUM.

From-SVN: r194372
2012-12-10 22:19:16 +00:00
Steven Bosscher 2c895bd193 rtl.h (print_insn_with_notes): Remove prototype.
* rtl.h (print_insn_with_notes): Remove prototype.
	(rtl_dump_bb_for_graph): New prototype.
	* sched-vis.c (print_insn_with_notes): Make static again.  Fix
	printing of notes.
	(rtl_dump_bb_for_graph): New function.
	* cfghooks.h (struct cfg_hooks) <dump_bb_for_graph>: New hook.
	(dump_bb_for_graph): New prototype.
	* cfghooks.c (dump_bb_for_graph): New function.
	* tree-cfg.c (gimple_cfg_hooks): Register gimple_dump_bb_for_graph
	as dump_bb_for_graph hook implementation for GIMPLE.
	* cfgrtl.c (rtl_cfg_hooks): Likewise for rtl_dump_bb_for_graph.
	(cfg_layout_rtl_cfg_hooks): Likewise.
	* graph.c (draw_cfg_node): Don't include sbitmap.h, rtl.h, tree.h,
	gimple.h, and gimple-pretty-print.h.
	(draw_cfg_node, draw_cfg_node_succ_edges): Use the uniqe function
	definition number instead of the function declaration UID.
	(print_graph_cfg): Take a struct function instead of a tree.
	Use the dump_bb_for_graph hook to dump the basic block content.
	* graph.h (print_graph_cfg): Update prototype.
	* passes.c (execute_function_dump): Update print_graph_cfg call.
	* Makefile.in (graph.o): Fixup dependencies.

From-SVN: r194157
2012-12-04 18:38:26 +00:00
Steven Bosscher 41222ddf8e rtl.h (print_insn_with_notes): Prototype.
* rtl.h (print_insn_with_notes): Prototype.
	* sched-vis.c (print_insn_with_notes): Export it.

	* gimple-pretty-print.h (gimple_dump_bb_for_graph): Prototype.
	* gimple-pretty-print.c (print_gimple_expr): Flush the buffer.
	(pp_gimple_stmt_1): Don't do it here.
	(gimple_dump_bb_for_graph): New function.
	* tree-pretty-print.c (print_generic_expr): Flush the buffer here.
	(dump_generic_node): Don't flush the buffer here.

	* graph.h (print_rtl_graph_with_bb): Rename to print_graph_cfg.
	* graph.c: Include gimple.h, dumpfile.h, and gimple-pretty-print.h.
	(draw_cfg_node): Handle GIMPLE basic blocks also.
	(print_rtl_graph_with_bb): Rename to print_graph_cfg.
	* passes.c (finish_optimization_passes): Don't finish graph dumps here.
	(execute_function_dump): Use print_graph_cfg. Enable dumping the CFG
	for GIMPLE also.
	(pass_init_dump_file): Wrap in TV_DUMP.  Set up CFG graph dumps.
	(pass_fini_dump_file): Wrap in TV_DUMP.  Finish graph dumps.
	(execute_one_pass): Don't set up graph dumps here.

From-SVN: r194085
2012-12-03 13:16:55 +00:00
Steven Bosscher 7eba871a24 coretypes.h (struct pretty_print_info): Make a coretype.
* coretypes.h (struct pretty_print_info): Make a coretype.
	(typedef pretty_printer): Likewise.
	* pretty-print.h (typedef pretty_printer): Not needed here anymore.
	* pretty-print.c (pp_write_text_as_dot_label_to_stream): New function.
	* rtl.h (str_pattern_slim): New prototype.
	(print_value, print_pattern, print_insn): Adjust prototypes to take
	a pretty-printer rather than a char buffer.
	* sched-vis.c (safe_concat): Remove.
	(print_exp): Print into a pretty-printer.
	(print_value): Likewise.
	(print_pattern): Likewise.
	(print_insn): Likewise.
	(print_insn_with_notes): New static function.
	(init_rtl_slim_pretty_print): New function.
	(dump_value_slim): Simplify.  Print into and flush a pretty-printer.
	(dump_insn_slim): Likewise.
	(dump_rtl_slim): Likewise.
	(str_pattern_slim): New function.
	* haifa-sched.c (model_recompute): Use str_pattern_slim instead of
	static buffers.
	(model_record_pressures): Likewise.
	(schedule_insn): Likewise.
	* sel-sched-dump.c (dump_insn_rtx_1): Likewise.
	(sel_prepare_string_for_dot_label): Refer to graph.c CFG dumper code.
	* graph.c: Include pretty-print.h.
	(init_graph_slim_pretty_print): New function.
	(print_escaped_line): Removed here, and reincarnated as
	pp_write_text_as_dot_label_to_stream.
	(draw_cfg_node): Print into a pretty printer.
	(draw_cfg_node_succ_edges): Likewise.
	(print_rtl_graph_with_bb): Likewise.
	* Makefile.in (graph.o): Fix dependencies.
	(tree-optimize.o, toplev.o, sched-vis.o): Likewise.

From-SVN: r193990
2012-11-30 09:46:02 +00:00
Steven Bosscher cfbeaedfdd rtl.h (debug_bb_n_slim, [...]): Remove prototypes.
* rtl.h (debug_bb_n_slim, debug_bb_slim, debug_insn_slim): Remove
	prototypes.
	(debug_rtl_slim): Rename to dump_rtl_slim.
	(print_value_slim): Rename to dump_value_slim.
	* ira.c (ira_update_equiv_info_by_shuffle_insn): Update
	print_value_slim user.
	* lra.c (lra_process_new_insns): Use dump_insn_slim to dump single
	insns.  Use dump_rtl_slim for insn chains.
	* lra-constraints.c (get_reload_reg): Update print_value_slim user.
	(process_addr_reg): Likewise.
	(equiv_address_substitution): Likewise.
	(inherit_reload_reg): Likewise.  Use dump_insn_slim to dump single
	insns.
	(check_and_process_move): Likewise.
	(lra_constraints): Likewise.
	(split_reg): Likewise.
	(update_ebb_live_info): Likewise.
	(remove_inheritance_pseudos): Likewise.
	* sched-vis.c: Don't include sched-int.h.
	Remove #ifdef INSN_SCHEDULING tests.
	(print_value_slim): Rename to dump_value_slim.  Simplify a few
	cases using GET_RTX_NAME.
	(print_pattern): Do not handle UNSPEC and UNSPECV here, explain why.
	(print_insn): Reorganize code to be independent of INSN_SCHEDULING.
	Always print CALL_INSN patterns.  Harmonize INSN_UID dumping template.
	Handle NOTE_INSN_CALL_ARG_LOCATION.
	(dump_rtl_slim): Copied from debug_rtl_slim.
	(debug_rtl_slim): Wrapper around dump_rtl_slim to stderr.
	* haifa-sched.c (schedule_insn): Update print_insn user.

From-SVN: r193873
2012-11-27 22:26:15 +00:00
Steven Bosscher a27a5de969 invoke.texi: Remove -dv documentation.
gcc/
	* doc/invoke.texi: Remove -dv documentation.  Fix up graph dump related
	documentation.  Document the '-graph' dump option.  Complete the '-slim'
	dump option documentation.

	* common.opt (Variable graph_dump_format): Remove.
	* flag-types.h (enum graph_dump_types): Remove.
	* flags.h (dump_for_graph): Remove.
	* opts.c (decode_d_option): Remove -dv handling.
	* sched-int.h (print_insn, print_pattern, print_value): Move prototypes
	from here ...
	* rtl.h: ...to here.  Add note that these functions ought to be in
	another file.
	* sched-vis.c (print_insn): Add detailed dump for insn notes.
	* print-rtl.c (dump_for_graph): Remove.
	(print_rtx): Remove dump_for_graph related code.
	* graph.c: Almost complete re-write to dump DOT (GraphViz) dumps
	instead of VCG dumps.
	* graph.h (print_rtl_graph_with_bb): Update prototype.
	* passes.c (finish_optimization_passes): Fix profile dump finishing.
	Unconditionally loop over graph dumps to finalize.
	(execute_function_dump): Split code to dump graphs to separate block.
	(execute_one_pass): Don't set TDF_GRAPH here, let the dump option
	decoders do their job.

	* ddg.c (vcg_print_ddg): Make it a DEBUG_FUNCTION.
	* toplev.c: Don't include graph.h.
	* tree-optimize.c: Don't include graph.h.

testsuite/
	* testsuite/gcc.dg/20050811-1.c: Change -dv option to -graph option
	to -fdump-rtl-all.
	* testsuite/gcc.dg/pr37858.c: Remove -dv option.

From-SVN: r193821
2012-11-26 16:47:58 +00:00
Diego Novillo 9771b26396 This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'.
This patch rewrites the old VEC macro-based interface into a new one
based on the template class 'vec'.  The user-visible changes are
described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec.

I have tested the patch pretty extensively:

- Regular bootstraps on x86_64, ppc, ia64, sparc and hppa.
- Bootstraps with --enable-checking=release
- Bootstraps with --enable-checking=gc,gcac
- Basic builds on all targets (using contrib/config-list.mk).

We no longer access the vectors via VEC_* macros.  The pattern is
"VEC_operation (T, A, V, args)" becomes "V.operation (args)".

The only thing I could not do is create proper ctors and dtors for the
vec class.  Since these vectors are stored in unions, we
have to keep them as PODs (C++03 does not allow non-PODs in unions).

This means that creation and destruction must be explicit.  There is a
new method vec<type, allocation, layout>::create() and another vec<type,
allocation, layout>::destroy() to allocate the internal vector.

For vectors that must be pointers, there is a family of free functions
that implement the operations that need to tolerate NULL vectors.
These functions all start with the prefix 'vec_safe_'.  See the wiki
page for details.

The gengtype change removes the special handling for VEC() that used
to exist in gengtype. Additionally, it allows gengtype to recognize
templates of more than one argument and introduces the concept of an
undefined type (useful for template arguments that may or may not be
types).

When a TYPE_UNDEFINED is reached, gengtype will ignore it if it
happens inside a type marked with GTY((user)).  Otherwise, it will
emit an error.

Finally, gengtype rejects root types marked GTY((user)) that are not
first class pointers.

2012-11-16  Diego Novillo  <dnovillo@google.com>

	VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec)

	* vec.c (register_overhead): Convert it into
	member function of vec_prefix.
	(release_overhead): Likewise.
	(calculate_allocation): Likewise.
	(vec_heap_free): Remove.
	(vec_gc_o_reserve_1): Remove.
	(vec_heap_o_reserve_1): Remove.
	(vec_stack_o_reserve_1): Remove.
	(vec_stack_o_reserve_exact): Remove.
	(register_stack_vec): New.
	(stack_vec_register_index): New.
	(unregister_stack_vec): New.
	(vec_assert_fail): Remove.
	* vec.h: Conditionally include ggc.h.  Document conditional
	hackery.
	Update top-level documentation.
	(ALONE_VEC_CHECK_INFO): Remove.
	(VEC_CHECK_INFO): Remove.
	(ALONE_VEC_CHECK_DECL): Remove.
	(VEC_CHECK_DECL): Remove.
	(ALONE_VEC_CHECK_PASS): Remove.
	(VEC_CHECK_PASS): Remove.
	(VEC_ASSERT): Remove.
	(vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and
	va_stack.
	Mark fields alloc_ and num_ as protected.
	(struct vec_t): Remove.  Remove all function members.
	(struct vl_embed): Declare.
	(struct vl_ptr): Declare.
	(free): Remove.
	(reserve_exact): Remove.
	(reserve): Remove.
	(safe_splice): Remove.
	(safe_push): Remove.
	(safe_grow): Remove.
	(safe_grow_cleared): Remove.
	(safe_insert): Remove.
	(DEF_VEC_I): Remove.
	(DEF_VEC_ALLOC_I): Remove.
	(DEF_VEC_P): Remove.
	(DEF_VEC_ALLOC_P): Remove.
	(DEF_VEC_O): Remove.
	(DEF_VEC_ALLOC_O): Remove.
	(DEF_VEC_ALLOC_P_STACK): Remove.
	(DEF_VEC_ALLOC_O_STACK): Remove.
	(DEF_VEC_ALLOC_I_STACK): Remove.
	(DEF_VEC_A): Remove.
	(DEF_VEC_ALLOC_A): Remove.
	(vec_stack_p_reserve_exact_1): Remove.
	(vec_stack_o_reserve): Remove.
	(vec_stack_o_reserve_exact): Remove.
	(VEC_length): Remove.
	(VEC_empty): Remove.
	(VEC_address): Remove.
	(vec_address): Remove.
	(VEC_last): Remove.
	(VEC_index): Remove.
	(VEC_iterate): Remove.
	(VEC_embedded_size): Remove.
	(VEC_embedded_init): Remove.
	(VEC_free): Remove.
	(VEC_copy): Remove.
	(VEC_space): Remove.
	(VEC_reserve): Remove.
	(VEC_reserve_exact): Remove.
	(VEC_splice): Remove.
	(VEC_safe_splice): Remove.
	(VEC_quick_push): Remove.
	(VEC_safe_push): Remove.
	(VEC_pop): Remove.
	(VEC_truncate): Remove.
	(VEC_safe_grow): Remove.
	(VEC_replace): Remove.
	(VEC_quick_insert): Remove.
	(VEC_safe_insert): Remove.
	(VEC_ordered_remove): Remove.
	(VEC_unordered_remove): Remove.
	(VEC_block_remove): Remove.
	(VEC_lower_bound): Remove.
	(VEC_alloc): Remove.
	(VEC_qsort): Remove.

	(va_heap): Declare.
	(va_heap::default_layout): New typedef to vl_ptr.
	(va_heap::reserve): New.
	(va_heap::release): New.
	(va_gc): Declare.
	(va_gc::default_layout): New typedef to vl_embed.
	(va_gc::reserve): New.
	(va_gc::release): New.
	(va_gc_atomic): Declare.  Inherit from va_gc.
	(va_stack): Declare.
	(va_stack::default_layout): New typedef to vl_ptr.
	(va_stack::alloc): New.
	(va_stack::reserve): New.
	(va_stack::release): New.
	(register_stack_vec): Declare.
	(stack_vec_register_index): Declare.
	(unregister_stack_vec): Declare.

	(vec<T, A = va_heap, L = typename A::default_layout>): Declare
	empty vec template.
	(vec<T, A, vl_embed>): Partial specialization for embedded
	layout.
	(vec<T, A, vl_embed>::allocated): New.
	(vec<T, A, vl_embed>::length): New.
	(vec<T, A, vl_embed>::is_empty): New.
	(vec<T, A, vl_embed>::address): New.
	(vec<T, A, vl_embed>::operator[]): New.
	(vec<T, A, vl_embed>::last New.
	(vec<T, A, vl_embed>::space): New.
	(vec<T, A, vl_embed>::iterate): New.
	(vec<T, A, vl_embed>::iterate): New.
	(vec<T, A, vl_embed>::copy): New.
	(vec<T, A, vl_embed>::splice): New.
	(vec<T, A, vl_embed>::quick_push New.
	(vec<T, A, vl_embed>::pop New.
	(vec<T, A, vl_embed>::truncate): New.
	(vec<T, A, vl_embed>::quick_insert): New.
	(vec<T, A, vl_embed>::ordered_remove): New.
	(vec<T, A, vl_embed>::unordered_remove): New.
	(vec<T, A, vl_embed>::block_remove): New.
	(vec<T, A, vl_embed>::qsort): New.
	(vec<T, A, vl_embed>::lower_bound): New.
	(vec<T, A, vl_embed>::embedded_size): New.
	(vec<T, A, vl_embed>::embedded_init): New.
	(vec<T, A, vl_embed>::quick_grow): New.
	(vec<T, A, vl_embed>::quick_grow_cleared): New.
	(vec_safe_space): New.
	(vec_safe_length): New.
	(vec_safe_address): New.
	(vec_safe_is_empty): New.
	(vec_safe_reserve): New.
	(vec_safe_reserve_exact): New.
	(vec_alloc): New.
	(vec_free): New.
	(vec_safe_grow): New.
	(vec_safe_grow_cleared): New.
	(vec_safe_iterate): New.
	(vec_safe_push): New.
	(vec_safe_insert): New.
	(vec_safe_truncate): New.
	(vec_safe_copy): New.
	(vec_safe_splice): New.

	(vec<T, A, vl_ptr>): New partial specialization for the space
	efficient layout.
	(vec<T, A, vl_ptr>::exists): New.
	(vec<T, A, vl_ptr>::is_empty): New.
	(vec<T, A, vl_ptr>::length): New.
	(vec<T, A, vl_ptr>::address): New.
	(vec<T, A, vl_ptr>::operator[]): New.
	(vec<T, A, vl_ptr>::operator!=): New.
	(vec<T, A, vl_ptr>::operator==): New.
	(vec<T, A, vl_ptr>::last): New.
	(vec<T, A, vl_ptr>::space): New.
	(vec<T, A, vl_ptr>::iterate): New.
	(vec<T, A, vl_ptr>::copy): New.
	(vec<T, A, vl_ptr>::reserve): New.
	(vec<T, A, vl_ptr>::reserve_exact): New.
	(vec<T, A, vl_ptr>::splice): New.
	(vec<T, A, vl_ptr>::safe_splice): New.
	(vec<T, A, vl_ptr>::quick_push): New.
	(vec<T, A, vl_ptr>::safe_push): New.
	(vec<T, A, vl_ptr>::pop): New.
	(vec<T, A, vl_ptr>::truncate): New.
	(vec<T, A, vl_ptr>::safe_grow): New.
	(vec<T, A, vl_ptr>::safe_grow_cleared): New.
	(vec<T, A, vl_ptr>::quick_grow): New.
	(vec<T, A, vl_ptr>::quick_grow_cleared): New.
	(vec<T, A, vl_ptr>::quick_insert): New.
	(vec<T, A, vl_ptr>::safe_insert): New.
	(vec<T, A, vl_ptr>::ordered_remove): New.
	(vec<T, A, vl_ptr>::unordered_remove): New.
	(vec<T, A, vl_ptr>::block_remove): New.
	(vec<T, A, vl_ptr>::qsort): New.
	(vec<T, A, vl_ptr>::lower_bound): New.
	(vec_stack_alloc): Define.
	(FOR_EACH_VEC_SAFE_ELT): Define.
	* vecir.h: Remove.  Update all users.
	* vecprim.h: Remove.  Update all users.
	Move uchar to coretypes.h.

	* Makefile.in (VEC_H): Add $(GGC_H).
	Remove vecir.h and vecprim.h dependencies everywhere.

2012-11-16  Diego Novillo  <dnovillo@google.com>

	* gengtype-lex.l (VEC): Remove.
	Add characters in the set [\!\>\.-].
	* gengtype-parse.c (token_names): Remove "VEC".
	(require_template_declaration): Remove handling of VEC_TOKEN.
	(type): Likewise.
	Call create_user_defined_type when parsing GTY((user)).
	* gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED.
	(write_state_undefined_type): New.
	(write_state_type): Call write_state_undefined_type for
	TYPE_UNDEFINED.
	(read_state_type): Call read_state_undefined_type for
	TYPE_UNDEFINED.
	* gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED.
	(create_user_defined_type): Make extern.
	(type_for_name): Factor out of resolve_typedef.
	(create_undefined_type): New
	(resolve_typedef): Call it when we cannot find a previous
	typedef and the type is not a template.
	(find_structure): Accept TYPE_UNDEFINED.
	(set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES,
	default to false.
	Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or
	ALLOWED_UNDEFINED_TYPES is set.
	Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT.
	(filter_type_name): Accept templates with more than one
	argument.
	(output_mangled_typename): Handle TYPE_UNDEFINED
	(walk_type): Likewise.
	(write_types_process_field): Likewise.
	(write_func_for_structure): If CHAIN_NEXT is set, ORIG_S
	should not be a user-defined type.
	(write_types_local_user_process_field): Handle TYPE_ARRAY,
	TYPE_NONE and TYPE_UNDEFINED.
	(write_types_local_process_field): Likewise.
	(contains_scalar_p): Return 0 for TYPE_USER_STRUCT.
	(write_root): Reject user-defined types that are not pointers.
	Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT
	and TYPE_PARAM_STRUCT.
	(output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and
	TYPE_ARRAY.
	(dump_typekind): Handle TYPE_UNDEFINED.
	* gengtype.h (enum typekind): Add TYPE_UNDEFINED.
	(create_user_defined_type): Declare.
	(enum gty_token): Remove VEC_TOKEN.

2012-11-16  Diego Novillo  <dnovillo@google.com>

	Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec)

	* coretypes.h (uchar): Define.
	* alias.c: Use new vec API in vec.h.
	* asan.c: Likewise.
	* attribs.c: Likewise.
	* basic-block.h: Likewise.
	* bb-reorder.c: Likewise.
	* builtins.c: Likewise.
	* calls.c: Likewise.
	* cfg.c: Likewise.
	* cfganal.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfgexpand.c: Likewise.
	* cfghooks.c: Likewise.
	* cfghooks.h: Likewise.
	* cfgloop.c: Likewise.
	* cfgloop.h: Likewise.
	* cfgloopanal.c: Likewise.
	* cfgloopmanip.c: Likewise.
	* cfgrtl.c: Likewise.
	* cgraph.c: Likewise.
	* cgraph.h: Likewise.
	* cgraphclones.c: Likewise.
	* cgraphunit.c: Likewise.
	* combine.c: Likewise.
	* compare-elim.c: Likewise.
	* coverage.c: Likewise.
	* cprop.c: Likewise.
	* data-streamer.h: Likewise.
	* dbxout.c: Likewise.
	* dce.c: Likewise.
	* df-core.c: Likewise.
	* df-problems.c: Likewise.
	* df-scan.c: Likewise.
	* dominance.c: Likewise.
	* domwalk.c: Likewise.
	* domwalk.h: Likewise.
	* dse.c: Likewise.
	* dwarf2cfi.c: Likewise.
	* dwarf2out.c: Likewise.
	* dwarf2out.h: Likewise.
	* emit-rtl.c: Likewise.
	* except.c: Likewise.
	* except.h: Likewise.
	* expr.c: Likewise.
	* expr.h: Likewise.
	* final.c: Likewise.
	* fold-const.c: Likewise.
	* function.c: Likewise.
	* function.h: Likewise.
	* fwprop.c: Likewise.
	* gcc.c: Likewise.
	* gcse.c: Likewise.
	* genattr.c: Likewise.
	* genattrtab.c: Likewise.
	* genautomata.c: Likewise.
	* genextract.c: Likewise.
	* genopinit.c: Likewise
	* ggc-common.c: Likewise.
	* ggc.h: Likewise.
	* gimple-low.c: Likewise.
	* gimple-ssa-strength-reduction.c: Likewise.
	* gimple-streamer-in.c: Likewise.
	* gimple.c: Likewise.
	* gimple.h: Likewise.
	* gimplify.c: Likewise.
	* graph.c: Likewise.
	* graphds.c: Likewise.
	* graphds.h: Likewise.
	* graphite-blocking.c: Likewise.
	* graphite-clast-to-gimple.c: Likewise.
	* graphite-dependences.c: Likewise.
	* graphite-interchange.c: Likewise.
	* graphite-optimize-isl.c: Likewise.
	* graphite-poly.c: Likewise.
	* graphite-poly.h: Likewise.
	* graphite-scop-detection.c: Likewise.
	* graphite-scop-detection.h: Likewise.
	* graphite-sese-to-poly.c: Likewise.
	* graphite.c: Likewise.
	* godump.c: Likewise.
	* haifa-sched.c: Likewise.
	* hw-doloop.c: Likewise.
	* hw-doloop.h: Likewise.
	* ifcvt.c: Likewise.
	* insn-addr.h: Likewise.
	* ipa-cp.c: Likewise.
	* ipa-inline-analysis.c: Likewise.
	* ipa-inline-transform.c: Likewise.
	* ipa-inline.c: Likewise.
	* ipa-inline.h: Likewise.
	* ipa-prop.c: Likewise.
	* ipa-prop.h: Likewise.
	* ipa-pure-const.c: Likewise.
	* ipa-ref-inline.h: Likewise.
	* ipa-ref.c: Likewise.
	* ipa-ref.h: Likewise.
	* ipa-reference.c: Likewise.
	* ipa-split.c: Likewise.
	* ipa-utils.c: Likewise.
	* ipa-utils.h: Likewise.
	* ipa.c: Likewise.
	* ira-build.c: Likewise.
	* ira-color.c: Likewise.
	* ira-emit.c: Likewise.
	* ira-int.h: Likewise.
	* ira.c: Likewise.
	* loop-invariant.c: Likewise.
	* loop-unroll.c: Likewise.
	* lower-subreg.c: Likewise.
	* lra-lives.c: Likewise.
	* lra.c: Likewise.
	* lto-cgraph.c: Likewise.
	* lto-section-out.c: Likewise.
	* lto-streamer-in.c: Likewise.
	* lto-streamer-out.c: Likewise.
	* lto-streamer.h: Likewise.
	* lto-symtab.c: Likewise.
	* mcf.c: Likewise.
	* modulo-sched.c: Likewise.
	* omp-low.c: Likewise.
	* opts-common.c: Likewise.
	* opts-global.c: Likewise.
	* opts.c: Likewise.
	* opts.h: Likewise.
	* passes.c: Likewise.
	* predict.c: Likewise.
	* print-tree.c: Likewise.
	* profile.c: Likewise.
	* profile.h: Likewise.
	* read-rtl.c: Likewise.
	* ree.c: Likewise.
	* reg-stack.c: Likewise.
	* regrename.c: Likewise.
	* regrename.h: Likewise.
	* reload.c: Likewise.
	* reload.h: Likewise.
	* reload1.c: Likewise.
	* rtl.h: Likewise.
	* sched-deps.c: Likewise.
	* sched-int.h: Likewise.
	* sdbout.c: Likewise.
	* sel-sched-dump.c: Likewise.
	* sel-sched-ir.c: Likewise.
	* sel-sched-ir.h: Likewise.
	* sel-sched.c: Likewise.
	* sese.c: Likewise.
	* sese.h: Likewise.
	* statistics.h: Likewise.
	* stmt.c: Likewise.
	* stor-layout.c: Likewise.
	* store-motion.c: Likewise.
	* tlink.c: Likewise.
	* toplev.c: Likewise.
	* trans-mem.c: Likewise.
	* tree-browser.c: Likewise.
	* tree-call-cdce.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-cfgcleanup.c: Likewise.
	* tree-chrec.c: Likewise.
	* tree-chrec.h: Likewise.
	* tree-complex.c: Likewise.
	* tree-data-ref.c: Likewise.
	* tree-data-ref.h: Likewise.
	* tree-dfa.c: Likewise.
	* tree-diagnostic.c: Likewise.
	* tree-dump.c: Likewise.
	* tree-eh.c: Likewise.
	* tree-emutls.c: Likewise.
	* tree-flow.h: Likewise.
	* tree-if-conv.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-inline.h: Likewise.
	* tree-into-ssa.c: Likewise.
	* tree-iterator.c: Likewise.
	* tree-loop-distribution.c: Likewise.
	* tree-mudflap.c: Likewise.
	* tree-optimize.c: Likewise.
	* tree-outof-ssa.c: Likewise.
	* tree-parloops.c: Likewise.
	* tree-phinodes.c: Likewise.
	* tree-predcom.c: Likewise.
	* tree-pretty-print.c: Likewise.
	* tree-scalar-evolution.c: Likewise.
	* tree-sra.c: Likewise.
	* tree-ssa-address.c: Likewise.
	* tree-ssa-alias.c: Likewise.
	* tree-ssa-ccp.c: Likewise.
	* tree-ssa-coalesce.c: Likewise.
	* tree-ssa-dce.c: Likewise.
	* tree-ssa-dom.c: Likewise.
	* tree-ssa-forwprop.c: Likewise.
	* tree-ssa-live.c: Likewise.
	* tree-ssa-live.h: Likewise.
	* tree-ssa-loop-im.c: Likewise.
	* tree-ssa-loop-ivcanon.c: Likewise.
	* tree-ssa-loop-ivopts.c: Likewise.
	* tree-ssa-loop-manip.c: Likewise.
	* tree-ssa-loop-niter.c: Likewise.
	* tree-ssa-loop-prefetch.c: Likewise.
	* tree-ssa-math-opts.c: Likewise.
	* tree-ssa-operands.c: Likewise.
	* tree-ssa-phiopt.c: Likewise.
	* tree-ssa-phiprop.c: Likewise.
	* tree-ssa-pre.c: Likewise.
	* tree-ssa-propagate.c: Likewise.
	* tree-ssa-reassoc.c: Likewise.
	* tree-ssa-sccvn.c: Likewise.
	* tree-ssa-sccvn.h: Likewise.
	* tree-ssa-strlen.c: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-ssa-tail-merge.c: Likewise.
	* tree-ssa-threadedge.c: Likewise.
	* tree-ssa-threadupdate.c: Likewise.
	* tree-ssa-uncprop.c: Likewise.
	* tree-ssa-uninit.c: Likewise.
	* tree-ssa.c: Likewise.
	* tree-ssanames.c: Likewise.
	* tree-stdarg.c: Likewise.
	* tree-streamer-in.c: Likewise.
	* tree-streamer-out.c: Likewise.
	* tree-streamer.c: Likewise.
	* tree-streamer.h: Likewise.
	* tree-switch-conversion.c: Likewise.
	* tree-vect-data-refs.c: Likewise.
	* tree-vect-generic.c: Likewise.
	* tree-vect-loop-manip.c: Likewise.
	* tree-vect-loop.c: Likewise.
	* tree-vect-patterns.c: Likewise.
	* tree-vect-slp.c: Likewise.
	* tree-vect-stmts.c: Likewise.
	* tree-vectorizer.c: Likewise.
	* tree-vectorizer.h: Likewise.
	* tree-vrp.c: Likewise.
	* tree.c: Likewise.
	* tree.h: Likewise.
	* value-prof.c: Likewise.
	* value-prof.h: Likewise.
	* var-tracking.c: Likewise.
	* varasm.c: Likewise.
	* varpool.c: Likewise.
	* vmsdbgout.c: Likewise.
	* config/bfin/bfin.c: Likewise.
	* config/c6x/c6x.c: Likewise.
	* config/darwin.c: Likewise.
	* config/i386/i386.c: Likewise.
	* config/ia64/ia64.c: Likewise.
	* config/mep/mep.c: Likewise.
	* config/mips/mips.c: Likewise.
	* config/pa/pa.c: Likewise.
	* config/rs6000/rs6000-c.c: Likewise.
	* config/rs6000/rs6000.c: Likewise.
	* config/rx/rx.c: Likewise.
	* config/spu/spu-c.c: Likewise.
	* config/vms/vms.c: Likewise.
	* config/vxworks.c: Likewise.
	* config/epiphany/resolve-sw-modes.c: Likewise.

From-SVN: r193595
2012-11-17 21:54:30 -05:00
Kenneth Zadeck 33ffb5c5ab rtl.h (CONST_SCALAR_INT_P): New macro.
2012-11-09  Kenneth Zadeck <zadeck@naturalbridge.com>

	* rtl.h (CONST_SCALAR_INT_P): New macro.
   	* cfgexpand.c (expand_debug_locations): Changed to use
	CONST_SCALAR_INT_P macro.
	* combine.c (try_combine, subst, make_extraction,
	gen_lowpart_for_combine): Ditto.
	* cselib.c (entry_and_rtx_equal_p, rtx_equal_for_cselib_1): Ditto.
	* dwarf2out.c (loc_descriptor): Ditto.
	* emit-rtl.c (gen_lowpart_common): Ditto.
	* ira-costs.c (record_reg_classes, record_address_regs): Ditto.
	* ira-lives.c (single_reg_class): Ditto.
	* recog.c (simplify_while_replacing, asm_operand_ok,
	constrain_operands): Ditto.
	* reload.c (find_reloads): Ditto.
	* simplify-rtx.c (simplify_unary_operation_1,
	simplify_const_unary_operation, simplify_binary_operation_1,
	simplify_const_binary_operation, simplify_relational_operation_1,
	simplify_subreg): Ditto.

From-SVN: r193360
2012-11-09 13:18:49 +00:00
Vladimir Makarov c5cd5a7ed3 rtl.h (struct rtx_def): Add a comment for member unchanging.
2012-10-28  Vladimir Makarov  <vmakarov@redhat.com>

	* rtl.h (struct rtx_def): Add a comment for member unchanging.
	* lra-int.h (LRA_TEMP_CLOBBER_P): New macro.
	(lra_hard_reg_substitution): Rename to lra_final_code_change.
	* lra-constraints.c (match_reload): Mark temporary clobbers.
	* lra-spill.c (lra_hard_reg_substitution): Rename to
	lra_final_code_change.  Remove temporary clobbers.
	* lra.c (lra): Rename to lra_final_code_change.

From-SVN: r192897
2012-10-28 20:02:59 +00:00
Richard Sandiford 277f65de19 re PR bootstrap/55049 (bootstrap failed with --with-multilib-list=m32,m64,mx32)
gcc/
	PR bootstrap/55049
	* Makefile.in (rtlanal.o): Add dependency on addresses.h.
	* rtl.h (address_info): New structure.
	(strip_address_mutations, decompose_address, decompose_lea_address)
	(decompose_mem_address, update_address, get_index_scale)
	(get_index_code): Declare.
	* rtlanal.c: Include addresses.h.
	(strip_address_mutations, must_be_base_p, must_be_index_p)
	(set_address_segment, set_address_base, set_address_index)
	(set_address_disp, decompose_incdec_address, decompose_automod_address)
	(extract_plus_operands, baseness, decompose_normal_address)
	(decompose_address, decompose_lea_address, decompose_mem_address)
	(update_address, get_index_scale, get_index_code): New functions.
	* lra-constraints.c (strip_subreg): New function.
	(address, extract_loc_address_regs, extract_address_regs)
	(get_index_scale): Delete.
	(process_addr_reg): Apply strip_subreg to the location.
	(uses_hard_regs_p): Use decompose_mem_address.
	(valid_address_p, base_plus_disp_to_reg, can_add_disp_p)
	(equiv_address_substitution): Take an address_info rather
	than an address.  Remove other arguments.  Avoid using Pmode.
	(process_address): Use decompose_mem_address and decompose_lea_address.
	Update calls to above functions.

From-SVN: r192837
2012-10-26 06:41:53 +00:00
Vladimir Makarov 55a2c3226a dbxout.c (dbxout_symbol_location): Pass new argument to alter_subreg.
2012-10-23  Vladimir Makarov  <vmakarov@redhat.com>

	* dbxout.c (dbxout_symbol_location): Pass new argument to
	alter_subreg.
	* dwarf2out.c: Include ira.h and lra.h.
	(based_loc_descr, compute_frame_pointer_to_fb_displacement): Use
	lra_eliminate_regs for LRA instead of eliminate_regs.
	* expr.c (emit_move_insn_1): Pass an additional argument to
	emit_move_via_integer.  Use emit_move_via_integer for LRA only if
	the insn is recognized.
	* emit-rtl.c (gen_rtx_REG): Add lra_in_progress.
	(validate_subreg): Don't check offset for LRA and floating point
	modes.
	* final.c (final_scan_insn, cleanup_subreg_operands): Pass new
	argument to alter_subreg.
	(walk_alter_subreg, output_operand): Ditto.
	(alter_subreg): Add new argument.
	* gcse.c (calculate_bb_reg_pressure): Add parameter to
	ira_setup_eliminable_regset call.
	* ira.c: Include lra.h.
	(ira_init_once, ira_init, ira_finish_once): Call lra_start_once,
	lra_init, lra_finish_once in anyway.
	(ira_setup_eliminable_regset): Add parameter.  Remove need_fp.
	Call lra_init_elimination and mark HARD_FRAME_POINTER_REGNUM as
	living forever if frame_pointer_needed.
	(setup_reg_class_relations): Set up ira_reg_class_subset.
	(ira_reg_equiv_invariant_p, ira_reg_equiv_const): Remove.
	(find_reg_equiv_invariant_const): Ditto.
	(setup_reg_renumber): Use ira_equiv_no_lvalue_p instead of
	ira_reg_equiv_invariant_p.  Skip caps for LRA.
	(setup_reg_equiv_init, ira_update_equiv_info_by_shuffle_insn): New
	functions.
	(ira_reg_equiv_len, ira_reg_equiv): New externals.
	(ira_reg_equiv): New.
	(ira_expand_reg_equiv, init_reg_equiv, finish_reg_equiv): New
	functions.
	(no_equiv, update_equiv_regs): Use ira_reg_equiv instead of
	reg_equiv_init.
	(setup_reg_equiv): New function.
	(ira_use_lra_p): New global.
	(ira): Set up lra_simple_p and ira_conflicts_p.  Set up and
	restore flag_caller_saves and flag_ira_region.  Move
	initialization of ira_obstack and ira_bitmap_obstack upper.  Call
	init_reg_equiv, setup_reg_equiv, and setup_reg_equiv_init instead
	of initialization of ira_reg_equiv_len, ira_reg_equiv_invariant_p,
	and ira_reg_equiv_const.  Call ira_setup_eliminable_regset with a
	new argument.  Don't flatten IRA IRA for LRA.  Don't reassign
	conflict allocnos for LRA. Call finish_reg_equiv.
        (do_reload): Prepare code for LRA call.  Call LRA.
	* ira.h (ira_use_lra_p): New external.
	(struct target_ira): Add members x_ira_class_subset_p
	x_ira_reg_class_subset, and x_ira_reg_classes_intersect_p.
	(ira_class_subset_p, ira_reg_class_subset): New macros.
	(ira_reg_classes_intersect_p): New macro.
	(struct ira_reg_equiv): New.
	(ira_setup_eliminable_regset): Add an argument.
	(ira_expand_reg_equiv, ira_update_equiv_info_by_shuffle_insn): New
	prototypes.
	* ira-color.c (color_pass, move_spill_restore, coalesce_allocnos):
	Use ira_equiv_no_lvalue_p.
	(coalesce_spill_slots, ira_sort_regnos_for_alter_reg): Ditto.
	* ira-emit.c (ira_create_new_reg): Call ira_expand_reg_equiv.
	(generate_edge_moves, change_loop) Use ira_equiv_no_lvalue_p.
	(emit_move_list): Simplify code.  Call
	ira_update_equiv_info_by_shuffle_insn.  Use ira_reg_equiv instead
	of ira_reg_equiv_invariant_p and ira_reg_equiv_const.  Change
	assert.
	* ira-int.h (struct target_ira_int): Remove x_ira_class_subset_p
	and x_ira_reg_classes_intersect_p.
	(ira_class_subset_p, ira_reg_classes_intersect_p): Remove.
	(ira_reg_equiv_len, ira_reg_equiv_invariant_p): Ditto.
	(ira_reg_equiv_const): Ditto.
	(ira_equiv_no_lvalue_p): New function.
	* jump.c (true_regnum): Always use hard_regno for subreg_get_info
	when lra is in progress.
	* haifa-sched.c (sched_init): Pass new argument to
	ira_setup_eliminable_regset.
	* loop-invariant.c (calculate_loop_reg_pressure): Pass new
	argument to ira_setup_eliminable_regset.
	* lra.h: New.
	* lra-int.h: Ditto.
	* lra.c: Ditto.
	* lra-assigns.c: Ditto.
	* lra-constraints.c: Ditto.
	* lra-coalesce.c: Ditto.
	* lra-eliminations.c: Ditto.
	* lra-lives.c: Ditto.
	* lra-spills.c: Ditto.
	* Makefile.in (LRA_INT_H): New.
	(OBJS): Add lra.o, lra-assigns.o, lra-coalesce.o,
	lra-constraints.o, lra-eliminations.o, lra-lives.o, and
	lra-spills.o.
	(dwarf2out.o): Add dependence on ira.h and lra.h.
	(ira.o): Add dependence on lra.h.
	(lra.o, lra-assigns.o, lra-coalesce.o, lra-constraints.o): New
	entries.
	(lra-eliminations.o, lra-lives.o, lra-spills.o): Ditto.
	* output.h (alter_subreg): Add new argument.
	* rtlanal.c (simplify_subreg_regno): Permit mode changes for LRA.
	Permit ARG_POINTER_REGNUM and STACK_POINTER_REGNUM for LRA.
	* recog.c (general_operand, register_operand): Accept paradoxical
	FLOAT_MODE subregs for LRA.
	(scratch_operand): Accept pseudos for LRA.
	* rtl.h (lra_in_progress): New external.
	(debug_bb_n_slim, debug_bb_slim, print_value_slim): New
	prototypes.
	(debug_rtl_slim, debug_insn_slim): Ditto.
	* sdbout.c (sdbout_symbol): Pass new argument to alter_subreg.
	* sched-vis.c (print_value_slim): New.
	* target.def (lra_p): New hook.
	(register_priority): Ditto.
	(different_addr_displacement_p): Ditto.
	(spill_class): Ditto.
	* target-globals.h (this_target_lra_int): New external.
	(target_globals): New member lra_int.
	(restore_target_globals): Restore this_target_lra_int.
	* target-globals.c: Include lra-int.h.
	(default_target_globals): Add &default_target_lra_int.
	* targhooks.c (default_lra_p): New function.
	(default_register_priority): Ditto.
	(default_different_addr_displacement_p): Ditto.
	* targhooks.h (default_lra_p): Declare.
	(default_register_priority): Ditto.
	(default_different_addr_displacement_p): Ditto.
	* timevar.def (TV_LRA, TV_LRA_ELIMINATE, TV_LRA_INHERITANCE): New.
	(TV_LRA_CREATE_LIVE_RANGES, TV_LRA_ASSIGN, TV_LRA_COALESCE): New.
	* config/arm/arm.c (load_multiple_sequence): Pass new argument toOB
	alter_subreg.
	(store_multiple_sequence): Ditto.
	* config/i386/i386.h (enum ix86_tune_indices): Add
	X86_TUNE_GENERAL_REGS_SSE_SPILL.
	(TARGET_GENERAL_REGS_SSE_SPILL): New macro.
	* config/i386/i386.c (initial_ix86_tune_features): Set up
	X86_TUNE_GENERAL_REGS_SSE_SPILL for m_COREI7 and m_CORE2I7.
	(ix86_lra_p, ix86_register_priority): New functions.
	(ix86_secondary_reload): Add NON_Q_REGS, SIREG, DIREG.
	(inline_secondary_memory_needed): Change assert.
	(ix86_spill_class): New function.
	(TARGET_LRA_P, TARGET_REGISTER_BANK, TARGET_SPILL_CLASS): New
	macros.
	* config/m68k/m68k.c (emit_move_sequence): Pass new argument to
	alter_subreg.
	* config/m32r/m32r.c (gen_split_move_double): Ditto.
	* config/pa/pa.c (pa_emit_move_sequence): Ditto.
	* config/sh/sh.md: Ditto.
	* config/v850/v850.c (v850_reorg): Ditto.
	* config/xtensa/xtensa.c (fixup_subreg_mem): Ditto.
	* doc/md.texi: Add new interpretation of hint * for LRA.
	* doc/passes.texi: Describe LRA pass.
	* doc/tm.texi.in: Add TARGET_LRA_P, TARGET_REGISTER_PRIORITY,
	TARGET_DIFFERENT_ADDR_DISPLACEMENT_P, and TARGET_SPILL_CLASS.
	* doc/tm.texi: Update.

From-SVN: r192719
2012-10-23 15:51:41 +00:00
Aldy Hernandez a7b159a4dc re PR rtl-optimization/54900 (write introduction incorrect wrt the C11 memory model (2))
PR rtl-optimization/54900
	* ifcvt.c (noce_can_store_speculate_p): Call
	memory_must_be_modified_in_insn_p.
	* alias.c (memory_must_be_modified_in_insn_p): New.
	(set_dest_equal_p): New.
	* rtl.h (memory_must_be_modified_in_p): Protoize.

From-SVN: r192548
2012-10-17 20:59:40 +00:00
Steven Bosscher da4fdf2d3f rtl.h (get_call_rtx_from): New prototype.
* rtl.h (get_call_rtx_from): New prototype.
	* rtlanal.c (get_call_rtx_from): New function.
	* calls.c (emit_call_1): Use it.
	* dse.c (scan_insn): Likewise
	* dwarf2out.c (dwarf2out_var_location): Likewise.
	* sched-deps.c (call_may_noreturn_p): Likewise.
	* var-tracking.c (prepare_call_arguments): Likewise.
	* config/sh/sh.c (sh_adjust_cost): Likewise.

From-SVN: r192516
2012-10-16 22:05:17 +00:00
Jakub Jelinek 0fe03ac318 re PR debug/54796 (Non-addressable stack parameter debug quality regression)
PR debug/54796
	* rtl.h: Document jump flag on VALUE.
	* cselib.h (cselib_set_value_sp_based,
	cselib_sp_based_value_p): New prototypes.
	* alias.c (find_base_term): For cselib_sp_based_value_p
	return static_reg_base_value[STACK_POINTER_REGNUM].
	* cselib.c (SP_BASED_VALUE_P): Define.
	(cselib_set_value_sp_based, cselib_sp_based_value_p): New functions.
	* var-tracking.c (add_stores): Call cselib_set_value_sp_based
	for not yet preserved VALUEs of sp on sp assignments if
	hard_frame_pointer_adjustment != -1.
	(vt_initialize): When setting hard_frame_pointer_adjustment,
	disassociate sp from its previous value and call
	cselib_set_value_sp_based on a new VALUE created for sp.

	* gcc.dg/guality/pr54796.c: New test.

From-SVN: r192494
2012-10-16 13:21:20 +02:00
Dehao Chen 2f13f2de1f tree.h (tree_constructor): Remove IS_UNKNOWN_LOCATION.
2012-09-27  Dehao Chen  <dehao@google.com>

	* tree.h (tree_constructor): Remove IS_UNKNOWN_LOCATION.
	(extern void protected_set_expr_location): Likewise.
	(function_args_iter_next): Likewise.
	(inlined_function_outer_scope_p): Likewise.
	* input.h (IS_UNKNOWN_LOCATION): Likewise.
	* fold-const.c (expr_location_or): Likewise.
	* lto-cgraph.c (output_node_opt_summary): Likewise.
	* dwarf2out.c (add_src_coords_attributes): Likewise.
	* tree-eh.c (lower_try_finally_dup_block): Likewise.
	* profile.c (branch_prob):
	* cfgexpand.c (expand_gimple_cond): Likewise.
	(expand_gimple_basic_block): Likewise.
	(construct_exit_block): Likewise.
	(gimple_expand_cfg): Likewise.
	* cfgcleanup.c (try_forward_edges): Likewise.
	* tree-ssa-live.c (remove_unused_scope_block_p): Likewise.
	(dump_scope_block): Likewise.
	* ipa-prop.c (ipa_write_jump_function): Likewise.
	* rtl.h (extern void rtl_check_failed_flag): Likewise.
	* gimple.h (gimple_set_location): Likewise.
	(gimple_has_location): Likewise.
	* cfgrtl.c (unique_locus_on_edge_between_p): Likewise.
	(force_nonfallthru_and_redirect): Likewise.
	(fixup_reorder_chain): Likewise.
	(cfg_layout_merge_blocks): Likewise.

From-SVN: r191810
2012-09-27 17:06:22 +00:00
Dehao Chen 5368224f42 Integrate lexical block into source_location.
gcc:
	2012-09-19  Dehao Chen  <dehao@google.com>

	* toplev.c (general_init): Init block_locations.
	* tree.c (tree_set_block): New.
	(tree_block): Change to use LOCATION_BLOCK.
	* tree.h (TREE_SET_BLOCK): New.
	* final.c (reemit_insn_block_notes): Change to use LOCATION_BLOCK.
	(final_start_function): Likewise.
	* input.c (expand_location_1): Likewise.
	* input.h (LOCATION_LOCUS): New.
	(LOCATION_BLOCK): New.
	(IS_UNKNOWN_LOCATION): New.
	* fold-const.c (expr_location_or): Change to use new location.
	* reorg.c (emit_delay_sequence): Likewise.
	(try_merge_delay_insns): Likewise.
	* modulo-sched.c (dump_insn_location): Likewise.
	* lto-streamer-out.c (lto_output_location_bitpack): Likewise.
	* lto-cgraph.c (output_node_opt_summary): Likewise.
	* jump.c (rtx_renumbered_equal_p): Likewise.
	* ifcvt.c (noce_try_move): Likewise.
	(noce_try_store_flag): Likewise.
	(noce_try_store_flag_constants): Likewise.
	(noce_try_addcc): Likewise.
	(noce_try_store_flag_mask): Likewise.
	(noce_try_cmove): Likewise.
	(noce_try_cmove_arith): Likewise.
	(noce_try_minmax): Likewise.
	(noce_try_abs): Likewise.
	(noce_try_sign_mask): Likewise.
	(noce_try_bitop): Likewise.
	(noce_process_if_block): Likewise.
	(cond_move_process_if_block): Likewise.
	(find_cond_trap): Likewise.
	* ipa-prop.c (ipa_set_jf_constant): Likewise.
	(ipa_write_jump_function): Likewise.
	* dwarf2out.c (add_src_coords_attributes): Likewise.
	* expr.c (expand_expr_real): Likewise.
	* tree-parloops.c (create_loop_fn): Likewise.
	* recog.c (peep2_attempt): Likewise.
	* function.c (free_after_compilation): Likewise.
	(expand_function_end): Likewise.
	(set_insn_locations): Likewise.
	(thread_prologue_and_epilogue_insns): Likewise.
	* print-rtl.c (print_rtx): Likewise.
	* profile.c (branch_prob): Likewise.
	* trans-mem.c (ipa_tm_scan_irr_block): Likewise.
	* gimplify.c (gimplify_call_expr): Likewise.
	* except.c (duplicate_eh_regions_1): Likewise.
	* emit-rtl.c (try_split): Likewise.
	(make_insn_raw): Likewise.
	(make_debug_insn_raw): Likewise.
	(make_jump_insn_raw): Likewise.
	(make_call_insn_raw): Likewise.
	(emit_pattern_after_setloc): Likewise.
	(emit_pattern_after): Likewise.
	(emit_debug_insn_after): Likewise.
	(emit_pattern_before): Likewise.
	(emit_insn_before_setloc): Likewise.
	(emit_jump_insn_before): Likewise.
	(emit_call_insn_before_setloc): Likewise.
	(emit_call_insn_before): Likeise.
	(emit_debug_insn_before_setloc): Likewise.
	(emit_copy_of_insn_after): Likewise.
	(insn_locators_alloc): Remove.
	(insn_locators_finalize): Remove.
	(insn_locators_free): Remove.
	(set_curr_insn_source_location): Remove.
	(get_curr_insn_source_location): Remove.
	(set_curr_insn_block): Remove.
	(get_curr_insn_block): Remove.
	(locator_scope): Remove.
	(insn_scope): Change to use new location.
	(locator_location): Remove.
	(insn_line): Change to use new location.
	(locator_file): Remove.
	(insn_file): Change to use new location.
	(locator_eq): Remove.
	(insn_locations_init): New.
	(insn_locations_finalize): New.
	(set_curr_insn_location): New.
	(curr_insn_location): New.
	* cfgexpand.c (gimple_assign_rhs_to_tree): Change to use new location.
	(expand_gimple_cond): Likewise.
	(expand_call_stmt): Likewise.
	(expand_gimple_stmt_1): Likewise.
	(expand_gimple_basic_block): Likewise.
	(construct_exit_block): Likewise.
	(gimple_expand_cfg): Likewise.
	* cfgcleanup.c (try_forward_edges): Likewise.
	* tree-ssa-live.c (remove_unused_scope_block_p): Likewise.
	(dump_scope_block): Likewise.
	(remove_unused_locals): Likewise.
	* rtl.c (rtx_equal_p_cb): Likewise.
	(rtx_equal_p): Likewise.
	* rtl.h (XUINT): New.
	(INSN_LOCATOR): Remove.
	(CURR_INSN_LOCATION): Remove.
	(INSN_LOCATION): New.
	(INSN_HAS_LOCATION): New.
	* tree-inline.c (remap_gimple_op_r): Change to use new location.
	(copy_tree_body_r): Likewise.
	(copy_phis_for_bb): Likewise.
	(expand_call_inline): Likewise.
	* tree-streamer-in.c (lto_input_ts_exp_tree_pointers): Likewise.
	* tree-streamer-out.c (write_ts_decl_minimal_tree_pointers): Likewise.
	* gimple-streamer-out.c (output_gimple_stmt): Likewise.
	* combine.c (try_combine): Likewise.
	* tree-outof-ssa.c (set_location_for_edge): Likewise.
	(insert_partition_copy_on_edge): Likewise.
	(insert_value_copy_on_edge): Likewise.
	(insert_rtx_to_part_on_edge): Likewise.
	(insert_part_to_rtx_on_edge): Likewise.
	* basic-block.h (edge_def): Remove field.
	* gimple.h (gimple_statement_base): Remove field.
	(gimple_bb): Change to use new location.
	(gimple_set_block): Likewise.
	(gimple_has_location): Likewise.
	* tree-cfg.c (make_cond_expr_edges): Likewise.
	(make_goto_expr_edges): Likewise.
	(gimple_can_merge_blocks_p): Likewise.
	(move_stmt_op): Likewise.
	(move_block_to_fn): Likewise.
	* config/alpha/alpha.c (alpha_output_mi_thunk_osf): Likewise.
	* config/sparc/sparc.c (sparc_output_mi_thunk): Likewise.
	* config/i386/i386.c (x86_output_mi_thunk): Likewise.
	* config/tilegx/tilegx.c (tilegx_output_mi_thunk): Likewise.
	* config/sh/sh.c (sh_output_mi_thunk): Likewise.
	* config/ia64/ia64.c (ia64_output_mi_thunk): Likewise.
	* config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise.
	* config/score/score.c (score_output_mi_thunk): Likewise.
	* config/tilepro/tilepro.c (tilepro_asm_output_mi_thunk): Likewise.
	* config/mips/mips.c (mips_output_mi_thunk): Likewise.
	* cfgrtl.c (unique_locus_on_edge_between_p): Likewise.
	(unique_locus_on_edge_between_p): Likewise.
	(emit_nop_for_unique_locus_between): Likewise.
	(force_nonfallthru_and_redirect): Likewise.
	(fixup_reorder_chain): Likewise.
	(cfg_layout_merge_blocks): Likewise.
	* stmt.c (emit_case_nodes): Likewise.

gcc/lto:
	2012-09-19  Dehao Chen  <dehao@google.com>

	* lto/lto.c (lto_fixup_prevailing_decls): Remove tree.exp.block field.

libcpp:
	2012-09-19  Dehao Chen  <dehao@google.com>

	* include/line-map.h (MAX_SOURCE_LOCATION): New value.
	(location_adhoc_data_fini): New.
	(get_combined_adhoc_loc): New.
	(get_data_from_adhoc_loc): New.
	(get_location_from_adhoc_loc): New.
	(location_adhoc_data_map): New.
	(COMBINE_LOCATION_DATA): New.
	(IS_ADHOC_LOC): New.
	(expanded_location): New field.
	(line_maps): New field.
	* line-map.c (location_adhoc_data): New.
	(location_adhoc_data_hash): New.
	(location_adhoc_data_eq): New.
	(location_adhoc_data_update): New.
	(get_combined_adhoc_loc): New.
	(get_data_from_adhoc_loc): New.
	(get_location_from_adhoc_loc): New.
	(location_adhoc_data_init): New.
	(location_adhoc_data_fini): New.
	(linemap_init): Initialize location_adhoc_data.
	(linemap_lookup): Change to use new location.
	(linemap_ordinary_map_lookup): Likewise.
	(linemap_macro_map_lookup): Likewise.
	(linemap_macro_map_loc_to_def_point): Likewise.
	(linemap_macro_map_loc_unwind_toward_spel): Likewise.
	(linemap_get_expansion_line): Likewise.
	(linemap_get_expansion_filename): Likewise.
	(linemap_location_in_system_header_p): Likewise.
	(linemap_location_from_macro_expansion_p): Likewise.
	(linemap_macro_loc_to_spelling_point): Likewise.
	(linemap_macro_loc_to_def_point): Likewise.
	(linemap_macro_loc_to_exp_point): Likewise.
	(linemap_resolve_location): Likewise.
	(linemap_unwind_toward_expansion): Likewise.
	(linemap_unwind_to_first_non_reserved_loc): Likewise.
	(linemap_expand_location): Likewise.
	(linemap_dump_location): Likewise.
	(linemap_line_start): Likewise.

From-SVN: r191494
2012-09-19 19:56:42 +00:00
Georg-Johann Lay 78ab1ff46b rtl.h (CONST_FIXED_P): New predicate macro.
* rtl.h (CONST_FIXED_P): New predicate macro.

From-SVN: r191388
2012-09-17 15:08:13 +00:00
Steven Bosscher df92c6403c ipa-pure-const.c (state_from_flags, [...]): Use current_function_name instead of lang_hooks.decl_printable_name.
* ipa-pure-const.c (state_from_flags, local_pure_const): Use
	current_function_name instead of lang_hooks.decl_printable_name.

	* function.h (fndecl_name): New prototype.
	* function.c (fndecl_name): New function.
	* vecir.h (cgraph_node_p): New standard IR VEC type.
	* trans-mem.c (cgraph_node_p): No need anymore to define it here.
	* ipa-utils.h (ipa_get_nodes_in_cycle): New prototype.
	* ipa-utils.c (ipa_get_nodes_in_cycle): New function.
	* ipa-reference.c: Don't include langhooks.h, and certainly not twice.
	Fix many formatting issues (long lines, short lines, spacing, etc.).
	(get_static_name): Use fndecl_name.
	(dump_static_vars_set_to_file): New function split out from propagate.
	(union_static_var_sets): New function, union two sets and collapse
	to all_module_statics as quickly as possible.
	(intersect_static_var_sets): New function, similar to above.
	(copy_static_var_set): Renamed from copy_global_bitmap and rewritten
	to allocate a copy on the same bitmap_obstack as the source set.
	(propagate_bits): Simplify, and clarify by using union_static_var_sets.
	(generate_summary): Remove bm_temp.  Print UID of promotable globals.
	(read_write_all_from_decl): Use pass-by-reference, bless C++.
	(get_read_write_all_from_node): New function, split out from propagate.
	(propagate): Simplify and clarify with helper functions.  Use
	ipa_get_nodes_in_cycle to walk all nodes in a reduced node.
	(ipa_reference_read_optimization_summary): Use fndecl_name instead of
	lang_hooks.decl_printable_name.

	* rtl.h (print_rtl_single_with_indent): New prototype.
	* print-rtl.c (print_rtl_single_with_indent): New function.
	* cfghooks.h (empty_block_p, split_block_before_cond_jump): New hooks.
	* cfghooks.c (empty_block_p, split_block_before_cond_jump): Implement.
	* cfgrtl.c (rtl_block_empty_p, rtl_split_block_before_cond_jump):
	Implement RTL specific hooks.
	(rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Register the new hooks.
	* tree-cfg.c (gimple_empty_block_p,
	gimple_split_block_before_cond_jump): Implement GIMPLE specific hooks.
	(gimple_cfg_hooks): Register the new hooks.
	* tree-ssa-phiopt.c (empty_block_p): Remove in favor of new hook.

From-SVN: r191255
2012-09-13 13:41:46 +00:00
Rainer Orth 9081064aee Fix Solaris 9/x86 bootstrap
* rtl.h (FFS, FLOAT, ABS, PC): Don't undef.
	* system.h (FFS, FLOAT, ABS, PC): Undef.

From-SVN: r191217
2012-09-12 12:34:21 +00:00
Kenneth Zadeck d81168901e alias.c (rtx_equal_for_memref_p): Convert constant cases.
2012-08-23  Kenneth Zadeck <zadeck@naturalbridge.com>

	* alias.c (rtx_equal_for_memref_p): Convert constant cases.
	* combine.c (find_single_use_1, mark_used_regs_combine): Convert
	to CASE_CONST_ANY.
 	* cse.c (exp_equiv_p, canon_reg, fold_rtx, cse_process_notes_1,
	count_reg_usage): Convert constant cases.
	* cselib.c (cselib_expand_value_rtx_1): Convert to
	CASE_CONST_ANY.
	(cselib_subst_to_values): Convert constant cases.
	* df-scan.c (df_uses_record): Ditto.
	* dse.c (const_or_frame_p): Convert case statements to explicit
	if-then-else using mode classes.
	* emit-rtl.c (verify_rtx_sharing, copy_insn_1): Convert constant cases.
	* explow.c (convert_memory_address_addr_space): Ditto.
	* gcse.c (want_to_gcse_p, oprs_unchanged_p, compute_transp): Ditto.
	* genattrtab.c (attr_copy_rtx, clear_struct_flag): Ditto.
	* ira.c (equiv_init_varies_p, contains_replace_regs,
	memref_referenced_p, rtx_moveable_p): Ditto.
	* jump.c (mark_jump_label_1): Remove constant cases.
	(rtx_renumbered_equal_p): Convert to CASE_CONST_UNIQUE.
	* loop-invariant.c (check_maybe_invariant, hash_invariant_expr_1,
	invariant_expr_equal_p): Convert to CASE_CONST_ANY.
	* postreload-gcse.c (oprs_unchanged_p): Convert constant cases.
	* reginfo.c (reg_scan_mark_refs): Ditto.
	* regrename.c (scan_rtx): Ditto.
	* reload1.c (eliminate_regs_1, elimination_effects,
	scan_paradoxical_subregs): Ditto.
	* reload.c (operands_match_p, subst_reg_equivs):  Ditto.
	* resource.c (mark_referenced_resources, mark_set_resources): Ditto.
	* rtlanal.c (rtx_unstable_p, rtx_varies_p, count_occurrences)
	(reg_mentioned_p, modified_between_p, modified_in_p)
	(volatile_insn_p, volatile_refs_p, side_effects_p, may_trap_p_1,
	inequality_comparisons_p, computed_jump_p_1): Ditto.
	* rtl.c (copy_rtx, rtx_equal_p_cb, rtx_equal_p): Ditto.
	* sched-deps.c (sched_analyze_2): Ditto.
	* valtrack.c (cleanup_auto_inc_dec): Ditto.
	* rtl.h: (CASE_CONST_SCALAR_INT, CASE_CONST_UNIQUE, 
	CASE_CONST_ANY): New macros.

From-SVN: r190627
2012-08-23 18:46:18 +00:00
Kenneth Zadeck 481755378d cfgexpand.c (expand_debug_locations): Encapsulate test for CONST_DOUBLE in macro.
2012-08-02  Kenneth Zadeck <zadeck@naturalbridge.com>

	* cfgexpand.c (expand_debug_locations):  Encapsulate test for
	CONST_DOUBLE in macro.
	* combine.c (try_combine, gen_lowpart_for_combine): Ditto.
	* cprop.c (implicit_set_cond_p): Ditto.
	* cselib.c (rtx_equal_for_cselib_1): Ditto.
	* expmed.c (expand_mult): Ditto.
	* expr.c (convert_modes): Ditto.
	* ira-costs.c (record_reg_classes): Ditto.
	* ira-lives.c (single_reg_class): Ditto.
	* optabs.c (expand_copysign_absneg, expand_copysign): Ditto.
	* print-rtl.c (print_rtx): Ditto.
	* recog.c (simplify_while_replacing, const_double_operand)
	(asm_operand_ok, constrain_operands): Ditto.
	* reg-stack.c (subst_stack_regs_pat): Ditto.
	* reload.c (find_reloads, find_equiv_reg): Ditto.
	* rtlanal.c (replace_rtx): Remove test.
	* rtlanal.c (constant_pool_constant_p, split_double): Encapsulate test for
	CONST_DOUBLE in macro.
	* simplify-rtx.c (mode_signbit_p, avoid_constant_pool_reference)
	(simplify_unary_operation_1, simplify_const_unary_operation)
	(simplify_binary_operation_1, simplify_const_binary_operation)
	(simplify_relational_operation_1)
	(simplify_const_relational_operations)
	(implify_subreg): Ditto.
	* varasm.c (output_constant_pool_2): Ditto.
	* rtl.h (CONST_DOUBLE_AS_INT_P, CONST_DOUBLE_AS_FLOAT_P): New
	macros.
	* rtl.def (CONST_DOUBLE):  Updated comments.

From-SVN: r190105
2012-08-02 22:39:57 +00:00
Alexandre Oliva 08df6c0db1 re PR debug/52983 (internal compiler error: in df_uses_record, at df-scan.c:3243)
PR debug/52983
* valtrack.h, valtrack.c: New.
* Makefile.in (VALTRACK_H): New.
(OBJS): Add valtrack.o.
(valtrack.o): New.
(cselib.o, dce.o, df-problems.o, combine.o): Add VALTRACK_H.
* combine.c: Include valtrack.h.
(make_compound_operation): Publish.
(cleanup_auto_inc_dec): Move to valtrack.c.
(struct rtx_subst_pair, propagate_for_debug_subst): Likewise.
(propagate_for_debug): Likewise.  Add this_basic_block parameter.
Adjust all callers.
* cselib.c: Include valtrack.h.
* dce.c: Likewise.
* df-problems.c: Likewise.
(dead_debug_init, dead_debug_reset_uses): Move to valtrack.c.
(dead_debug_finish, dead_debug_add): Likewise.
(dead_debug_insert_temp): Likewise.
* df.h (struct dead_debug_use): Move to valtrack.h.
(struct dead_debug, enum debug_temp_where): Likewise.
(dead_debug_init, dead_debug_reset_uses): Move to valtrack.h.
(dead_debug_finish, dead_debug_add): Likewise.
(dead_debug_insert_temp): Likewise.
* rtl.h (make_compound_operation): Declare.

From-SVN: r190061
2012-08-02 00:34:11 +00:00
Steven Bosscher 3ad45f7ff3 re PR pch/53880 (compile time regression when generating precompiled headers for boost)
PR pch/53880
	* gengtype.c (struct walk_type_data): Add have_this_obj field.
	(walk_type): For functions that take a this_obj argument and
	that process fields with a GTY((length)) argument, write the
	test that write_types_local_process_field will write also at the
	head of the loop, effectively unswitching the loop.
	(write_func_for_structure, write_local_func_for_structure): Clear
	have_this_obj before calling walk_type.
	(write_local_func_for_structure): Set have_this_obj before walk_type.
	(write_array): Set have_this_obj for output of local pointer walking
	functions but not for marker functions.
	(write_types_local_process_field): Assert have_this_obj is set.

	* rtl.h (simplify_using_condition): Adjust prototype using bitmap
	from coretypes.h.

From-SVN: r189999
2012-07-31 09:20:56 +00:00
Richard Henderson cd1440b199 Reduce the size of optabs representation
From-SVN: r189821
2012-07-24 11:28:15 -07:00
Steven Bosscher a315c44ce0 dumpfile.h (TDF_COMMENT): New define.
* dumpfile.h (TDF_COMMENT): New define.
	* basic-block.h (EDGE_FALLTHRU, EDGE_ABNORMAL, EDGE_ABNORMAL_CALL,
	EDGE_EH, EDGE_FAKE, EDGE_DFS_BACK, EDGE_CAN_FALLTHRU,
	EDGE_IRREDUCIBLE_LOOP, EDGE_SIBCALL, EDGE_LOOP_EXIT, EDGE_TRUE_VALUE,
	EDGE_FALSE_VALUE, EDGE_EXECUTABLE, EDGE_CROSSING, EDGE_PRESERVE):
	Move to new file cfg-flags.h.
	(enum cfg_edge_flags): New enum, using cfg-flags.h.
	(EDGE_ALL_FLAGS): Compute value automatically.
	(BB_NEW, BB_REACHABLE, BB_IRREDUCIBLE_LOOP, BB_SUPERBLOCK,
	BB_DISABLE_SCHEDULE, BB_HOT_PARTITION, BB_COLD_PARTITION,
	BB_DUPLICATED, BB_NON_LOCAL_GOTO_TARGET, BB_RTL,
	BB_FORWARDER_BLOCK, BB_NONTHREADABLE_BLOCK, BB_MODIFIED, BB_VISITED,
	BB_IN_TRANSACTION): Move to new file cfg-flags.h.
	(enum bb_flags): Rename to cfg_bb_flags.  Use cfg-flags.h.
	(BB_ALL_FLAGS): New, compute value automatically.
	(dump_bb_info): Update prototype.
	(dump_edge_info): Update prototype.
	* cfg-flags.h: New file.
	* cfg.c (dump_edge_info): Take flags argument.  Be verbose only if
	TDF_DETAILS and not TDF_SLIM.  Include cfg-flags.h for bitnames.
	Check that the edge flags are within the range of EDGE_ALL_FLAGS.
	(debug_bb): Update dump_bb call.
	(dump_cfg_bb_info): Remove.
	(dump_bb_info): New function.  Use cfg-flags.h for bitnames.
	Adjust verbosity using TDF_* flags.  Check that the basic block flags
	are within the range of BB_ALL_FLAGS.
	(brief_dump_cfg): Use dump_bb_info instead of dump_cfg_bb_info.
	* cfghooks.h (struct cfghooks): Update dump_bb hook, take a FILE
	first for consistency with other dump functions.
	(dump_bb): Update prototype accordingly.
	* cfghooks.c: Include dumpfile.h.
	(verify_flow_info): Update dump_edge_info calls.
	(dump_bb): Take a flags argument and pass it around.
	Use dump_bb_info to dump common information about a basic block.
	(dump_flow_info): Moved here from cfgrtl.c.  Make IL agnostic.
	(debug_flow_info): Moved here from cfgrtl.c.
	* profile.c (is_edge_inconsistent): Update dump_bb calls.
	* loop-invariant.c (find_defs): Update print_rtl_with_bb call.
	* rtl.h (debug_bb_n_slim, debug_bb_slim, print_rtl_slim,
	print_rtl_slim_with_bb): Remove prototypes.
	(dump_insn_slim): Adjust prototype to take a const_rtx.
	(print_rtl_with_bb): Adjust prototype.
	* sched-rgn.c (debug_region): Use dump_bb instead of debug_bb_n_slim.
	* sched-vis.c (dump_insn_slim): Take a const_rtx.
	(debug_insn_slim): Prototype here near DEBUG_FUNCTION marker.
	(print_rtl_slim_with_bb): Remove.
	(print_rtl_slim): Rename to debug_rtl_slim.  Print only insn info,
	not basic block info (print_rtl_with_bb with TDF_SLIM should be used
	for that.  Prototype here near DEBUG_FUNCTION marker.
	(debug_bb_slim): Prototype here near DEBUG_FUNCTION marker.
	Use dump_bb.
	(debug_bb_n_slim): Prototype here near DEBUG_FUNCTION marker.
	* tree-cfg.c (gimple_can_merge_blocks_p): Use EDGE_COMPLEX.
	(remove_bb): Update dump_bb call.
	(gimple_debug_bb): Use dump_bb.
	(dump_function_to_file): Update gimple_dump_bb call.
	(print_loops_bb): Likewise.
	* tree-flow.h (gimple_dump_bb): Update prototype.
	* gimple-pretty-print.c (dump_bb_header): Rename to
	dump_gimple_bb_header.  Write to a stream instead of a pretty
	printer.  Use dump_bb_info to dump basic block info.
	(dump_bb_end): Rename to dump_gimple_bb_footer.  Write to a
	stream instead of a pretty printer.  Use dump_bb_info.
	(gimple_dump_bb_buff): Do not call dump_bb_header and dump_bb_end.
	(gimple_dump_bb): Do it here with dump_gimple_bb_header and
	dump_gimple_bb_footer.
	* cfgrtl.c (rtl_dump_bb): Update prototype.  Only dump DF if the
	dump flags have TDF_DETAILS.  Use dump_insn_slim if TDF_SLIM.
	(print_rtl_with_bb): Take a flags argument and pass it around.
	Use dump_insn_slim if TDF_SLIM.
	(dump_bb_info): Removed and re-incarnated in cfg.c.
	(dump_flow_info): Moved to cfghooks.c.
	(debug_flow_info): Moved to cfghooks.c.
	* passes.c (execute_function_dump): Unconditionally use
	print_rtl_with_bb for RTL dumps, now that it understands TDF_SLIM.
	* final.c (dump_basic_block_info): Update dump_edge_info calls.
	* tree-vrp.c (dump_asserts_for): Likewise.
	* ifcvt.c (if_convert): Unconditionally use print_rtl_with_bb.
	* tree-if-conv.c (if_convertible_bb_p): Don't look at
	EDGE_ABNORMAL_CALL, it has no meaning in the GIMPLE world.
	* trans-mem.c (make_tm_edge): Don't set EDGE_ABNORMAL_CALL,
	for the same reason.
	* config/rl78/rl78.c (rl78_reorg): Update print_rtl_with_bb calls.

From-SVN: r189590
2012-07-17 23:17:20 +00:00
Steven Bosscher e4da1e17ea emit-rtl.c (make_debug_insn_raw, [...]): Make static.
* emit-rtl.c (make_debug_insn_raw, make_jump_insn_raw): Make static.
	* rtl.h (make_debug_insn_raw, make_jump_insn_raw): Remove prototypes.

From-SVN: r189467
2012-07-13 15:56:04 +00:00
Steven Bosscher b8244d74e1 basic-block.h (struct edge_def): Use basic_block instead of basic_block_def *.
* basic-block.h (struct edge_def): Use basic_block instead of
	basic_block_def *.
	* cfgloop.h (struct loop_exit, struct loop): Likewise.
	* gengenrtl.c (type_from_format): Likewise.  Also for 'tree'
	instead of union tree_node *.
	* rtl.h (union rtunion_def, emit_insn_before_noloc,
	emit_insn_after_noloc, add_insn_before, add_insn_after,
	debug_bb_slim): Likewise.
	* tree-inline.h (struct copy_body_data): Likewise.
	* sched-rgn.c (dump_region_dot): Likewise.
	* gimple.h (struct gimple_statement_base, gimple_set_bb,
	gsi_move_to_bb_end): Likewise.
	* sched-vis.c (debug_bb_slim): Likewise.
	(debug_bb_n_slim): Likewise.
	* config/mn10300/mn10300.c (mn10300_insert_setlb_lcc): Likewise.
	(mn10300_block_contains_call):

From-SVN: r189424
2012-07-11 08:46:17 +00:00
Steven Bosscher 532aafaddb basic-block.h: Re-group most prototypes per file.
gcc/
	* basic-block.h: Re-group most prototypes per file.
	(struct edge_list): Remove num_blocks field.
	(dump_bb_info): Adjust prototypes.
	(dump_reg_info): Move prototype to regs.h.
	* function.h: Do not include tree.h.
	Include vec.h, vecir.h, input.h and machmode.h to compensate.
	(function_name): New prototype.
	* gimple.h: Include tree.h to compensate for basic-block.h change.
	* langhooks.h: Note that tree.h is only necessary for enum tree_code.
	* regs.h (dump_reg_info): Prototype here.
	* regset.h: Adjust file reference in comment.
	(debug_regset): Remove prototype.
	* rtl.h: Include flags.h for flag_var_tracking_assignments.
	(MAY_HAVE_DEBUG_INSNS): Define as flag_var_tracking_assignments
	instead of no-longer-available tree.h's MAY_HAVE_DEBUG_STMTS.
	(dump_reg_info, dump_flow_info): Remove prototypes.
	* bb-reorder.c (set_edge_can_fallthru_flag): Move from cfganal.c
	to here, the only user.  Make static.
	(reorder_basic_blocks): Call dump_reg_info before dump_flow_info.
	* cfg.c: Do not include tm.h, tree.h, rtl.h, hard-reg-set.h, regs.h,
	flags.h, function.h, except.h, diagnostic-core.h, tm_p.h, timevar.h,
	tree-pass.h, cfgloop.h, and tree-flow.h.
	Include basic-block.h, the first header I'd expect to be included.
	(reg_obstack): Move to df-core.c.
	(free_edge): Remove bogus ATTRIBUTE_UNUSED.
	(remove_edge_raw): Do not call tree-ssa's redirect_edge_var_map_clear.
	(redirect_edge_succ_nodup): Move to cfghooks.c.
	(dump_regset, debug_regset): Move to df-core.c.
	(dump_bb_info): Move to cfgrtl.c.
	(dump_reg_info): Move to regstat.c.
	(dump_flow_info): Move to cfgrtl.c.
	(debug_flow_info): Likewise.
	(dump_edge_info): Do not look at cfun, a CFG without cfun is nonsense.
	* cfganal.c: Do not include tm.h, rtl.h, obstack.h, hard-reg-set.h,
	insn-config.h, recog.h, diagnostic-core.h, tm_p.h, and cfgloop.h.
	(flow_active_insn_p, forwarder_block_p, can_fallthru,
	could_fall_through): Move to cfgrtl.c.
	(set_edge_can_fallthru_flag): Moved to bb-reorder.c.
	(create_edge_list): Do not set edge_list's removed num_blocks.
	(print_edge_list): Look at n_basic_blocks instead of num_blocks.
	(flow_nodes_print): Remove.
	(flow_edge_list_print): Remove.
	(inverted_post_order_compute): Use FOR_ALL_BB.
	*cfgrtl.c (dump_flow_info): Moved from cfg.c.
	Do not call dump_reg_info.
	(debug_flow_info): Moved from cfg.c
	(dump_bb_info): Moved from cfg.c.  Take 'verbose' argument
	to avoid looking at TDF_* flags from tree-pass.h.
	(flow_active_insn_p, forwarder_block_p, can_fallthru,
	could_fall_through): Moved from cfganal.c.
	(print_rtl_with_bb): Adjust dump_bb_info calls.
	* cfghooks.c (redirect_edge_succ_nodup): Moved from cfg.c.
	(remove_edge): Call redirect_edge_var_map_clear if IR_GIMPLE.
	(cfgcleanup.c): Look at MAY_HAVE_DEBUG_INSNS, not MAY_HAVE_DEBUG_STMTS.
	* cselib.c: Include tree.h with a FIXME.
	* df-core.c (reg_obstack): Moved from cfg.c.
	(dump_regset): Likewise.
	(debug_regset): Likewise.  Make a DEBUG_FUNCTION.
	* final.c (compute_alignments): Call dump_reg_info before
	dump_flow_info.
	* function.c (function_name): New function.
	(current_function_name): Use it.
	* ifcvt.c (rest_of_handle_if_conversion): Call dump_reg_info before
	dump_flow_info.
	* ira-conflicts.c: Include tree.h with a note.
	* regstat.c (dump_reg_info): Moved here from cfg.c.
	* loop-init.c: Include regs.h instead of hard-reg-set.h.
	(rtl_loop_init): Call dump_reg_info before dump_flow_info.
	(rtl_loop_done): Likewise.
	* mcf.c: Include tree.h before langhooks.h.
	* predict.c (maybe_hot_count_p): Assert we have cfun.
	(probably_never_executed_bb_p): Likewise.
	* profile.c (compute_branch_probabilities): Use gimple_dump_cfg
	instead of dump_flow_info.
	* sched-deps.c: Include tree.h with a FIXME.
	(call_may_noreturn_p): Add FIXME note why this function has to
	look at function decls instead of function decl flags.
	* sched-vis.c: Include tree.h with a FIXME.
	(print_rtl_slim): Adjust dump_bb_info uses.
	* statistics.c (statistics_fini_pass_2): Use current_function_name
	to avoid including tree.h.
	(statistics_counter_event): Use function_name for the same reason.
	(statistics_histogram_event): Likewise.
	* tracer.c (tracer): Remove bogus gcc_assert.  Use brief_dump_cfg
	instead of dump_flow_info.
	* var-tracking.c (variable_tracking_main_1): Call dump_reg_info
	before dump_flow_info.
	* doc/cfg.texi: Update CFG documentation.
	* Makefile.in (RTL_H): Depend on FLAGS_H.
	(GIMPLE_H): Depend on TREE_H.
	(FUNCTION_H): Depend on VEC_H, vecir.h, INPUT_H and MACHMODE_H,
	but no longer on TREE_H.
	(C_COMMON_H): Depend on TREE_H.
	(cselib.o, cse.o, cfganal.o, loop-init.o, ira-conflicts.o,
	sched-deps.o, sched-vis.o): Fixup dependencies.

c-family/
	* c-common.h: Include tree.h.

cp/
	* decl.c (cp_finish_decl): Add FIXME at add_local_decl call site.

From-SVN: r189359
2012-07-08 10:06:14 +00:00
Steven Bosscher ca3f295026 output.h (split_double): Move prototype to rtl.h.
* output.h (split_double): Move prototype to rtl.h.
	(constructor_static_from_elts_p): Move prototype to tree.c.
	* rtl.h (split_double): Moved here from output.h.
	* tree.h (constructor_static_from_elts_p): Moved here from output.h.
	* final.c (split_double): Move from here ...
	* rtlanal.c (split_double): ... to here.
	* expr.c: Do not include output.h.

From-SVN: r188714
2012-06-17 21:12:24 +00:00
Steven Bosscher 78bde837ec cfglayout.h: Remove.
2012-06-17  Steven Bosscher  <steven@gcc.gnu.org>

	* cfglayout.h: Remove.
	* cfglayout.c: Remove.
	* function.h (struct function): Remove x_last_location field.
	* function.c: Do not include cfglayout.h.
	(expand_function_start): Do not call no-op force_next_line_note.
	(expand_function_end): Likewise.
	* cfgrtl.c: Do not include cfglayout.h.  Include gt-cfgrtl.h.
	(unlink_insn_chain): Moved here from cfglayout.c.
	(skip_insns_after_block, label_for_bb, record_effective_endpoints,
	into_cfg_layout_mode, outof_cfg_layout_mode,
	pass_into_cfg_layout_mode, pass_outof_cfg_layout_mode,
	relink_block_chain, fixup_reorder_chain, verify_insn_chain,
	fixup_fallthru_exit_predecessor, force_one_exit_fallthru,
	cfg_layout_can_duplicate_bb_p, duplicate_insn_chain,
	cfg_layout_duplicate_bb, cfg_layout_initialize, break_superblocks,
	cfg_layout_finalize): Likewise.
	(rtl_can_remove_branch_p): Likewise.
	* rtl.h (insn_scope): Move prototype from cfglayout.h here.
	(duplicate_insn_chain): Likewise.
	(force_next_line_note): Remove prototype.
	* emit-rtl.c: Do not include tree-flow.h, egad.  Include vecprim.h.
	(last_location): Remove #define to emit.x_last_location.
	(force_next_line_note): Remove no-op function.
	(init_emit): Don't set x_last_location.
	(block_locators_locs, block_locators_blocks, locations_locators_locs,
	locations_locators_vals, prologue_locator, epilogue_locator,
	curr_location, last_location, curr_block, last_block, curr_rtl_loc):
	Move POD to here from cfglayout.c.
	(insn_locators_alloc, insn_locators_finalize, insn_locators_free,
	set_curr_insn_source_location, get_curr_insn_source_location,
	set_curr_insn_block, get_curr_insn_block, curr_insn_locator,
	locator_scope, insn_scope, locator_location, locator_line, insn_line,
	locator_file, insn_file, locator_eq): Move to here from cfglayout.c.
	* cfghooks.h: Remove double-include protection.
	(can_copy_bbs_p, copy_bbs): Move prototypes from cfglayout.h to here.
	* cfghooks.c (can_copy_bbs_p, copy_bbs): Move to here from cfglayout.c.
	* final.c: Do not include cfglayout.h.
	(choose_inner_scope, change_scope): Move to here from cfglayout.c.
	(reemit_insn_block_notes): Likewise.  Make static.
	* tree-flow.h (tree_could_trap_p, operation_could_trap_helper_p,
	operation_could_trap_p, tree_could_throw_p): Move from here...
	* tree.h: ... to here.
	* gengtype.c (open_base_files): Remove cfglayout.h from the list.
	* profile.c: Do not include cfghooks.h.
	* cfgloopmanip.c: Do not include cfglayout.h and cfghooks.h.
	* modulo-sched.c: Likewise.
	* loop-unswitch.c: Do not include cfglayout.h.
	* sched-ebb.c: Likewise.
	* tracer.c: Likewise.
	* ddg.c: Likewise.
	* tree-vect-loop-manip.c: Likewise.
	* loop-init.c: Likewise.
	* dwarf2out.c: Likewise.
	* hw-doloop.c: Likewise.
	* loop-unroll.c: Likewise.
	* cfgcleanup.c: Likewise.
	* bb-reorder.c: Likewise.
	* sched-rgn.c: Likewise.
	* tree-cfg.c: Likewise.
	* config/alpha/alpha.c: Likewise.
	* config/spu/spu.c: Likewise.
	* config/sparc/sparc.c: Likewise.
	* config/sh/sh.c: Likewise.
	* config/c6x/c6x.c: Likewise.
	* config/ia64/ia64.c: Likewise.
	* config/rs6000/rs6000.c: Likewise.
	* config/score/score.c: Likewise.
	* config/mips/mips.c: Likewise.
	* config/bfin/bfin.c: Likewise.
	* Makefile.in (CFGAYOUT_H): Remove, and fixup users.
	* config/rs6000/t-rs6000 (rs6000.o): Do not depend on cfglayout.h.
	* config/spu/t-spu-elf (spu.o: $): Likewise.
	* config/sparc/t-sparc (sparc.o): Do not depend on CFGLAYOUT_H.

From-SVN: r188712
2012-06-17 21:08:39 +00:00
Steven Bosscher 46d33ae927 expmed.c (ceil_log2): Move from here...
* expmed.c (ceil_log2): Move from here...
	* hwint.c: ... to here for older GCCs...
	* hwint.h: ... and here for newer GCCs.
	* rtl.h (ceil_log2): Remove prototype.

	* tree-phinodes.c: Do not include rtl.h.
	* Makefile.in (tree-phinodes.o): Do not depend on RTL_H.

From-SVN: r188710
2012-06-17 21:01:25 +00:00
Richard Sandiford e80ccebcd8 regs.h (move_table, [...]): Move these definitions and associated target_globals fields to...
gcc/
	* regs.h (move_table, move_cost, may_move_in_cost, may_move_out_cost):
	Move these definitions and associated target_globals fields to...
	* ira-int.h: ...here.
	* rtl.h (init_move_cost): Delete.
	* reginfo.c (last_mode_for_init_move_cost, init_move_cost): Move to...
	* ira.c: ...here, making the latter static.

From-SVN: r188043
2012-05-31 05:29:47 +00:00
Michael Matz 9474e8ab4a rtl.h (assign_stack_temp, [...]): Remove 'keep' argument.
* rtl.h (assign_stack_temp, assign_stack_temp_for_type,
	assign_temp): Remove 'keep' argument.
	(mark_temp_addr_taken): Remove prototype.
	* tree.h (expand_decl): Remove prototype.
	* function.c (struct temp_slot): Remove addr_taken and keep
	member.
	(assign_stack_temp_for_type) Don't initialize above, remove
	keep argument.
	(assign_stack_temp, assign_temp): Remove keep argument.
	(mark_temp_addr_taken): Remove.
	(preserve_temp_slots): Remove handling of addr_taken and keep
	members.
	(free_temp_slots): Ditto.
	* expr.c (expand_expr_real_1 <COMPOUND_LITERAL_EXPR>): Remove
	dead code.
	* stmt.c (expand_asm_operands): Remove dead code.
	(expand_decl): Remove.
	* c-decl.c (finish_struct): Don't call expand_decl.
	* builtins.c (expand_builtin_cexpi): Adjust calls to assign_temp
	and assign_stack_temp.
	* calls.c (save_fixed_argument_area, initialize_argument_information,
	expand_call, emit_library_call_value_1, store_one_arg): Ditto.
	* expmed.c (extract_bit_field_1): Ditto.
	* expr.c (emit_group_load_1, emit_group_store,
	copy_blkmode_from_reg, emit_push_insn, expand_assignment,
	store_field, expand_constructor, expand_cond_expr_using_cmove,
	expand_expr_real_2, expand_expr_real_1): Ditto.
	* stmt.c (expand_asm_operands, expand_return): Ditto.

	* function.c (pop_temp_slots): Call free_temp_slots.
	* calls.c (store_one_arg): Don't call preserve_temp_slots or
	free_temp_slots.
	* expr.c (expand_assignment): Don't call free_temp_slots.

	* config/arm/arm.c (neon_expand_vector_init): Ditto.
	* config/i386/i386.c (ix86_expand_vector_set): Ditto.
	(ix86_expand_vector_extract): Ditto.
	* config/ia64/ia64.c (spill_xfmode_rfmode_operand,
	ia64_expand_movxf_movrf): Ditto.
	* config/mips/mips.c (mips_expand_vi_general): Ditto.
	* config/mmix/mmix.md (floatdisf2, floatunsdisf2, truncdfsf2,
	extendsfdf2): Ditto.
	* config/rs6000/rs6000.c (rs6000_expand_vector_init,
	rs6000_expand_vector_set, rs6000_expand_vector_extract,
	rs6000_allocate_stack_temp): Ditto.
	* config/rs6000/rs6000.md (fix_trunctfsi2_fprs): Ditto.
	* config/sparc/sparc.c (emit_soft_tfmode_libcall,
	sparc_emit_float_lib_cmp, sparc_emit_float_lib_cmp,
	sparc_expand_vector_init): Ditto.

From-SVN: r187965
2012-05-29 14:44:47 +00:00
Richard Sandiford 372d639526 re PR bootstrap/53249 (Bootstrap failure)
gcc/
	PR middle-end/53249
	* dwarf2out.h (get_address_mode): Move declaration to...
	* rtl.h: ...here.
	* dwarf2out.c (get_address_mode): Move definition to...
	* rtlanal.c: ...here.
	* var-tracking.c (get_address_mode): Delete.
	* combine.c (find_split_point): Use get_address_mode instead of
	targetm.addr_space.address_mode.
	* cselib.c (cselib_record_sets): Likewise.
	* dse.c (canon_address, record_store): Likewise.
	* emit-rtl.c (adjust_address_1, offset_address): Likewise.
	* expr.c (move_by_pieces, emit_block_move_via_loop, store_by_pieces)
	(store_by_pieces_1, expand_assignment, store_expr, store_constructor)
	(expand_expr_real_1): Likewise.
	* ifcvt.c (noce_try_cmove_arith): Likewise.
	* optabs.c (maybe_legitimize_operand_same_code): Likewise.
	* reload.c (find_reloads): Likewise.
	* sched-deps.c (sched_analyze_1, sched_analyze_2): Likewise.
	* sel-sched-dump.c (debug_mem_addr_value): Likewise.

From-SVN: r187320
2012-05-09 09:22:57 +00:00
Richard Sandiford 0a81f074cf rtl.h (plus_constant, [...]): Merge into a single plus_constant function.
gcc/
	* rtl.h (plus_constant, plus_constant_mode): Merge into a single
	plus_constant function.
	* explow.c (plus_constant, plus_constant_mode): Likewise.  Assert
	that the mode is sensible.
	(use_anchored_address, round_push, allocate_dynamic_stack_space)
	(probe_stack_range, anti_adjust_stack_and_probe): Update calls to
	plus_constant.

	* alias.c (canon_rtx): Likewise.
	(init_alias_analysis): Likewise.
	* builtins.c (expand_builtin_return_addr)
	(expand_builtin_setjmp_setup, expand_builtin_longjmp)
	(expand_builtin_nonlocal_goto, expand_builtin_update_setjmp_buf)
	(expand_builtin_apply_args_1, expand_builtin_apply, expand_movstr)
	(expand_builtin_stpcpy): Likewise.
	* calls.c (save_fixed_argument_area, restore_fixed_argument_area)
	(compute_argument_addresses, internal_arg_pointer_based_exp)
	(expand_call, emit_library_call_value_1): Likewise.
	* cfgexpand.c (expand_one_stack_var_at, expand_debug_expr): Likewise.
	* combine-stack-adj.c (try_apply_stack_adjustment): Likewise.
	* combine.c (combine_simplify_rtx, force_to_mode): Likewise.
	* cse.c (insert_const_anchor, find_reg_offset_for_const)
	(use_related_value, fold_rtx): Likewise.
	* cselib.c (cselib_subst_to_values): Likewise.
	* dse.c (record_store, check_mem_read_rtx): Likewise.
	* dwarf2out.c (rtl_for_decl_location, gen_variable_die): Likewise.
	* emit-rtl.c (adjust_address_1): Likewise.
	* except.c (sjlj_emit_function_enter)
	(expand_builtin_extract_return_addr)
	(expand_builtin_frob_return_addr): Likewise.
	* expmed.c (expand_divmod): Likewise.
	* expr.c (move_by_pieces, store_by_pieces, store_by_pieces_1)
	(emit_move_resolve_push, push_block, emit_push_insn, store_expr)
	(expand_expr_addr_expr_1, expand_expr_real_1): Likewise.
	* function.c (assign_stack_local_1)
	(instantiate_virtual_regs_in_rtx): Likewise.
	* optabs.c (prepare_cmp_insn): Likewise.
	* recog.c (offsettable_address_addr_space_p): Likewise.
	* reload.c (find_reloads_address, form_sum)
	(find_reloads_subreg_address): Likewise.
	* reload1.c (init_reload, eliminate_regs_1)
	(eliminate_regs_in_insn): Likewise.
	* simplify-rtx.c (simplify_unary_operation_1)
	(simplify_binary_operation_1, simplify_plus_minus): Likewise.
	* var-tracking.c (compute_cfa_pointer, prepare_call_arguments)
	(vt_add_function_parameter): Likewise.

	* config/alpha/alpha.h (EH_RETURN_HANDLER_RTX): Likewise.
	* config/alpha/vms.h (EH_RETURN_HANDLER_RTX): Likewise.
	* config/alpha/alpha.c (alpha_legitimize_address_1)
	(get_unaligned_address, alpha_expand_unaligned_load)
	(alpha_expand_unaligned_store, alpha_expand_unaligned_load_words)
	(alpha_expand_unaligned_store_words, alpha_expand_block_clear)
	(alpha_expand_builtin_establish_vms_condition_handler)
	(alpha_setup_incoming_varargs, emit_frame_store_1)
	(alpha_expand_prologue, alpha_expand_epilogue)
	(alpha_use_linkage): Likewise.
	* config/alpha/alpha.md: Likewise.

	* config/arm/arm.c (arm_trampoline_init, legitimize_pic_address)
	(arm_load_pic_register, arm_pic_static_addr, arm_legitimize_address)
	(thumb_legitimize_address, arm_gen_load_multiple_1)
	(arm_gen_store_multiple_1, arm_gen_multiple_op, gen_ldm_seq)
	(gen_stm_seq, gen_const_stm_seq, arm_block_move_unaligned_straight)
	(arm_block_move_unaligned_loop, arm_gen_movmemqi, arm_reload_in_hi)
	(arm_reload_out_hi, arm_reorg, vfp_emit_fstmd, emit_multi_reg_push)
	(emit_sfm, thumb_set_frame_pointer, arm_expand_prologue)
	(thumb1_emit_multi_reg_push, thumb1_expand_prologue)
	(thumb_expand_movmemqi, arm_set_return_address)
	(thumb_set_return_address): Likewise.
	* config/arm/arm.md: Likewise.

	* config/avr/avr.c (avr_incoming_return_addr_rtx)
	(avr_prologue_setup_frame, expand_epilogue)
	(avr_const_address_lo16): Likewise.

	* config/bfin/bfin.h (EH_RETURN_HANDLER_RTX): Likewise.
	* config/bfin/bfin.c (setup_incoming_varargs, bfin_load_pic_reg)
	(bfin_expand_prologue, bfin_trampoline_init, bfin_expand_call)
	(bfin_output_mi_thunk): Likewise.

	* config/c6x/c6x.c (c6x_initialize_trampoline)
	(c6x_output_mi_thunk): Likewise.

	* config/cr16/cr16.h (EH_RETURN_HANDLER_RTX): Likewise.
	* config/cr16/cr16.c (cr16_create_dwarf_for_multi_push): Likewise.

	* config/cris/cris.c (cris_return_addr_rtx, cris_split_movdx)
	(cris_expand_prologue, cris_expand_epilogue, cris_gen_movem_load)
	(cris_emit_movem_store, cris_trampoline_init): Likewise.
	* config/cris/cris.md: Likewise.

	* config/darwin.c (machopic_indirect_data_reference)
	(machopic_legitimize_pic_address): Likewise.

	* config/epiphany/epiphany.c (epiphany_emit_save_restore)
	(epiphany_expand_prologue, epiphany_expand_epilogue)
	(epiphany_trampoline_init): Likewise.
	* config/epiphany/epiphany.md: Likewise.

	* config/fr30/fr30.c (fr30_move_double): Likewise.

	* config/frv/frv.c (frv_dwarf_store, frv_expand_prologue)
	(frv_expand_block_move, frv_expand_block_clear, frv_return_addr_rtx)
	(frv_index_memory, unspec_got_name, frv_find_base_term)
	(frv_output_dwarf_dtprel): Likewise.

	* config/h8300/h8300.c (h8300_push_pop, h8300_return_addr_rtx)
	(h8300_swap_into_er6, h8300_swap_out_of_er6): Likewise.

	* config/i386/i386.h (RETURN_ADDR_RTX): Likewise.
	* config/i386/i386.c (setup_incoming_varargs_64)
	(setup_incoming_varargs_ms_64, choose_baseaddr)
	(ix86_emit_save_reg_using_mov, ix86_adjust_stack_and_probe)
	(ix86_emit_probe_stack_range, ix86_expand_prologue)
	(ix86_emit_restore_reg_using_pop, ix86_emit_leave)
	(ix86_expand_epilogue, legitimize_pic_address, ix86_legitimize_address)
	(ix86_split_long_move, ix86_expand_movmem, ix86_expand_setmem)
	(ix86_static_chain, ix86_trampoline_init, x86_this_parameter)
	(x86_output_mi_thunk): Likewise.
	* config/i386/i386.md: Likewise.

	* config/ia64/ia64.c (ia64_expand_load_address)
	(ia64_expand_tls_address, ia64_expand_move, ia64_split_tmode)
	(do_spill, ia64_trampoline_init): Likewise.

	* config/iq2000/iq2000.c (iq2000_va_start)
	(iq2000_emit_frame_related_store, iq2000_expand_prologue)
	(iq2000_expand_eh_return, iq2000_setup_incoming_varargs)
	(iq2000_print_operand, iq2000_legitimize_address): Likewise.

	* config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise.

	* config/m32c/m32c.c (m32c_return_addr_rtx)
	(m32c_expand_insv): Likewise.

	* config/m32r/m32r.c (m32r_setup_incoming_varargs)
	(m32r_legitimize_pic_address, m32r_print_operand)
	(m32r_print_operand_address): Likewise.

	* config/m68k/linux.h (FINALIZE_TRAMPOLINE): Likewise.
	* config/m68k/m68k.h (RETURN_ADDR_RTX): Likewise.
	(EH_RETURN_HANDLER_RTX): Likewise.
	* config/m68k/m68k.c (m68k_emit_movem, m68k_expand_prologue)
	(m68k_expand_epilogue, legitimize_pic_address)
	(m68k_output_mi_thunk): Likewise.
	* config/m68k/m68k.md: Likewise.

	* config/mcore/mcore.c (mcore_expand_prolog): Likewise.
	(mcore_expand_epilog): Likewise.
	* config/mcore/mcore.md: Likewise.

	* config/mep/mep.c (mep_allocate_initial_value)
	(mep_expand_prologue, mep_expand_epilogue): Likewise.

	* config/microblaze/microblaze.c (double_memory_operand)
	(microblaze_block_move_loop): Likewise.

	* config/mips/mips.c (mips_strip_unspec_address, mips_add_offset)
	(mips_setup_incoming_varargs, mips_va_start, mips_block_move_loop)
	(mips_print_operand, mips16e_save_restore_reg, mips_save_restore_reg)
	(mips_expand_prologue, mips_epilogue_set_cfa)
	(mips_expand_epilogue): Likewise.
	* config/mips/mips.md: Likewise.

	* config/mmix/mmix.c (mmix_dynamic_chain_address, mmix_return_addr_rtx)
	(mmix_expand_prologue, mmix_expand_epilogue): Likewise.

	* config/mn10300/mn10300.c (mn10300_gen_multiple_store)
	(mn10300_builtin_saveregs, mn10300_trampoline_init): Likewise.

	* config/moxie/moxie.h (INCOMING_RETURN_ADDR_RTX): Likewise.
	(EH_RETURN_HANDLER_RTX): Likewise.
	* config/moxie/moxie.c (moxie_static_chain): Likewise.

	* config/pa/pa.c (legitimize_pic_address, hppa_legitimize_address)
	(store_reg, set_reg_plus_d, pa_expand_prologue, load_reg)
	(pa_return_addr_rtx, hppa_builtin_saveregs)
	(pa_trampoline_init): Likewise.
	* config/pa/pa.md: Likewise.

	* config/pdp11/pdp11.c (pdp11_expand_epilogue): Likewise.

	* config/picochip/picochip.c (picochip_static_chain): Likewise.

	* config/rs6000/rs6000.h (RS6000_SAVE_TOC): Likewise.
	* config/rs6000/rs6000.c (rs6000_legitimize_address)
	(setup_incoming_varargs, print_operand, rs6000_return_addr)
	(rs6000_emit_eh_reg_restore, rs6000_emit_probe_stack_range)
	(rs6000_emit_epilogue)
	(rs6000_machopic_legitimize_pic_address): Likewise.

	* config/rx/rx.c (gen_rx_rtsd_vector, gen_rx_popm_vector): Likewise.

	* config/s390/s390.h (INITIAL_FRAME_ADDRESS_RTX): Likewise.
	(DYNAMIC_CHAIN_ADDRESS): Likewise.
	* config/s390/s390.c (s390_decompose_address, legitimize_pic_address)
	(s390_delegitimize_address, print_operand, annotate_constant_pool_refs)
	(replace_constant_pool_ref, s390_return_addr_rtx, s390_back_chain_rtx)
	(save_fpr, restore_fpr, save_gprs, restore_gprs, s390_emit_prologue)
	(s390_emit_epilogue, s390_function_profiler): Likewise.
	* config/s390/s390.md: Likewise.

	* config/score/score.c (score_add_offset, score_prologue): Likewise.

	* config/sh/sh.c (expand_block_move, push_regs, sh_builtin_saveregs)
	(sh_output_mi_thunk): Likewise.
	* config/sh/sh.md: Likewise.

	* config/sparc/sparc.h (DYNAMIC_CHAIN_ADDRESS, FRAME_ADDR_RTX)
	(RETURN_ADDR_RTX, INCOMING_RETURN_ADDR_RTX): Likewise.
	* config/sparc/sparc.c (sparc_legitimize_pic_address)
	(sparc_emit_probe_stack_range, emit_save_or_restore_regs)
	(emit_window_save, sparc_flat_expand_prologue, sparc_struct_value_rtx)
	(emit_and_preserve): Likewise.
	* config/sparc/sparc.md: Likewise.

	* config/spu/spu.h (DYNAMIC_CHAIN_ADDRESS): Likewise.
	* config/spu/spu.c (spu_expand_insv, spu_machine_dependent_reorg)
	(spu_setup_incoming_varargs, ea_load_store_inline)
	(spu_expand_load): Likewise.

	* config/stormy16/stormy16.c (xstormy16_expand_prologue)
	(combine_bnp): Likewise.

	* config/tilegx/tilegx.h (DYNAMIC_CHAIN_ADDRESS): Likewise.
	* config/tilegx/tilegx.c (tilegx_setup_incoming_varargs)
	(tilegx_expand_unaligned_load, tilegx_trampoline_init): Likewise.

	* config/tilepro/tilepro.h (DYNAMIC_CHAIN_ADDRESS): Likewise.
	* config/tilepro/tilepro.c (tilepro_setup_incoming_varargs)
	(tilepro_expand_unaligned_load, tilepro_trampoline_init): Likewise.

	* config/v850/v850.c (expand_prologue, expand_epilogue): Likewise.
	* config/v850/v850.md: Likewise.

	* config/vax/elf.h (EH_RETURN_STACKADJ_RTX): Likewise.
	(EH_RETURN_HANDLER_RTX): Likewise.
	* config/vax/vax.h (DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX): Likewise.
	* config/vax/vax.c (vax_add_reg_cfa_offset, vax_expand_prologue)
	(print_operand_address, vax_trampoline_init): Likewise.

	* config/xtensa/xtensa.c (xtensa_expand_prologue, xtensa_return_addr)
	(xtensa_function_value_regno_p): Likewise.

From-SVN: r187199
2012-05-05 17:41:49 +00:00
Kenneth Zadeck af4ba42308 Makefile.in (lower-subreg.o, [...]): Depend on lower-subreg.h.
gcc/
2012-03-31  Kenneth Zadeck  <zadeck@naturalbridge.com>
	    Richard Sandiford  <r.sandiford@uk.ibm.com>

	* Makefile.in (lower-subreg.o, target-globals.o): Depend on
	lower-subreg.h.
	* lower-subreg.h: New file.
	* target-globals.h (this_target_lower_subreg): Declare.
	(target_globals): Add lower_subreg;
	(restore_target_globals): Restore this_target_lower_subreg.
	* target-globals.c: Include it.
	(default_target_globals): Add default_target_lower_subreg.
	(save_target_globals): Initialize target_lower_subreg.
	* rtl.h (init_lower_subreg): Added declaration.
	* toplev.c (backend_init_target): Call initializer for lower-subreg
	pass.
	* lower-subreg.c (LOG_COSTS, FORCE_LOWERING): New macros.
	(default_target_lower_subreg): New variable.
	(this_target_lower_subreg): Likewise.
	(twice_word_mode, choices): New macros.
	(shift_cost, compute_splitting_shift, compute_costs)
	(init_lower_subreg): New functions.
	(resolve_simple_move): Add speed_p argument.  Check choices.
	(find_pseudo_copy): Don't check the mode size here.
	(resolve_simple_move): Assert the mode size.
	(find_decomposable_shift_zext): Add speed_p argument and return
	a bool.  Check choices.
	(resolve_shift_zext): Add comment.
	(dump_shift_choices, dump_choices): New functions.
	(decompose_multiword_subregs): Dump list of profitable
	transformations.  Add code to skip non profitable transformations.
	Update calls to simple_move and find_decomposable_shift_zext.

Co-Authored-By: Richard Sandiford <r.sandiford@uk.ibm.com>

From-SVN: r187015
2012-05-01 14:45:24 +00:00
Richard Sandiford 9e412ca3eb re PR bootstrap/53021 (bootstrap failure on Linux/ia32)
gcc/
	PR bootstrap/53021
	* rtl.def (ADDRESS): Use "i" rather than "w".
	* rtl.h (find_base_term): Delete.
	(may_be_sp_based_p): Declare.
	* rtl.c (rtx_code_size): Remove ADDRESS special case.
	* alias.h (UNIQUE_BASE_VALUE_SP, UNIQUE_BASE_VALUE_ARGP)
	(UNIQUE_BASE_VALUE_FP, UNIQUE_BASE_VALUE_HFP): Move to...
	* alias.c: ...here.
	(find_base_term): Make static.
	(may_be_sp_based_p): New function.
	* dse.c (record_store): Use it.
	* store-motion.c (store_killed_in_insn): Likewise.

From-SVN: r186657
2012-04-21 18:55:18 +00:00
Tom de Vries 03fbe718cb cfgcleanup.c (try_optimize_cfg): Replace call to delete_insn_chain by call to delete_insn.
2012-04-14  Tom de Vries  <tom@codesourcery.com>

	* cfgcleanup.c (try_optimize_cfg): Replace call to delete_insn_chain by
	call to delete_insn.  Remove code to reorder BASIC_BLOCK note and
	DELETED_LABEL note, and move it to ...
	* cfgrtl.c (delete_insn): ... here.  Change return type to void.
	(delete_insn_and_edges): Likewise.
	(delete_insn_chain): Handle new return type of delete_insn.  Delete
	chain backwards rather than forwards.
	* rtl.h (delete_insn, delete_insn_and_edges): Change return type to
	void.
	* cfglayout.c (fixup_reorder_chain): Delete unused label.

From-SVN: r186451
2012-04-14 12:17:41 +00:00
Peter Bergner 7bc14a04f2 re PR target/16458 (PowerPC - redundant compare)
gcc/
	PR target/16458
	* rtlanal.c (unsigned_reg_p): New function.
	Update copyright notice dates.
	* rtl.h (unsigned_reg_p): Prototype it.
	Update copyright notice dates.
	* config/rs6000/rs6000.c (rs6000_generate_compare): Use it.
	Update comment.
	* expr.c (expand_expr_real_1): Set register attributes.
	* stmt.c (expand_case): Likewise.

gcc/testsuite/
	PR target/16458
	* gcc.target/powerpc/pr16458-1.c: New test.
	* gcc.target/powerpc/pr16458-2.c: Likewise.
	* gcc.target/powerpc/pr16458-3.c: Likewise.
	* gcc.target/powerpc/pr16458-4.c: Likewise.

Co-Authored-By: Michael Matz <matz@suse.de>

From-SVN: r186312
2012-04-11 06:51:50 -05:00
Mike Stump 929e10f4cf rtl.texi (const_double): Document as sign-extending.
* doc/rtl.texi (const_double): Document as sign-extending.
	* expmed.c (expand_mult): Ensure we don't use shift
	incorrectly.
	* emit-rtl.c (immed_double_int_const): Refine to state the
	value is signed.
	* simplify-rtx.c (mode_signbit_p): Add a fixme for wider than
	CONST_DOUBLE integers.
	(simplify_const_unary_operation, UNSIGNED_FLOAT): Ensure no
	negative values are converted.  Fix conversions bigger than
	HOST_BITS_PER_WIDE_INT.
	(simplify_binary_operation_1): Ensure we don't use shift
	incorrectly.
	(simplify_immed_subreg): Sign-extend CONST_DOUBLEs.
	* explow.c (plus_constant_mode): Add.
	(plus_constant): Implement with plus_constant_mode.
	* rtl.h (plus_constant_mode): Add.

From-SVN: r186147
2012-04-04 20:27:17 +00:00
Uros Bizjak 5bd5034e24 Partially revert:
2012-03-29  Richard Guenther  <rguenther@suse.de>

	* rtl.h (extended_count): Remove.
	* combine.c (extended_count): Remove.

From-SVN: r186077
2012-04-02 12:04:10 +02:00
Richard Guenther 711417cd3b cgraph.h (cgraph_materialize_all_clones): Remove.
2012-03-29  Richard Guenther  <rguenther@suse.de>

	* cgraph.h (cgraph_materialize_all_clones): Remove.
	(reset_inline_failed): Likewise.
	* cgraphunit.c (cgraph_materialize_all_clones): Make static.
	* cgraphbuild.c (reset_inline_failed): Remove.
	* rtl.h (cse_main): Remove.
	(extended_count): Likewise.
	* cse.c (dump_class): Mark as DEBUG_FUNCTION.
	(cse_main): Make static.
	* combine.c (extended_count): Remove.
	(dump_combine_stats): Mark as DEBUG_FUNCTION.
	* basic-block.h (reorder_basic_blocks): Remove.
	* bb-reorder.c (reorder_basic_blocks): Make static.
	* Makefile.in (dse.o): Remove dse.h dependency.
	* dse.h: Remove.
	* dse.c (gate_dse): Remove.
	(clear_alias_mode_eq): Likewise.
	(clear_alias_mode_hash): Likewise.
	(dse_record_singleton_alias_set): Likewise.
	(dse_invalidate_singleton_alias_set): Likewise.

From-SVN: r185962
2012-03-29 13:54:16 +00:00