Commit Graph

1102 Commits

Author SHA1 Message Date
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
Richard Sandiford 788284ef35 re PR middle-end/52515 (build fails on cris-elf in unwind-dw2.c, x86_64-unknown-linux-gnu in bid_binarydecimal.c)
gcc/
	PR middle-end/52515
	* rtl.h (pc_rtx, cc0_rtx, ret_rtx, simple_return_rtx): Add GTY markers.

From-SVN: r185028
2012-03-07 09:50:36 +00:00
Richard Sandiford ca4adc913d re PR middle-end/52372 (gcc.target/mips/mips16-attributes{,-4}.c SEGV in dwf_regno)
gcc/
	PR middle-end/52372
	* rtl.h (pc_rtx, ret_rtx, simple_return_rtx, cc0_rtx): Redefine as
	variables.
	(GR_PC, GR_CC0, GR_RETURN, GR_SIMPLE_RETURN): Delete.
	* emit-rtl.c (pc_rtx, ret_rtx, simple_return_rtx, cc0_rtx): New
	variables.
	(init_emit_regs): Move associated initialization to...
	(init_emit_once): ...here.

From-SVN: r185013
2012-03-06 19:22:10 +00:00
Richard Sandiford 5535633407 rtl.texi (MEM_IN_STRUCT_P, [...]): Delete.
gcc/
	* doc/rtl.texi (MEM_IN_STRUCT_P, MEM_SCALAR_P): Delete.
	(in_struct, return_val): Remove MEM documentation.
	* rtl.h (rtx_def): Remove MEM meanings from in_struct and return_val.
	(MEM_IN_STRUCT_P, MEM_SCALAR_P): Delete.
	(MEM_COPY_ATTRIBUTES): Remove references to MEM_IN_STRUCT_P
	and MEM_SCALAR.
	* emit-rtl.c (set_mem_attributes_minus_bitpos): Likewise.
	* cfgexpand.c (add_alias_set_conflicts): Likewise.
	* expr.c (store_field): Likewise.
	* function.c (assign_stack_temp_for_type): Likewise.
	* ifcvt.c (noce_try_cmove_arith): Likewise.
	* reload1.c (reload): Likewise.
	* config/alpha/alpha.c (alpha_set_memflags_1): Likewise.
	(alpha_set_memflags): Likewise.
	* config/m32c/m32c.c (m32c_immd_dbl_mov): Nullify.

gcc/testsuite/
	* gcc.dg/memcpy-4.c: Don't expect /s on MEMs.

From-SVN: r183486
2012-01-24 19:06:38 +00:00
Richard Sandiford 53d9622bda rtl.h (true_dependence, [...]): Remove varies parameter.
gcc/
	* rtl.h (true_dependence, canon_true_dependence): Remove varies
	parameter.
	* alias.c (fixed_scalar_and_varying_struct_p): Delete.
	(true_dependence_1, write_dependence_p, may_alias_p): Don't call it.
	(true_dependence_1, true_dependence, canon_true_dependence): Remove
	varies parameter.
	* cselib.c (cselib_rtx_varies_p): Delete.
	(cselib_invalidate_mem): Update call to canon_true_dependence.
	* dse.c (record_store, check_mem_read_rtx): Likewise.
	(scan_reads_nospill): Likewise.
	* cse.c (check_dependence): Likewise.
	(cse_rtx_varies_p): Delete.
	* expr.c (safe_from_p): Update call to true_dependence.
	* ira.c (validate_equiv_mem_from_store): Likewise.
	(memref_referenced_p): Likewise.
	* postreload-gcse.c (find_mem_conflicts): Likewise.
	* sched-deps.c (sched_analyze_2): Likewise.
	* store-motion.c (load_kills_store): Likewise.
	* config/frv/frv.c (frv_registers_conflict_p_1): Likewise.
	* gcse.c (mems_conflict_for_gcse_p): Likewise.
	(compute_transp): Update call to canon_true_dependence.

From-SVN: r183485
2012-01-24 19:03:33 +00:00
Joern Rennecke 7543f91816 re PR middle-end/40154 (internal compiler error: in do_SUBST, at combine.c:681)
PR middle-end/40154
        * emit-rtl.c (set_dst_reg_note): New function.
        * rtl.h (set_dst_reg_note): Declare.
        * optabs.c (expand_binop, expand_absneg_bit): Use set_dst_reg_note.
        (emit_libcall_block, expand_fix): Likewise.
        * function.c (assign_parm_setup_reg, expand_function_start): Likewise.
        * expmed.c (expand_mult_const, expand_divmod): Likewise.
        * reload1.c (gen_reload): Likewise.

From-SVN: r182162
2011-12-09 12:57:24 +00:00
Joern Rennecke 9e582b1da0 regset.h (fixed_reg_set_regset): Declare.
* regset.h (fixed_reg_set_regset): Declare.
        * dse.c: Include regset.h .
        (struct insn_info): Add member fixed_regs_live.
        (note_add_store_info): New typedef.
        (note_add_store): New function.
        (emit_inc_dec_insn_before): Expect arg to be of type insn_info_t .
        Use gen_add3_insn / gen_move_insn.
        Check new insn for unwanted clobbers before emitting it.
        (check_for_inc_dec): Rename to...
        (check_for_inc_dec_1:) ... this.  Return bool.  Take insn_info
        parameter.  Changed all callers in file.
        (check_for_inc_dec, copy_fixed_regs): New functions.
        (scan_insn): Set fixed_regs_live field of insn_info.
        * rtl.h (check_for_inc_dec): Update prototype.
        * postreload.c (reload_cse_simplify): Take new signature of
        check_ind_dec into account.
        * reginfo.c (fixed_reg_set_regset): New variable.
        (init_reg_sets_1): Initialize it.

Co-Authored-By: Eric Botcazou <ebotcazou@adacore.com>

From-SVN: r181046
2011-11-06 22:58:54 +00:00
David S. Miller dbeee82924 Properly limit backwards label scanning in reorg.
* reorg.c (label_before_next_insn): New function.
	(relax_delay_slots): Use it instead of prev_label.
	* rtl.h (prev_label): Delete declaration.
	* emit-rtl.c (prev_label): Remove.

From-SVN: r180674
2011-10-30 00:48:05 -07:00
Bernd Schmidt e2724e63c6 reg-notes.def (DEP_CONTROL): New.
* reg-notes.def (DEP_CONTROL): New.
	* sched-ebb.c (add_deps_for_risky_insns): Add a REG_DEP_CONTROL when
	not doing speculation.
	* rtlanal.c (record_hard_reg_sets, find_all_hard_reg_sets,
	record_hard_reg_uses_1, record_hard_reg_uses): New functions.
	* function.c (record_hard_reg_sets, record_hard_reg_uses,
	record_hard_reg_uses_1): Remove; move to rtlanal.c.
	* lists.c (copy_INSN_LIST, concat_INSN_LIST): New functions.
	* haifa-sched.c: Swap includes of "rtl.h" and "hard-reg-set.h".
	(MUST_RECOMPUTE_SPEC_P): New macro.
	(real_insn_for_shadow): New function.
	(cond_clobbered_p, recompute_todo_spec, check_clobbered_conditions,
	toggle_cancelled_flags): New static functions.
	(schedule_insn): Relax an assert to only check for empty hard back
	dependencies.  Skip cancelled dependencies.  Call
	check_clobbered_conditions.
	(copy_insn_list): Remove function, renamed moved to lists.c.
	(save_backtrack_point): Use new spelling copy_INSN_LIST.
	(unschedule_insns_until): Ensure TODO_SPEC is reset properly.
	(restore_last_backtrack_point): Likewise.  Call toggle_cancelled_flags.
	(estimate_insn_tick): Ignore cancelled dependencies.
	(haifa_speculate_insn): Move declaration.
	(try_ready): Move code into recompute_todo_spec and call it.  Tweak
	some asserts.  Ensure predicated patterns are restored if necessary.
	Dump DEP_CONTROL flag.
	(haifa_change_pattern): Merge with sched_change_pattern.
	(sched_change_pattern): Remove function.
	* sched-deps.c (NON_FLUSH_JUMP_KIND, NON_FLUSH_JUMP): Remove.  All
	uses changed to simply not test NON_FLUSH_JUMP_P.
	(ds_to_dk, dk_to_ds, dump_dep, ds_to_dt, dump_ds, check_dep): Handle
	REG_DEP_CONTROL.
	(dep_spec_p): If DO_PREDICATION, REG_DEP_CONTROL is speculative.
	(reg_pending_control_uses, control_dependency_cache): New static
	variables.
	(sched_get_reverse_condition_uncached): New function.
	(sd_find_dep_between): Remove pointless assert.  Look in
	control_dependency_cache.
	(ask_dependency_caches, set_dependency_caches, sd_delete_dep,
	extend_dependency_caches, sched_deps_finish): Handle REG_DEP_CONTROL
	and control_dependency_cache.
	(sd_unresolve_dep): Use dep_spec_p.
	(add_dependence): Now a wrapper around add_dependence_1, handling
	REG_DEP_CONTROL specially.
	(flush_pending_lists): Clear pending_jump_insns.
	(sched_analyze_1): Handle pending_jump_insns like a memory flush.
	(sched_analyze_2): Unconditionally add to pending memory flushes,
	keep previous behaviour but apply it to pending_jump_insns instead.
	(sched_analyze_insn): Defer adding jump reg dependencies using
	reg_pending_control_uses; add them to the control_uses list.  Handle
	pending_jump_insns and control_uses when adding dependence lists.
	(deps_analyze_insn): Update INSN_COND_DEPS.
	(deps_analyze_insn): Add jumps to pending_jump_insns rather than
	last_pending_memory_flush.
	(init_deps): Initialize pending_jump_insns.
	(free_deps): Free control_uses.
	(remove_from_deps): Remove from pending_jump_insns.
	(init_deps_global): Allocate reg_pending_control_uses).
	(finish_deps_global): Free it.
	(add_dependence_1): Renamed from add_dependence.  Handle
	REG_DEP_CONTROL.
	* rtl.h (record_hard_reg_uses, find_all_hard_reg_sets): Declare.
	(copy_INSN_LIST, concat_INSN_LIST): Declare.
	* sched-int.h (struct deps_reg): Add control_uses.
	(struct deps_desc): Add pending_jump_insns.
	(struct _haifa_deps_insn_data): Add cond_deps.
	(struct _haifa_insn_data): Add must_recompute_spec and predicated_pat.
	(INSN_COND_DEPS, PREDICATED_PAT): New macros.
	(BITS_PER_DEP_WEAK): Adjust for two extra bits in the word.
	(DEP_CONTROL): New macro.
	(DEP_TYPES): Include it.
	(HARD_DEP): Adjust definition.
	(DEP_CANCELLED): New macro.
	(enum SCHED_FLAGS): Add DO_PREDICATION.
	(sched_get_reverse_condition_uncached, real_insn_for_shadow): Declare.
	* sched-rgn.c (concat_INSN_LIST): Remove function.
	(deps_join): Handle pending_jump_insns.
	(free_pending_lists): Likewise.
	* config/c6x/c6x.c (c6x_set_sched_flags): Set DO_PREDICATION for final
	schedule.

From-SVN: r180302
2011-10-21 13:35:44 +00:00
Alexandre Oliva 09dbcd96d6 re PR middle-end/49310 (Compile time hog in var-tracking emit)
PR debug/49310
* var-tracking.c (loc_exp_dep, onepart_aux): New structs.
(variable_part): Replace offset with union.
(enum onepart_enum, onepart_enum_t): New.
(variable_def): Drop cur_loc_changed, add onepart.
(value_chain_def, const_value_chain): Remove.
(VAR_PART_OFFSET, VAR_LOC_1PAUX): New macros, with checking.
(VAR_LOC_DEP_LST, VAR_LOC_DEP_LSTP): New macros.
(VAR_LOC_FROM, VAR_LOC_DEPTH, VAR_LOC_DEP_VEC): Likewise.
(value_chain_pool, value_chains): Remove.
(dropped_values): New.
(struct parm_reg): Only if HAVE_window_save.
(vt_stack_adjustments): Don't record register arguments.
(dv_as_rtx): New.
(dv_onepart_p): Return a onepart_enum_t.
(onepart_pool): New.
(dv_pool): Remove.
(dv_from_rtx): New.
(variable_htab_free): Release onepart aux data.  Reset flags.
(value_chain_htab_hash, value_chain_htab_eq): Remove.
(unshare_variable): Use onepart field.  Propagate onepart aux
data or offset.  Drop cur_loc_changed.
(val_store): Cope with NULL insn.  Rephrase dump output.  Check
for unsuitable locs.  Add FIXME on using cselib locs.
(val_reset): Remove FIXME of unfounded concerns.
(val_resolve): Check for unsuitable locs.  Add FIXME on using
cselib locs.
(variable_union): Use onepart field, adjust access to offset.
(NO_LOC_P): New.
(VALUE_CHANGED, DECL_CHANGED): Update doc.
(set_dv_changed): Clear NO_LOC_P when changed.
(find_loc_in_1pdv): Use onepart field.
(intersect_loc_chains): Likewise.
(unsuitable_loc): New.
(loc_cmp): Keep ENTRY_VALUEs at the end of the loc list.
(add_value_chain, add_value_chains): Remove.
(add_cselib_value_chains, remove_value_chain): Likewise.
(remove_value_chains, remove_cselib_value_chains): Likewise.
(canonicalize_loc_order_check): Use onepart.  Drop cur_loc_changed.
(canonicalize_values_star, canonicalize_vars_star): Use onepart.
(variable_merge_over_cur): Likewise.  Adjust access to offset.
Drop cur_loc_changed.
(variable_merge_over_src): Use onepart field.
(remove_duplicate_values): Likewise.
(variable_post_merge_new_vals): Likewise.
(find_mem_expr_in_1pdv): Likewise.
(dataflow_set_preserve_mem_locs): Likewise.  Drop cur_loc_changed
and value chains.
(dataflow_set_remove_mem_locs): Likewise.  Use VAR_LOC_FROM.
(variable_different_p): Use onepart field.  Move onepart test out
of the loop.
(argument_reg_set): Drop.
(add_uses, add_stores): Preserve but do not record in dynamic
tables equivalences for ENTRY_VALUEs and CFA_based addresses.
Avoid unsuitable address expressions.
(EXPR_DEPTH): Unlimit.
(EXPR_USE_DEPTH): Repurpose PARAM_MAX_VARTRACK_EXPR_DEPTH.
(prepare_call_arguments): Use DECL_RTL_IF_SET.
(dump_var): Adjust access to offset.
(variable_from_dropped, recover_dropped_1paux): New.
(variable_was_changed): Drop cur_loc_changed.  Use onepart.
Preserve onepart aux in empty_var.  Recover empty_var and onepart
aux from dropped_values.
(find_variable_location_part): Special-case onepart.  Adjust
access to offset.
(set_slot_part): Use onepart.  Drop cur_loc_changed.  Adjust
access to offset.  Initialize onepaux.  Drop value chains.
(delete_slot_part): Drop value chains.  Use VAR_LOC_FROM.
(VEC (variable, heap), VEC (rtx, stack)): Define.
(expand_loc_callback_data): Drop dummy, cur_loc_changed,
ignore_cur_loc.  Add expanding, pending, depth.
(loc_exp_dep_alloc, loc_exp_dep_clear): New.
(loc_exp_dep_insert, loc_exp_dep_set): New.
(notify_dependents_of_resolved_value): New.
(update_depth, vt_expand_var_loc_chain): New.
(vt_expand_loc_callback): Revamped.
(resolve_expansions_pending_recursion): New.
(INIT_ELCD, FINI_ELCD): New.
(vt_expand_loc): Use the new macros above.  Drop ignore_cur_loc
parameter, adjust all callers.
(vt_expand_loc_dummy): Drop.
(vt_expand_1pvar): New.
(emit_note_insn_var_location): Operate on non-debug decls only.
Revamp multi-part cur_loc recomputation and one-part expansion.
Drop cur_loc_changed.  Adjust access to offset.
(VEC (variable, heap)): Drop.
(changed_variables_stack, changed_values_stack): Drop.
(check_changed_vars_0, check_changed_vars_1): Remove.
(check_changed_vars_2, check_changed_vars_3): Remove.
(values_to_stack, remove_value_from_changed_variables): New.
(notify_dependents_of_changed_value, process_changed_values): New.
(emit_notes_for_changes): Revamp onepart updates.
(emit_notes_for_differences_1): Use onepart.  Drop cur_loc_changed
and value chains.  Propagate onepaux.  Recover empty_var and onepaux
from dropped_values.
(emit_notes_for_differences_2): Drop value chains.
(emit_notes_in_bb): Adjust.
(vt_emit_notes): Drop value chains, changed_variables_stack.
Initialize and release dropped_values.
(create_entry_value): Revamp.
(vt_add_function_parameter): Use new interface.
(note_register_arguments): Remove.
(vt_initialize): Drop value chains and register arguments.
(vt_finalize): Drop value chains.  Release windowed_parm_regs only
if HAVE_window_save.
* rtl.h: Document various pass-local uses of RTL flags.
* tree.h (DECL_RTL_KNOWN_SET): New.
* doc/invoke.texi (param max-vartrack-expr-depth): Update
description and default.

From-SVN: r180194
2011-10-19 15:50:00 +00:00
Alan Modra 387748de2f re PR rtl-optimization/49941 (segmentation fault in redirect_jump_2)
PR rtl-optimization/49941
	* jump.c (mark_jump_label_1): Set JUMP_LABEL for simple_return jumps.

	* rtl.h (set_return_jump_label): Declare.
	* function.c (set_return_jump_label): New function, extracted..
	(thread_prologue_and_epilogue_insns): ..from here.  Use it in
	another instance to set return jump_label.
	* cfgrtl.c (force_nonfallthru_and_redirect): Use set_return_jump_label.
	* reorg.c (find_end_label): Likewise.

From-SVN: r180027
2011-10-15 21:02:33 +10:30
Jakub Jelinek e7c82a9925 rtl.h (const_tiny_rtx): Change into array of 4 x MAX_MACHINE_MODE from 3 x MAX_MACHINE_MODE.
* rtl.h (const_tiny_rtx): Change into array of 4 x MAX_MACHINE_MODE
	from 3 x MAX_MACHINE_MODE.
	(CONSTM1_RTX): Define.
	* emit-rtl.c (const_tiny_rtx): Change into array of 4 x MAX_MACHINE_MODE
        from 3 x MAX_MACHINE_MODE.
	(gen_rtx_CONST_VECTOR): Use CONSTM1_RTX if all inner constants are
	CONSTM1_RTX.
	(init_emit_once): Initialize CONSTM1_RTX for MODE_INT and
	MODE_VECTOR_INT modes.
	* simplify-rtx.c (simplify_binary_operation_1) <case IOR, XOR, AND>:
	Optimize if one operand is CONSTM1_RTX.
	* config/i386/i386.c (ix86_expand_sse_movcc): Optimize mask ? -1 : x
	into mask | x.

From-SVN: r179238
2011-09-27 09:29:21 +02:00
Bernd Schmidt 268987713c rtl.texi (simple_return): Document.
* doc/rtl.texi (simple_return): Document.
	(parallel, PATTERN): Here too.
	* doc/md.texi (return): Mention it's allowed to expand to simple_return
	in some cases.
	(simple_return): Document standard pattern.
	* gengenrtl.c (special_rtx): SIMPLE_RETURN is special.
	* final.c (final_scan_insn): Use ANY_RETURN_P on body.
	* reorg.c (function_return_label, function_simple_return_label):
	New static variables, replacing...
	(end_of_function_label): ... this.
	(simplejump_or_return_p): New static function.
	(optimize_skip, steal_delay_list_from_fallthrough,
	fill_slots_from_thread): Use it.
	(relax_delay_slots): Likewise.  Use ANY_RETURN_P on body.
	(rare_destination, follow_jumps): Use ANY_RETURN_P on body.
	(find_end_label): Take a new arg which is one of the two return
	rtxs.  Depending on which, set either function_return_label or
	function_simple_return_label.  All callers changed.
	(make_return_insns): Make both kinds.
	(dbr_schedule): Adjust for two kinds of end labels.
	* function.c (emit_return_into_block): Set JUMP_LABEL properly.
	* genemit.c (gen_exp): Handle SIMPLE_RETURN.
	(gen_expand, gen_split): Use ANY_RETURN_P.
	* df-scan.c (df_uses_record): Handle SIMPLE_RETURN.
	* rtl.def (SIMPLE_RETURN): New code.
	* ifcvt.c (find_if_case_1): Be more careful about
	redirecting jumps to the EXIT_BLOCK.
	* jump.c (condjump_p, condjump_in_parallel_p, any_condjump_p,
	returnjump_p_1): Handle SIMPLE_RETURNs.
	* print-rtl.c (print_rtx): Likewise.
	* rtl.c (copy_rtx): Likewise.
	* bt-load.c (compute_defs_uses_and_gen): Use ANY_RETURN_P.
	* combine.c (simplify_set): Likewise.
	* resource.c (find_dead_or_set_registers, mark_set_resources):
	Likewise.
	* emit-rtl.c (verify_rtx_sharing, classify_insn, copy_insn_1,
	copy_rtx_if_shared_1, mark_used_flags): Handle SIMPLE_RETURNs.
	(init_emit_regs): Initialize simple_return_rtx.
	* cfglayout.c (fixup_reorder_chain): Pass a JUMP_LABEL to
	force_nonfallthru_and_redirect.
	* rtl.h (ANY_RETURN_P): Allow SIMPLE_RETURN.
	(GR_SIMPLE_RETURN): New enum value.
	(simple_return_rtx): New macro.
	* basic-block.h (force_nonfallthru_and_redirect): Adjust
	declaration.
	* cfgrtl.c (force_nonfallthru_and_redirect): Take a new jump_label
	argument.  All callers changed.  Be careful about what kinds of
	returnjumps to generate.
	* config/i386/3i86.c (ix86_pad_returns, ix86_count_insn_bb,
	ix86_pad_short_function): Likewise.
	* config/arm/arm.c (arm_final_prescan_insn): Handle both kinds
	of return.
	* config/mips/mips.md (any_return): New code_iterator.
	(optab): Add cases for return and simple_return.
	(return): Expand to a simple_return.
	(simple_return): New pattern.
	(*<optab>, *<optab>_internal for any_return): New patterns.
	(return_internal): Remove.
	* config/mips/mips.c (mips_expand_epilogue): Make the last insn
	a simple_return_internal.

From-SVN: r178135
2011-08-27 17:38:58 +00:00
Richard Henderson 42aa5124f7 re PR debug/50132 (ICE: in maybe_record_trace_start, at dwarf2cfi.c:2234 with -fno-asynchronous-unwind-tables and long double)
PR 50132
PR 49864
        * cfgcleanup.c (old_insns_match_p): Don't allow cross-jump for
        non-constant stack adjutment.
        * expr.c (find_args_size_adjust): Break out from ...
        (fixup_args_size_notes): ... here.
        * rtl.h (find_args_size_adjust): Declare.

From-SVN: r178084
2011-08-25 11:57:48 -07:00
Richard Henderson 8f06d483ec rtl.h (INSN_ANNULLED_BRANCH_P): Only allow JUMP_INSN.
* rtl.h (INSN_ANNULLED_BRANCH_P): Only allow JUMP_INSN.
        * dwarf2cfi.c (scan_trace): Test JUMP_P before INSN_ANNULLED_BRANCH_P.
        * resource.c (next_insn_no_annul): Likewise.
        (mark_set_resources): Likewise.
        * reorg.c (delete_from_delay_slot): Likewise.
        (dbr_schedule, redundant_insn, try_merge_delay_insns): Likewise.
        (get_branch_condition): Test pc_rtx and LABEL_REF before dereferencing.

From-SVN: r177944
2011-08-21 11:49:49 -07:00
Richard Sandiford 68f932c443 tm.texi.in (TARGET_RTX_COSTS): Add an opno paramter.
gcc/
	* doc/tm.texi.in (TARGET_RTX_COSTS): Add an opno paramter.
	* doc/tm.texi: Regenerate.
	* target.def (rtx_costs): Add an opno parameter.
	* hooks.h (hook_bool_rtx_int_int_intp_bool_false): Replace with...
	(hook_bool_rtx_int_int_int_intp_bool_false): ...this.
	* hooks.c (hook_bool_rtx_int_int_intp_bool_false): Replace with...
	(hook_bool_rtx_int_int_int_intp_bool_false): ...this.
	* cse.c (COST_IN): Add an opno parameter.
	(notreg_cost): Likewise.  Update call to rtx_cost.
	(COST, fold_rtx): Update accordingly.
	* dojump.c (prefer_and_bit_test): Update call to rtx_cost.
	* expmed.c (emit_store_flag): Likewise.
	* optabs.c (avoid_expensive_constant): Add an opno parameter.
	Update call to rtx_cost.
	(expand_binop_directly, expand_binop): Likewise.
	(expand_twoval_binop, prepare_cmp_insn): Likewise.
	* rtl.h (rtx_cost, get_full_rtx_cost): Add opno parameters.
	(set_src_cost, get_full_set_src_cost): Update accordingly.
	* rtlanal.c (rtx_cost): Add an opno parameter.  Update call
	to target hook.
	(get_full_rtx_cost): Add an opno paramter.  Update calls to rtx_cost.
	(default_adress_cost): Update calls to rtx_cost.

	* config/arm/arm.c (arm_rtx_costs_1, arm_size_rtx_costs)
	(arm_slowmul_rtx_costs): Adjust calls to rtx_cost.
	(arm_rtx_costs): Add an opno parameter.
	* config/alpha/alpha.c (alpha_rtx_costs): Add an opno parameter and
	adjust any recursive rtx-cost calls.
	* config/avr/avr.c (avr_operand_rtx_cost, avr_rtx_costs): Likewise.
	* config/bfin/bfin.c (bfin_rtx_costs): Likewise.
	* config/c6x/c6x.c (c6x_rtx_costs): Likewise.
	* config/cris/cris.c (cris_rtx_costs): Likewise.
	* config/frv/frv.c (frv_rtx_costs): Likewise.
	* config/h8300/h8300.c (h8300_rtx_costs): Likewise.
	* config/i386/i386.c (ix86_rtx_costs): Likewise.
	* config/ia64/ia64.c (ia64_rtx_costs): Likewise.
	* config/iq2000/iq2000.c (iq2000_rtx_costs): Likewise.
	* config/lm32/lm32.c (lm32_rtx_costs): Likewise.
	* config/m32c/m32c.c (m32c_rtx_costs): Likewise.
	* config/m32r/m32r.c (m32r_rtx_costs): Likewise.
	* config/m68k/m68k.c (m68k_rtx_costs): Likewise.
	* config/mcore/mcore.c (mcore_rtx_costs): Likewise.
	* config/mep/mep.c (mep_rtx_cost): Likewise.
	* config/microblaze/microblaze.c (microblaze_rtx_costs): Likewise.
	* config/mips/mips.c (mips_binary_cost): Update call to rtx_cost.
	(mips_zero_extend_cost): Add an opno parameter.
	* config/mmix/mmix.c (mmix_rtx_costs): Likewise.
	* config/mn10300/mn10300.c (mn10300_address_cost): Update call
	to rtx_cost.
	(mn10300_rtx_costs): Add an opno parameter and adjust any recursive
	rtx-cost calls.
	* config/pa/pa.c (hppa_rtx_costs): Likewise.
	* config/pdp11/pdp11.c (pdp11_rtx_costs): Likewise.
	* config/picochip/picochip.c (picochip_rtx_costs): Likewise.
	* config/rs6000/rs6000.c (rs6000_rtx_costs): Likewise.
	(rs6000_debug_rtx_costs): Likewise.
	* config/s390/s390.c (s390_rtx_costs): Likewise.
	* config/score/score-protos.h (score_rtx_costs): Likewise.
	* config/score/score.c (score_rtx_costs): Likewise.
	* config/sh/sh.c (andcosts): Update call to rtx_cost.
	(sh_rtx_costs): Add an opno parameter.
	* config/sparc/sparc.c (sparc_rtx_costs): Likewise.
	* config/spu/spu.c (spu_rtx_costs): Likewise.
	* config/stormy16/stormy16.c (xstormy16_rtx_costs): Likewise.
	* config/v850/v850.c (v850_rtx_costs): Likewise.
	* config/vax/vax.c (vax_rtx_costs): Likewise.
	* config/xtensa/xtensa.c (xtensa_rtx_costs): Likewise.

From-SVN: r177852
2011-08-18 12:37:53 +00:00
Richard Sandiford 5e8f01f434 rtl.h (set_src_cost, [...]): New functions.
gcc/
	* rtl.h (set_src_cost, get_full_set_src_cost): New functions.
	* auto-inc-dec.c (attempt_change): Use set_src_cost instead of
	rtx_cost.
	* calls.c (precompute_register_parameters): Likewise.
	* combine.c (expand_compound_operation, make_extraction): Likewise.
	(force_to_mode, distribute_and_simplify_rtx): Likewise.
	* dse.c (find_shift_sequence): Likewise.
	* expmed.c (init_expmed, expand_mult, expand_smod_pow2): Likewise.
	* expr.c (compress_float_constant): Likewise.
	* fwprop.c (should_replace_address, try_fwprop_subst): Likewise.
	* gcse.c (want_to_gcse_p): Likewise.
	* ifcvt.c (noce_try_sign_mask): Likewise.
	* loop-doloop.c (doloop_optimize): Likewise.
	* loop-invariant.c (create_new_invariant): Likewise.
	* optabs.c (avoid_expensive_constant): Likewise.
	* postreload.c (reload_cse_simplify_set, reload_cse_simplify_operands)
	(try_replace_in_use, reload_cse_move2add): Likewise.
	* reload1.c (calculate_elim_costs_all_insns): Likewise.
	(note_reg_elim_costly): Likewise.
	* rtlanal.c (insn_rtx_cost): Likewise.
	* simplify-rtx.c (simplify_binary_operation_1): Likewise.
	* stmt.c (lshift_cheap_p): Likewise.
	* tree-ssa-loop-ivopts.c (seq_cost, computation_cost): Likewise.
	* config/avr/avr.c (final_prescan_insn): Likewise.
	* config/bfin/bfin.c (bfin_rtx_costs): Likewise.
	* config/mips/mips.c (mips_binary_cost, mips_rtx_costs): Likewise.

From-SVN: r177851
2011-08-18 12:37:27 +00:00
Richard Sandiford d51102f3e7 rtl.h (set_rtx_cost, [...]): New functions.
gcc/
	* rtl.h (set_rtx_cost, get_full_set_rtx_cost): New functions.
	* auto-inc-dec.c (attempt_change): Use set_rtx_cost.
	* cfgloopanal.c (seq_cost): Likewise.
	* loop-invariant.c (create_new_invariant): Likewise.
	* postreload.c (move2add_use_add2_insn, move2add_use_add3_insn)
	(reload_cse_move2add): Use get_full_set_rtx_cost.

From-SVN: r177850
2011-08-18 12:36:51 +00:00
Richard Henderson 9a08d23082 re PR debug/49864 (ICE: in maybe_record_trace_start, at dwarf2cfi.c:2439)
PR target/49864
	* reg-notes.def (REG_ARGS_SIZE): New.
	* calls.c (emit_call_1): Emit REG_ARGS_SIZE for call_pop.
	(expand_call): Add REG_ARGS_SIZE to emit_stack_restore.
	* cfgcleanup.c (old_insns_match_p): Don't allow cross-jumping to
	different stack levels.
	* combine-stack-adj.c (adjust_frame_related_expr): Remove.
	(maybe_move_args_size_note): New.
	(combine_stack_adjustments_for_block): Use it.
	* combine.c (distribute_notes): Place REG_ARGS_SIZE.
	* dwarf2cfi.c (dw_cfi_row_struct): Remove args_size member.
	(dw_trace_info): Add beg_true_args_size, end_true_args_size,
	beg_delay_args_size, end_delay_args_size, eh_head, args_size_undefined.
	(cur_cfa): New.
	(queued_args_size): Remove.
	(add_cfi_args_size): Assert size is non-negative.
	(stack_adjust_offset, dwarf2out_args_size): Remove.
	(dwarf2out_stack_adjust, dwarf2out_notice_stack_adjust): Remove.
	(notice_args_size, notice_eh_throw): New.
	(dwarf2out_frame_debug_def_cfa): Use cur_cfa.
	(dwarf2out_frame_debug_adjust_cfa): Likewise.
	(dwarf2out_frame_debug_cfa_offset): Likewise.
	(dwarf2out_frame_debug_expr): Likewise.  Don't stack_adjust_offset.
	(dwarf2out_frame_debug): Don't handle non-frame-related-p insns.
	(change_cfi_row): Don't emit args_size.
	(maybe_record_trace_start_abnormal): Split out from ...
	(maybe_record_trace_start): Here.  Set args_size_undefined.
	(create_trace_edges): Update to match.
	(scan_trace): Handle REG_ARGS_SIZE.
	(connect_traces): Connect args_size between EH insns.
	* emit-rtl.c (try_split): Handle REG_ARGS_SIZE.
	* explow.c (suppress_reg_args_size): New.
	(adjust_stack_1): Split out from ...
	(adjust_stack): ... here.
	(anti_adjust_stack): Use it.
	(allocate_dynamic_stack_space): Suppress REG_ARGS_SIZE.
	* expr.c (mem_autoinc_base): New.
	(fixup_args_size_notes): New.
	(emit_single_push_insn_1): Rename from emit_single_push_insn.
	(emit_single_push_insn): New.  Generate REG_ARGS_SIZE.
	* recog.c (peep2_attempt): Handle REG_ARGS_SIZE.
	* reload1.c (reload_as_needed): Likewise.
	* rtl.h (fixup_args_size_notes): Declare.

From-SVN: r177218
2011-08-02 15:18:35 -07:00
Bernd Schmidt dc0ff1c802 rtlanal.c (tablejump_p): False for returns.
* rtlanal.c (tablejump_p): False for returns.
	* reorg.c (first_active_target_insn): New static function.
	(find_end_label): Set JUMP_LABEL for a new returnjump.
	(optimize_skip, get_jump_flags, rare_destination,
	mostly_true_jump, get_branch_condition,
	steal_delay_list_from_target, own_thread_p,
	fill_simple_delay_slots, follow_jumps, fill_slots_from_thread,
	fill_eager_delay_slots, relax_delay_slots, make_return_insns,
	dbr_schedule): Adjust to handle ret_rtx in JUMP_LABELs.
	* jump.c (delete_related_insns): Likewise.
	(jump_to_label_p): New function.
	(redirect_target): New static function.
	(redirect_exp_1): Use it.  Adjust to handle ret_rtx in JUMP_LABELS.
	(redirect_jump_1): Assert that the new label is nonnull.
	(redirect_jump): Likewise.
	(redirect_jump_2): Check for ANY_RETURN_P rather than NULL labels.
	* ifcvt.c (find_if_case_1): Take care when redirecting jumps to the
	exit block.
	(dead_or_predicable): Change NEW_DEST arg to DEST_EDGE.  All callers
	changed.  Ensure that the right label is passed to redirect_jump.
	* function.c (emit_return_into_block,
	thread_prologue_and_epilogue_insns): Ensure new returnjumps have
	ret_rtx in their JUMP_LABEL.
	* print-rtl.c (print_rtx): Handle ret_rtx in a JUMP_LABEL.
	* emit-rtl.c (skip_consecutive_labels): Allow the caller to
	pass ret_rtx as label.
	* cfglayout.c (fixup_reorder_chain): Use
	force_nonfallthru_and_redirect rather than force_nonfallthru.
	(duplicate_insn_chain): Copy JUMP_LABELs for returns.
	* rtl.h (ANY_RETURN_P): New macro.
	(jump_to_label_p): Declare.
	* resource.c (find_dead_or_set_registers): Handle ret_rtx in
	JUMP_LABELs.
	(mark_target_live_regs): Likewise.
	* basic-block.h (force_nonfallthru_and_redirect): Declare.
	* cfgrtl.c (force_nonfallthru_and_redirect): No longer static.
	* config/alpha/alpha.c (alpha_tablejump_addr_vec,
	alpha_tablejump_best_label): Remove functions.
	* config/alpha/alpha-protos.c (alpha_tablejump_addr_vec,
	alpha_tablejump_best_label): Remove declarations.
	* config/sh/sh.c (barrier_align, split_branches): Adjust for
	ret_rtx in JUMP_LABELs.
	* config/arm/arm.c (is_jump_table): Likewise.

From-SVN: r176881
2011-07-28 18:45:20 +00:00
Richard Sandiford 754c3d5de8 rtl.h (mem_attrs): Turn offset and size fields into HOST_WIDE_INTs.
gcc/
	* rtl.h (mem_attrs): Turn offset and size fields into HOST_WIDE_INTs.
	Add offset_known_p and size_known_p fields.
	(MEM_OFFSET_KNOWN_P): Update accordingly.
	(MEM_OFFSET, MEM_SIZE_KNOWN_P, MEM_SIZE): Likewise.
	* emit-rtl.c (mem_attrs_htab_hash): Update after mem_attrs changes.
	(mem_attrs_eq_p, set_mem_attributes_minus_bitpos, set_mem_offset)
	(clear_mem_offset, set_mem_size, clear_mem_size, change_address)
	(adjust_address_1, widen_memory_access, set_mem_attrs_for_spill)
	(init_emit_regs): Likewise.

From-SVN: r176478
2011-07-19 17:44:58 +00:00
Richard Sandiford 527210c448 rtl.texi (MEM_OFFSET_KNOWN_P): Document.
gcc/
	* doc/rtl.texi (MEM_OFFSET_KNOWN_P): Document.
	(MEM_OFFSET): Change from returning an rtx to returning a
	HOST_WIDE_INT.
	* rtl.h (MEM_OFFSET_KNOWN_P): New macro.
	(MEM_OFFSET): Return a HOST_WIDE_INT rather than an rtx.
	* emit-rtl.h (set_mem_offset): Take a HOST_WIDE_INT rather than an rtx.
	(clear_mem_offset): Declare.
	* alias.c (ao_ref_from_mem): Adjust uses of MEM_OFFSET, using
	MEM_OFFSET_KNOWN_P to test whether the offset is known, and
	MEM_OFFSET to get a HOST_WIDE_INT offset.
	(nonoverlapping_memrefs_p): Likewise.  Adjust calls to...
	(adjust_offset_for_component_ref): Take a bool "known_p"
	parameter and a HOST_WIDE_INT "offset" parameter.
	* builtins.c (get_memory_rtx): As for ao_ref_from_mem.
	Adjust calls to set_mem_offset, passing a HOST_WIDE_INT rather
	than an rtx.  Use clear_mem_offset to clear the offset.
	* cfgcleanup.c (merge_memattrs): Likewise.
	* dwarf2out.c (tls_mem_loc_descriptor): Likewise.
	* function.c (assign_parm_find_stack_rtl): Likewise.
	(assign_parm_setup_stack): Likewise.
	* print-rtl.c (print_rtx): Likewise.
	* reload.c (find_reloads_subreg_address): Likewise.
	* simplify-rtx.c (delegitimize_mem_from_attrs): Likewise.
	* var-tracking.c (INT_MEM_OFFSET): Likewise.
	* emit-rtl.c (set_reg_attrs_from_value): Likewise.
	(get_mem_align_offset): Likewise.
	(set_mem_offset): Take a HOST_WIDE_INT rather than an rtx.
	(clear_mem_offset): New function.
	* config/mips/mips.c (r10k_safe_mem_expr_p): Take a HOST_WIDE_INT
	offset rather than an rtx.  Assume both the expressio and offset
	are available.
	(r10k_needs_protection_p_1): Update accordingly, checking the
	expression and offset availability here instead.

From-SVN: r176477
2011-07-19 17:43:27 +00:00
Richard Sandiford f5541398ef rtl.texi (MEM_SIZE_KNOWN_P): Document.
gcc/
	* doc/rtl.texi (MEM_SIZE_KNOWN_P): Document.
	(MEM_SIZE): Change from returning an rtx to returning a HOST_WIDE_INT.
	* rtl.h (MEM_SIZE_KNOWN_P): New macro.
	(MEM_SIZE): Return a HOST_WIDE_INT rather than an rtx.
	* emit-rtl.h (set_mem_size): Take a HOST_WIDE_INT rather than an rtx.
	(clear_mem_size): Declare.
	* emit-rtl.c (set_mem_size): Take a HOST_WIDE_INT rather than an rtx.
	(clear_mem_size): New function.
	* alias.c (ao_ref_from_mem): Adjust uses of MEM_SIZE, using
	MEM_SIZE_KNOWN_P to test whether the size is known, and MEM_SIZE
	to get a HOST_WIDE_INT size.  Adjust calls to set_mem_size,
	passing a HOST_WIDE_INT rather than an rtx.  Use clear_mem_size
	to clear the size.
	(nonoverlapping_memrefs_p): Likewise.
	* builtins.c (get_memory_rtx, expand_builtin_memcmp): Likewise.
	(expand_builtin_init_trampoline): Likewise.
	* calls.c (compute_argument_addresses): Likewise.
	* cfgcleanup.c (merge_memattrs): Likewise.
	* dce.c (find_call_stack_args): Likewise.
	* dse.c (record_store, scan_insn): Likewise.
	* dwarf2out.c (dw_sra_loc_expr): Likewise.
	* expr.c (emit_block_move_hints): Likewise.
	* function.c (assign_parm_find_stack_rtl): Likewise.
	* print-rtl.c (print_rtx): Likewise.
	* reload.c (find_reloads_subreg_address): Likewise.
	* rtlanal.c (may_trap_p_1): Likewise.
	* var-tracking.c (track_expr_p): Likewise.
	* varasm.c (assemble_trampoline_template): Likewise.
	* config/arm/arm.c (arm_print_operand): Likewise.
	* config/h8300/h8300.c (h8sx_emit_movmd): Likewise.
	* config/i386/i386.c (expand_movmem_via_rep_mov): Likewise.
	(expand_setmem_via_rep_stos, expand_constant_movmem_prologue)
	(expand_constant_setmem_prologue): Likewise.
	* config/mips/mips.c (mips_get_unaligned_mem): Likewise.
	* config/rs6000/rs6000.c (expand_block_move): Likewise.
	(adjacent_mem_locations): Likewise.
	* config/s390/s390.c (s390_expand_setmem): Likewise.
	(s390_expand_insv): Likewise.
	* config/s390/s390.md (*extzv<mode>, *extv<mode>): Likewise.
	(*extendqi<mode>2_short_displ): Likewise.
	* config/sh/sh.c (expand_block_move): Likewise.
	* config/sh/sh.md (extv, extzv): Likewise.

From-SVN: r176476
2011-07-19 17:43:15 +00:00
Richard Sandiford 1c3f523e1c gcc/
* rtl.h (MEM_ALIAS_SET, MEM_EXPR, MEM_OFFSET, MEM_ADDR_SPACE)
	(MEM_SIZE, MEM_ALIGN): Redefine in terms of get_mem_attrs.
	Provide a dummy definition of MEM_ADDR_SPACE for generators.
	(target_rtl): Add x_mode_mem_attrs.
	(mode_mem_attrs): New macro.
	(get_mem_attrs): New function.
	* emit-rtl.c (get_mem_attrs): Rename to...
	(find_mem_attrs): ...this.
	(set_mem_attributes_minus_bitpos, set_mem_alias_set)
	(set_mem_addr_space, set_mem_align, set_mem_expr, set_mem_offset)
	(set_mem_size, change_address, adjust_address_1, offset_address)
	(widen_memory_access, get_spill_slot_decl, set_mem_attrs_for_spill):
	Update accordingly.
	(init_emit_regs): Initialize mode_mem_attrs.

From-SVN: r176474
2011-07-19 17:42:48 +00:00
Bernd Schmidt bc5612ed56 dwarf2out: Move insn scanning out of final.c.
This patch is essentially Bernd's 005-scanfirst patch, updated for
the introduction of the dwarf2cfi.c file.

We introduce NOTE_INSN_CFI and NOTE_INSN_CFI_LABEL to hold the dwarf2
info during the bulk of final.  The actual construction of these notes
still happens during final, right at the very beginning of the pass,
via the dwarf2out_frame_debug_init hook.

        * dwarf2cfi.c (cfi_insn): New.
        (dwarf2out_cfi_label): Don't emit cfi label here.
        (add_fde_cfi): Create a NOTE_INSN_CFI.
        (dwarf2out_frame_debug): Setup cfi_insn.
        (dwarf2out_frame_debug_init): Loop over insns creating CFI notes.
        (dwarf2out_cfi_begin_epilogue): Make static.
        (dwarf2out_frame_debug_restore_state): Make static.
        * dwarf2out.c (output_cfi_directive): Make static.
        (dwarf2out_emit_cfi): New.
        * dwarf2out.h: Update.
        * final.c (final): Remove CFI notes.
        (final_scan_insn): Don't call dwarf2out_cfi_begin_epilogue,
        dwarf2out_frame_debug_restore_state, dwarf2out_frame_debug.
        Handle NOTE_INSN_CFI and NOTE_INSN_CFI_LABEL.
        * insn-notes.def (NOTE_INSN_CFI): New.
        (NOTE_INSN_CFI_LABEL): New.
        * rtl.h (union rtunion_def): Add rt_cfi member.
        (XCFI, XCCFI, NOTE_CFI, NOTE_LABEL_NUMBER): New.

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

From-SVN: r176016
2011-07-07 16:42:41 -07:00
Richard Henderson 647a156710 dwarf2out: Split CFI construction routines into a new file.
Excepting changing some functions from static to extern, this
patch contains code motion only.  The split is not very clean
at this point, but will be refined as CFI construction is turned
into its own proper pass.

        * dwarf2cfi.c: New file.
        * Makefile.in (OBJS): Add it.
        (GTFILES): Add dwarf2cfi.c and dwarf2out.h.
        * gengtype.c (open_base_files): Include dwarf2out.h.
        * coretypes.h (enum var_init_status): Move from ...
        * rtl.h: ... here.
        * dwarf2out.c (saved_do_cfi_asm, dwarf2out_do_frame,
        dwarf2out_do_cfi_asm, cie_cfi_vec, dwarf2out_cfi_label_num,
        expand_builtin_dwarf_sp_column, init_return_column_size,
        expand_builtin_init_dwarf_reg_sizes, new_cfi, add_cfi,
        dwarf2out_cfi_label, emit_cfa_remember, any_cfis_emitted, add_fde_cfi,
        lookup_cfa_1, lookup_cfa, cfa, cfa_store, cfa_remember, args_size,
        old_args_size, cfa_equal_p, def_cfa_1, reg_save, initial_return_save,
        stack_adjust_offset, barrier_args_size, compute_barrier_args_size_1,
        compute_barrier_args_size, dwarf2out_args_size,
        dwarf2out_stack_adjust, dwarf2out_notice_stack_adjust,
        queued_reg_saves, reg_saved_in_data, regs_saved_in_regs,
        compare_reg_or_pc, record_reg_saved_in_reg, last_reg_save_label,
        queue_reg_save, dwarf2out_flush_queued_reg_saves,
        clobbers_queued_reg_save, reg_saved_in, cfa_temp,
        dwarf2out_frame_debug_def_cfa, dwarf2out_frame_debug_adjust_cfa,
        dwarf2out_frame_debug_cfa_offset, dwarf2out_frame_debug_cfa_register,
        dwarf2out_frame_debug_cfa_expression,
        dwarf2out_frame_debug_cfa_restore,
        dwarf2out_frame_debug_cfa_window_save, dwarf2out_frame_debug_expr,
        dwarf2out_frame_debug, dwarf2out_frame_debug_init,
        dwarf2out_cfi_begin_epilogue, dwarf2out_frame_debug_restore_state,
        get_cfa_from_loc_descr): Move to dwarf2cfi.c.
        (dw_cfi_ref, dw_fde_ref, dw_cfi_oprnd_ref, enum dw_cfi_oprnd_type,
        dw_cfi_oprnd, dw_cfi_node, cfi_vec, dw_cfa_location, dw_fde_node,
        dw_val_ref, dw_die_ref, const_dw_die_ref, dw_loc_descr_ref,
        dw_loc_list_ref, enum dw_val_class, dw_vec_const, dw_val_node,
        dw_loc_descr_node): Move to dwarf2out.h.
        (current_fde, output_cfi_directive, build_cfa_loc, get_address_mode,
        mem_loc_descriptor): Export.
        (build_cfa_aligned_loc): Export.  Take CFA as a parameter.
        (dwarf2out_frame_init): Extract CIE generation code to
        dwarf2cfi_frame_init.

From-SVN: r176015
2011-07-07 16:35:22 -07:00
Bernd Schmidt 6a4bdc7976 emit-rtl.c (paradoxical_subreg_p): New function.
* emit-rtl.c (paradoxical_subreg_p): New function.
	* rtl.h (paradoxical_subreg_p): Declare.
	* combine.c (set_nonzero_bits_and_sign_copies, get_last_value,
	apply_distributive_law, simplify_comparison, simplify_set): Use it.
	* cse.c (record_jump_cond, cse_insn): Likewise.
	* expr.c (force_operand): Likewise.
	* rtlanal.c (num_sign_bit_copies1): Likewise.
	* reload1.c (eliminate_regs_1, strip_paradoxical_subreg): Likewise.
	* reload.c (push_secondary_reload, find_reloads_toplev): Likewise.
	(push_reload): Use precision to check for paradoxical subregs.
	* expmed.c (extract_bit_field_1): Likewise.

From-SVN: r175944
2011-07-06 23:11:51 +00:00
Bernd Schmidt 2d0c270fd2 cse.c (find_comparison_args): Use val_mode_signbit_set_p.
* cse.c (find_comparison_args): Use val_mode_signbit_set_p.
	* simplify-rtx.c (mode_signbit_p): Use GET_MODE_PRECISION.
	(val_mode_signbit_p, val_mode_signbit_set_p): New functions.
	(simplify_const_unary_operation, simplify_binary_operation_1,
	simplify_const_binary_operation,
	simplify_const_relational_operation): Use them.  Use
	GET_MODE_MASK for masking and sign-extensions.
	* combine.c (set_nonzero_bits_and_sign_copies, simplify_set,
	combine_simplify_rtx, force_to_mode, reg_nonzero_bits_for_combine,
	simplify_shift_const_1, simplify_comparison): Likewise.
	* expr.c (convert_modes): Likewise.
	* rtlanal.c (nonzero_bits1, canonicalize_condition): Likewise.
	* expmed.c (emit_cstore, emit_store_flag_1, emit_store_flag):
	Likewise.
	* rtl.h (val_mode_signbit_p, val_mode_signbit_set_p): Declare.

From-SVN: r175917
2011-07-06 14:21:03 +00:00
Jakub Jelinek ddb555ed51 re PR debug/47858 (IPA-SRA decreases quality of debug info)
PR debug/47858
	* gimple.h (enum gimple_debug_subcode): Add GIMPLE_DEBUG_SOURCE_BIND.
	(gimple_build_debug_source_bind_stat): New prototype.
	(gimple_build_debug_source_bind): Define.
	(gimple_debug_source_bind_p, gimple_debug_source_bind_get_var,
	gimple_debug_source_bind_get_value,
	gimple_debug_source_bind_get_value_ptr,
	gimple_debug_source_bind_set_var,
	gimple_debug_source_bind_set_value): New inlines.
	* gimple.c (gimple_build_debug_source_bind_stat): New function.
	* gimple-pretty-print.c (dump_gimple_debug): Handle
	GIMPLE_DEBUG_SOURCE_BIND.
	* sese.c (rename_uses): Handle gimple_debug_source_bind_p.
	* tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise.
	* tree-parloops.c (eliminate_local_variables,
	separate_decls_in_region): Likewise.
	(separate_decls_in_region_debug): Renamed from
	separate_decls_in_region_debug_bind.  Handle
	gimple_debug_source_bind_p.
	* tree.h (decl_debug_args_lookup, decl_debug_args_insert): New
	prototypes.
	(DECL_HAS_DEBUG_ARGS_P): Define.
	(struct tree_function_decl): Add has_debug_args_flag field.
	* tree.c (debug_args_for_decl): New variable.
	(decl_debug_args_lookup, decl_debug_args_insert): New functions.
	* tree-into-ssa.c (mark_def_sites): Handle uses in debug stmts.
	(rewrite_debug_stmt_uses): New function.
	(rewrite_stmt): Use it to rewrite debug stmt uses.
	* rtl.def (DEBUG_PARAMETER_REF): New.
	* rtl.h (DEBUG_PARAMETER_REF_DECL): Define.
	* cselib.c (rtx_equal_for_cselib_1, cselib_hash_rtx): Handle
	DEBUG_PARAMETER_REF.
	* rtl.c (rtx_equal_p_cb, rtx_equal_p, iterative_hash_rtx): Likewise.
	* print-rtl.c (print_rtx): Likewise.
	* tree-sra.c (sra_ipa_reset_debug_stmts): Prefer replacing of
	SSA_NAMEs with DEBUG_EXPR_DECLs initialized in source bind
	debug stmts in the first bb.
	* tree-inline.c (remap_ssa_name): If remapping default def
	of a PARM_DECL fails, map to a DEBUG_EXPR_DECL set in
	a source bind debug stmt.
	(remap_gimple_stmt): Handle gimple_debug_source_bind_p.
	(maybe_move_debug_stmts_to_successors): Likewise.
	(copy_debug_stmt): Likewise.  Avoid shadowing a variable.
	(tree_function_versioning): If DECL_HAS_DEBUG_ARGS_P, copy
	debug args vector from old_decl to new_decl.
	* ipa-prop.c (ipa_modify_call_arguments): For optimized away
	or modified parameters, add debug bind stmts before call
	setting DEBUG_EXPR_DECL which is remembered in debug args
	vector.
	* cfgexpand.c (expand_call_stmt): Call expand_debug_expr
	on DECL_DEBUG_EXPRs from debug args vector.
	(expand_debug_source_expr): New function.
	(expand_debug_locations): Use it for source bind insns.
	(expand_gimple_basic_block): Handle gimple_debug_source_bind_p.
	* var-tracking.c (prepare_call_arguments): Add debug args
	to call_arguments if any.
	* dwarf2out.c (dwarf_stack_op_name, size_of_loc_descr,
	output_loc_operands, output_loc_operands_raw,
	resolve_addr_in_expr, compare_loc_operands): Handle
	DW_OP_GNU_parameter_ref.
	(get_ref_die_offset, parameter_ref_descriptor): New functions.
	(mem_loc_descriptor): Handle DEBUG_PARAMETER_REF.
	(gen_subprogram_die): Handle parameters identified by
	DEBUG_PARAMETER_REF.

	* dwarf2.h (enum dwarf_location_atom): Add DW_OP_GNU_parameter_ref.

From-SVN: r175288
2011-06-22 12:41:58 +02:00
Andi Kleen 1460ec5c3d Print location for conflicting global regs.
gcc/

2011-06-08  Andi Kleen  <ak@linux.intel.com>

	* reginfo.c (global_regs_decl): Add.
	(globalize_reg): Add decl parameter. Compute location.
	Pass location to warnings and add inform. Store decl
	in global_regs_decl.
	* rtl.h (globalize_reg): Update prototype.
	* varasm.c (make_decl_rtl): Pass decl to globalize_reg().

From-SVN: r174834
2011-06-09 06:20:05 +00:00
Bernd Schmidt 2c7eebae8a function.c (init_function_start): Call decide_function_section.
* function.c (init_function_start): Call decide_function_section.
	* varasm.c (decide_function_section): New function.
	(assemble_start_function): When not using
	flag_reorder_blocks_and_partition, don't compute in_cold_section_p
	or first_function_block_is_cold.
	* rtl.h (decide_function_section): Declare.

	* gcc.target/arm/cold-lc.c: New test.

From-SVN: r173303
2011-05-03 13:08:36 +00:00
Bernd Schmidt 3810076ba7 gengenrtl.c (special_rtx): PC, CC0 and RETURN are special.
* gengenrtl.c (special_rtx): PC, CC0 and RETURN are special.
	* genemit.c (gen_exp): Handle RETURN.
	* emit-rtl.c (verify_rtx_sharing): Likewise.
	(init_emit_regs): Create pc_rtx, ret_rtx and cc0_rtx specially.
	* rtl.c (copy_rtx): RETURN is shared.
	* rtl.h (enum global_rtl_index): Add GR_RETURN.
	(ret_rtx): New.
	* jump.c (redirect_exp_1): Don't use gen_rtx_RETURN.
	* config/s390/s390.c (s390_emit_epilogue): Likewise.
	* config/rx/rx.c (gen_rx_rtsd_vector): Likewise.
	* config/cris/cris.c (cris_expand_return): Likewise.
	* config/m68k/m68k.c (m68k_expand_epilogue): Likewise.
	* config/rs6000/rs6000.c (rs6000_make_savres_rtx,
	rs6000_emit_epilogue, rs6000_output_mi_thunk): Likewise.
	* config/picochip/picochip.c (picochip_expand_epilogue): Likewise.
	* config/h8300/h8300.c (h8300_push_pop, h8300_expand_epilogue):
	Likewise.
	* config/v850/v850.c (expand_epilogue): Likewise.
	* config/bfin/bfin.c (bfin_expand_call): Likewise.
	* config/arm/arm.md (epilogue): Likewise.
	* config/mn10300/mn10300.c (mn10300_expand_epilogue): Likewise.
	* config/sparc/sparc.c (sparc_struct_value_rtx): Rename ret_rtx
	variable to ret_reg.

From-SVN: r173300
2011-05-03 11:52:38 +00:00
Michael Matz 42821aff0a re PR rtl-optimization/48389 (ICE: in make_edges, at cfgbuild.c:319 with -mtune=pentiumpro)
PR middle-end/48389
	* jump.c (rebuild_jump_labels_1, rebuild_jump_labels_chain): New
	functions.
	(rebuild_jump_labels): Call rebuild_jump_labels_1.
	* rtl.h (rebuild_jump_labels_chain): Declare.
	* cfgexpand.c (gimple_expand_cfg): Initialize JUMP_LABEL also on
        insns inserted on edges.

testsuite/
	* gcc.target/i386/pr48389.c: New test.

From-SVN: r172208
2011-04-08 20:18:08 +00:00
Vladimir Makarov 1756cb6614 [multiple changes]
2011-03-28  Vladimir Makarov  <vmakarov@redhat.com>

	* ira-color.c (update_left_conflict_sizes_p): Don't assume that
	conflict object hard regset nodes have intersecting hard reg sets.
	
	* regmove.c (regmove_optimize): Move ira_set_pseudo_classes call
	after regstat_init_n_sets_and_refs.

	* ira.c: Add more comments at the top.
	(setup_stack_reg_pressure_class, setup_pressure_classes):
	Add comments how we compute the register pressure classes.
	(setup_allocno_and_important_classes): Add more comments.
	(setup_class_translate_array, reorder_important_classes)
	(setup_reg_class_relations): Add comments.

	* ira-emit.c: Add 2011 to the Copyright line.  Add comments at the
	start of the file.

	* ira-color.c: Add 2011 to the Copyright line.
	(assign_hard_reg):  Add more comments.
	(improve_allocation): Ditto.

	* ira-costs.c: Add 2011 to the Copyright line.
	(setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more
	comments.
	(setup_regno_cost_classes_by_mode): Ditto.

	Initial patches from ira-improv branch:

	2010-08-13  Vladimir Makarov  <vmakarov@redhat.com>

	* ira-build.c: (ira_create_object): Remove initialization of
	OBJECT_PROFITABLE_HARD_REGS.  Initialize OBJECT_ADD_DATA.
	(ira_create_allocno): Remove initialization of
	ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P,
	ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P,
	ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P,
	ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO,
	ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO.
	Initialize ALLOCNO_ADD_DATA.
	(copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA
	and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and
	ALLOCNO_REG.
	(ira_flattening): Ditto.  Use ALLOCNO_EMIT_DATA instead of
	ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P.

	* ira.c (ira_reallocate): Remove.
	(setup_pressure_classes): Call
	ira_init_register_move_cost_if_necessary.  Use
	ira_register_move_cost instead of ira_get_register_move_cost.
	(setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA.
	(ira): Call ira_initiate_emit_data and ira_finish_emit_data.

	* ira-color.c: Use ALLOCNO_COLOR_DATA instead of
	ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P,
	ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO,
	ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA
	instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE,
	OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM.
	Fix formatting.
	(object_hard_regs_t, object_hard_regs_node_t): Move from
	ira-int.h.
	(struct object_hard_regs, struct object_hard_regs_node): Ditto.
	(struct allocno_color_data): New.
	(allocno_color_data_t): New typedef.
	(allocno_color_data): New definition.
	(ALLOCNO_COLOR_DATA): New macro.
	(struct object_color_data): New.
	(object_color_data_t): New typedef.
	(object_color_data): New definition.
	(OBJECT_COLOR_DATA): New macro.
	(update_copy_costs, calculate_allocno_spill_cost): Call
	ira_init_register_move_cost_if_necessary.  Use
	ira_register_move_cost instead of ira_get_register_move_cost.
	(move_spill_restore, update_curr_costs): Ditto.
	(allocno_spill_priority): Make it inline.
	(color_pass): Allocate and free allocno_color_dat and
	object_color_data.
	(struct coalesce_data, coalesce_data_t): New.
	(allocno_coalesce_data): New definition.
	(ALLOCNO_COALESCE_DATA): New macro.
	(merge_allocnos, coalesced_allocno_conflict_p): Use
	ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO,
	ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP.
	(coalesce_allocnos): Ditto.
	(setup_coalesced_allocno_costs_and_nums): Ditto.
	(collect_spilled_coalesced_allocnos): Ditto.
	(slot_coalesced_allocno_live_ranges_intersect_p): Ditto.
	(setup_slot_coalesced_allocno_live_ranges): Ditto.
	(coalesce_spill_slots): Ditto.
	(ira_sort_regnos_for_alter_reg): Ditto.  Allocate, initialize and
	free allocno_coalesce_data.

	* ira-conflicts.c: Fix formatting.
	(process_regs_for_copy): Call
	ira_init_register_move_cost_if_necessary.  Use
	ira_register_move_cost instead of ira_get_register_move_cost.
	(build_object_conflicts): Optimize.

	* ira-costs.c (record_reg_classes): Optimize.  Call
	ira_init_register_move_cost_if_necessary.  Use
	ira_register_move_cost, ira_may_move_in_cost, and
	ira_may_move_out_cost instead of ira_get_register_move_cost and
	ira_get_may_move_cost.
	(record_address_regs): Ditto.
	(scan_one_insn): Optimize.
	(find_costs_and_classes): Optimize.
	(process_bb_node_for_hard_reg_moves): Call
	ira_init_register_move_cost_if_necessary.  Use
	ira_register_move_cost instead of ira_get_register_move_cost.

	* ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of
	ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST,
	ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P.
	(ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New
	definitions.
	(ira_initiate_emit_data, ira_finish_emit_data)
	(create_new_allocno): New functions.
	(modify_move_list): Call create_new_alloc instead of
	ira_create_allocno.
	(emit_move_list): Call ira_init_register_move_cost_if_necessary.
	Use ira_register_move_cost instead of ira_get_register_move_cost.

	* ira-int.h: Fix some comments.
	(object_hard_regs_t, object_hard_regs_node_t): Move
	to ira-color.c.
	(struct object_hard_regs, struct object_hard_regs_node):
	Ditto.
	(struct ira_object): Remove profitable_hard_regs, hard_regs_node,
	hard_regs_subnodes_start, hard_regs_subnodes_num.  Add new member
	add_data.
	(struct ira_allocno): Make mode and aclass a bitfield.  Move other
	bitfield after mode.  Make hard_regno a short int.  Make
	hard_regno short.  Remove first_coalesced_allocno and
	next_coalesced_allocno.  Move mem_optimized_dest_p,
	somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest
	into struct ira_emit_data.  Remove in_graph_p, may_be_spilled_p,
	available_regs_num, next_bucket_allocno, prev_bucket_allocno,
	temp, colorable_p.  Add new member add_data.
	(ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove.
	(ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove.
	(ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove.
	(ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove.
	(ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove.
	(ALLOCNO_ADD_DATA): New macro.
	(ira_emit_data_t): New typedef.
	(struct ira_emit_data): New.  Move mem_optimized_dest_p,
	somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest
	from struct ira_allocno.
	(ALLOCNO_EMIT_DATA): New macro.
	(ira_allocno_emit_data, allocno_emit_reg): New.
	(ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove.
	(OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM):
	Remove.
	(OBJECT_ADD_DATA): New macro.
	(ira_reallocate): Remove.
	(ira_initiate_emit_data, ira_finish_emit_data): New.
	(ira_get_register_move_cost, ira_get_may_move_cost): Remove.
	(ira_init_register_move_cost_if_necessary): New.
	(ira_object_conflict_iter_next): Merge into
	ira_object_conflict_iter_cond.
	(FOR_EACH_OBJECT_CONFLICT): Don't use
	ira_object_conflict_iter_next.

	* ira-live.c: (process_single_reg_class_operands): Call
	ira_init_register_move_cost_if_necessary.  Use
	ira_register_move_cost instead of ira_get_register_move_cost.

	2010-08-13  Vladimir Makarov  <vmakarov@redhat.com>

	* ira-int.h (struct target_ira_int): Remove x_cost_classes.

	* ira-costs.c: Fix formatting.
	(cost_classes, cost_classes_num): Remove.
	(struct cost_classes, cost_classes_t, const_cost_classes_t): New.
	(regno_cost_classes, cost_classes_hash, cost_classes_eq): New.
	(cost_classes_del, cost_classes_htab): New.
	(cost_classes_aclass_cache, cost_classes_mode_cache): New.
	(initiate_regno_cost_classes, setup_cost_classes): New.
	(setup_regno_cost_classes_by_aclass): New.
	(setup_regno_cost_classes_by_mode, finish_regno_cost_classes):
	New.
	(record_reg_classes): Use regno_cost_classes instead of
	cost_classes.  Move checking opposite operand up.
	(record_address_regs): Use regno_cost_classes
	instead of cost_classes.
	(scan_one_insn): Ditto.  Use always general register.
	(print_allocno_costs): Use regno_cost_classes instead of
	cost_classes.
	(print_pseudo_costs): Ditto.  Use Reg_N_REFS.
	(find_costs_and_classes): Set up cost classes for each registers.
	Use also their mode for this.  Use regno_cost_classes instead of
	cost_classes.
	(setup_allocno_class_and_costs): Use regno_cost_classes instead of
	cost_classes.
	(free_ira_costs, ira_init_costs): Don't use cost_classes.
	(ira_costs, ira_set_pseudo_classes): Call
	initiate_regno_cost_classes and finish_regno_cost_classes.

	2010-10-04  Vladimir Makarov  <vmakarov@redhat.com>

	* target-def.h (TARGET_IRA_COVER_CLASSES): Remove.

	* target.def (ira_cover_classes): Remove.

	* doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and
	IRA_COVER_CLASSES.

	* doc/tm.texi.in: Ditto.

	* ira-conflicts.c: Remove mentioning cover classes from the file.
	Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS.  Use
	ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST.  Fix
	formatting.

	* targhooks.c (default_ira_cover_classes): Remove.

	* targhooks.h (default_ira_cover_classes): Ditto.

	* haifa-sched.c: Remove mentioning cover classes from the file.
	Use ira_reg_pressure_cover instead of ira_reg_class_cover.  Use
	ira_pressure_classes and ira_pressure_classes_num instead of
	ira_reg_class_cover_size and ira_reg_class_cover.  Use
	sched_regno_pressure_class instead of sched_regno_cover_class.
	(mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use
	ira_reg_class_max_nregs instead of ira_reg_class_nregs.

	* ira-int.h: Add 2010 to Copyright.  Remove mentioning cover
	classes from the file.
	(object_hard_regs_t, object_hard_regs_node_t): New typedefs.
	(struct object_hard_regs, struct object_hard_regs_node): New.
	(struct ira_object): New members profitable_hard_regs,
	hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num.
	(struct ira_allocno): Rename cover_class to aclass.  Rename
	cover_class_cost and updated_cover_class_cost to class_cost and
	updated_class_cost.  Remove splay_removed_p and
	left_conflict_size.  Add new members colorable_p.
	(ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove.
	(ALLOCNO_COLORABLE_P): New macro.
	(ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS.
	(ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST):
	Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST.
	(OBJECT_...): Rename parameter C to O.
	(OBJECT_PROFITABLE_HARD_REGS): New macro.
	(OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START)
	(OBJECT_HARD_REGS_SUBNODES_NUM): New macros.
	(struct target_ira_int): New members x_ira_max_memory_move_cost,
	x_ira_max_register_move_cost, x_ira_max_may_move_in_cost,
	x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p,
	x_ira_reg_pressure_class_p, x_ira_important_class_nums,
	x_ira_reg_class_superunion.  Rename x_prohibited_class_mode_reg to
	x_ira_prohibited_class_mode_reg.  Rename x_ira_reg_class_union to
	x_ira_reg_class_subunion.
	(ira_max_memory_move_cost, ira_max_register_move_cost)
	(ira_max_may_move_in_cost, ira_max_may_move_out_cost)
	(ira_reg_allocno_class_p, ira_reg_pressure_class_p)
	(ira_important_class_nums, ira_reg_class_superunion): New macros.
	(prohibited_class_mode_regs): Rename to
	ira_prohibited_class_mode_regs.
	(ira_reg_class_union): Rename to ira_reg_class_subunion.
	(ira_debug_class_cover): Rename to ira_debug_allocno_classes.
	(ira_set_allocno_cover_class): Rename to ira_set_allocno_class.
	(ira_tune_allocno_costs_and_cover_classes): Rename to
	ira_tune_allocno_costs.
	(ira_debug_hard_regs_forest): New.
	(ira_object_conflict_iter_init, ira_object_conflict_iter_cond)
	(ira_object_conflict_iter_next): Fix comments.
	(ira_hard_reg_set_intersection_p, hard_reg_set_size): New
	functions.
	(ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename
	cover_class to aclass.
	(ira_allocate_and_accumulate_costs): Ditto.
	(ira_allocate_and_set_or_copy_costs): Ditto.

	* opts.c (decode_options): Remove ira_cover_class check.

	* ira-color.c: Remove mentioning cover classes from the file.  Use
	ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST
	instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and
	ALLOCNO_UPDATED_COVER_CLASS_COST.  Fix formatting.
	(splay-tree.h): Remove include.
	(allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move
	before copy_freq_compare_func.
	(allocnos_for_spilling, removed_splay_allocno_vec): Remove.
	(object_hard_regs_vec, object_hard_regs_htab, node_check_tick):
	New definitions.
	(hard_regs_roots, hard_regs_node_vec): Ditto.
	(object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto.
	(insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto.
	(finish_object_hard_regs, object_hard_regs_compare): Ditto.
	(create_new_object_hard_regs_node): Ditto.
	(add_new_object_hard_regs_node_to_forest): Ditto.
	(add_object_hard_regs_to_forest, collect_object_hard_regs_cover):
	Ditto.
	(setup_object_hard_regs_nodes_parent, first_common_ancestor_node):
	Ditto.
	(print_hard_reg_set, print_hard_regs_subforest): Ditto.
	(print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto.
	(remove_unused_object_hard_regs_nodes): Ditto.
	(enumerate_object_hard_regs_nodes): Ditto.
	(object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto.
	(object_hard_regs_subnode_t): Ditto.
	(struct object_hard_regs_subnode): Ditto.
	(object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto.
	(setup_object_hard_regs_subnode_index): Ditto.
	(get_object_hard_regs_subnodes_num): Ditto.
	(form_object_hard_regs_nodes_forest): Ditto.
	(finish_object_hard_regs_nodes_tree): Ditto.
	(finish_object_hard_regs_nodes_forest): Ditto.
	(allocnos_have_intersected_live_ranges_p): Rename to
	allocnos_conflict_by_live_ranges_p.  Move before
	copy_freq_compare_func.
	(pseudos_have_intersected_live_ranges_p): Rename to
	conflict_by_live_ranges_p.  Move before copy_freq_compare_func.
	(setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto.
	(empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto.
	(update_copy_costs): Remove assert.  Skip cost update if the hard
	reg does not belong the class.
	(assign_hard_reg): Process only profitable hard regs.
	(uncolorable_allocnos_num): Make it scalar.
	(allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM
	and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE
	and ira_reg_class_max_nregs.
	(bucket_allocno_compare_func): Check frequency first.
	(sort_bucket): Add compare function as a parameter.
	(add_allocno_to_ordered_bucket): Assume no coalesced allocnos.
	(uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove.
	(push_allocno_to_stack): Rewrite for checking new allocno
	colorability.
	(remove_allocno_from_bucket_and_push): Print cost too.  Remove
	assert.
	(push_only_colorable): Pass new parameter to sort_bucket.
	(push_allocno_to_spill): Remove.
	(allocno_spill_priority_compare): Make it inline and rewrite.
	(splay_tree_allocate, splay_tree_free): Remove.
	(allocno_spill_sort_compare): New function.
	(push_allocnos_to_stack): Sort allocnos for spilling once.  Don't
	build and use splay tree.  Choose first allocno in uncolorable
	allocno bucket to spill.  Remove setting spill cost.
	(all_conflicting_hard_regs): Remove.
	(setup_allocno_available_regs_num): Check only profitable hard
	regs.  Print info about hard regs nodes.
	(setup_allocno_left_conflicts_size): Remove.
	(put_allocno_into_bucket): Don't call
	setup_allocno_left_conflicts_size.  Use
	setup_left_conflict_sizes_p.
	(improve_allocation): New.
	(color_allocnos): Call setup_profitable_hard_regs,
	form_object_hard_regs_nodes_forest, improve_allocation,
	finish_object_hard_regs_nodes_forest.  Setup spill cost.
	(print_loop_title): Use pressure classes.
	(color_allocnso): Ditto.
	(do_coloring): Remove allocation and freeing splay_tree_node_pool
	and allocnos_for_spilling.
	(ira_sort_regnos_for_alter_reg): Don't setup members
	{first,next}_coalesced_allocno.
	(color): Remove allocating and freeing removed_splay_allocno_vec.
	(fast_allocation): Use ira_prohibited_class_mode_regs instead of
	prohibited_class_mode_regs.

	* ira-lives.c: Remove mentioning cover classes from the file.  Fix
	formatting.
	(update_allocno_pressure_excess_length): Use pressure classes.
	(inc_register_pressure, dec_register_pressure): Check for pressure
	class.
	(mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use
	pressure class.  Use ira_reg_class_nregs instead of
	ira_reg_class_max_nregs.
	(mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto.
	(mark_hard_reg_live, mark_hard_reg_dead): Use pressure class.
	(single_reg_class): Use ira_reg_class_nregs instead of
	ira_reg_class_max_nregs.
	(process_bb_node_lives): Use pressure classes.

	* ira-emit.c: Remove mentioning cover classes from the file.  Use
	ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS.  Fix formatting.
	(change_loop): Use pressure classes.
	(modify_move_list): Call ira_set_allocno_class instead of
	ira_set_allocno_cover_class.

	* ira-build.c: Remove mentioning cover classes from the file.  Use
	ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of
	ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST.  Use
	ALLOCNO_UPDATED_CLASS_COST instead of
	ALLOCNO_UPDATED_COVER_CLASS_COST.  Fix formatting.
	(ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS.
	(ira_create_allocno): Remove initialization of
	ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE.  Initialize
	ALLOCNO_COLORABLE_P.
	(ira_set_allocno_cover_class): Rename to ira_set_allocno_class.
	Update conflict regs for the objects.
	(create_cap_allocno): Remove assert.  Don't propagate
	ALLOCNO_AVAILABLE_REGS_NUM.
	(ira_free_allocno_costs): New function.
	(finish_allocno): Change a part of code into call of
	ira_free_allocno_costs.
	(low_pressure_loop_node_p): Use pressure classes.
	(object_range_compare_func): Don't compare classes.
	(setup_min_max_conflict_allocno_ids): Ditto.

	* loop-invariant.c: Remove mentioning cover classes from the file.
	Use ira_pressure_classes and ira_pressure_classes_num instead of
	ira_reg_class_cover_size and ira_reg_class_cover.  Fix formatting.
	(get_cover_class_and_nregs): Rename to
	get_cover_pressure_and_nregs.  Use ira_reg_class_max_nregs instead
	of ira_reg_class_nregs.  Use reg_allocno_class instead of
	reg_cover_class.
	(get_inv_cost): Use instead ira_stack_reg_pressure_class of
	STACK_REG_COVER_CLASS.
	(get_regno_cover_class): Rename to get_regno_pressure_class.
	(move_loop_invariants): Initialize and finalize regstat.

	* ira.c: Remove mentioning cover classes from the file.  Add
	comments about coloring without cover classes.  Use ALLOCNO_CLASS
	instead of ALLOCNO_COVER_CLASS.  Fix formatting.
	(alloc_reg_class_subclasses, setup_reg_subclasses): Move it before
	setup_class_subset_and_memory_move_costs.
	(setup_stack_reg_pressure_class, setup_pressure_classes): New.
	(setup_cover_and_important_classes): Rename to
	setup_allocno_and_important_classes.
	(setup_class_translate_array): New.
	(setup_class_translate): Call it for allocno and pressure classes.
	(cover_class_order): Rename to allocno_class_order.
	(comp_reg_classes_func): Use ira_allocno_class_translate instead
	of ira_class_translate.
	(reorder_important_classes): Set up ira_important_class_nums.
	(setup_reg_class_relations): Set up ira_reg_class_superunion.
	(print_class_cover): Rename to print_classes.  Add parameter.
	(ira_debug_class_cover): Rename to ira_debug_allocno_classes.
	Print pressure classes too.
	(find_reg_class_closure): Rename to find_reg_classes.  Don't call
	setup_reg_subclasses.
	(ira_hard_regno_cover_class): Rename to
	ira_hard_regno_allocno_class.
	(ira_reg_class_nregs): Rename to ira_reg_class_max_nregs.
	(setup_prohibited_class_mode_regs): Use
	ira_prohibited_class_mode_regs instead of
	prohibited_class_mode_regs.
	(clarify_prohibited_class_mode_regs): New function.
	(ira_init_register_move_cost): Set up ira_max_register_move_cost,
	ira_max_may_move_in_cost, and ira_max_may_move_out_cost.
	(ira_init_once): Initialize them.
	(free_register_move_costs): Process them.
	(ira_init): Move calls of find_reg_classes and
	setup_hard_regno_aclass after setup_prohibited_class_mode_regs.
	Call clarify_prohibited_class_mode_regs.
	(ira_no_alloc_reg): Remove.
	(too_high_register_pressure_p): Use pressure classes.

	* sched-deps.c: Remove mentioning cover classes from the file.
	Use ira_reg_pressure_cover instead of ira_reg_class_cover.  Use
	ira_pressure_classes and ira_pressure_classes_num instead of
	ira_reg_class_cover_size and ira_reg_class_cover.
	(mark_insn_hard_regno_birth, mark_hard_regno_death): Use
	sched_regno_pressure_class instead of sched_regno_cover_class.
	(mark_insn_pseudo_birth, mark_pseudo_death): Ditto.  Use
	ira_reg_class_max_nregs instead of ira_reg_class_nregs.

	* ira.h: Add 2010 to Copyright.
	(ira_no_alloc_reg): Remove external.
	(struct target_ira): Rename x_ira_hard_regno_cover_class,
	x_ira_reg_class_cover_size, x_ira_reg_class_cover, and
	x_ira_class_translate to x_ira_hard_regno_allocno_class,
	x_ira_allocno_classes_num, x_ira_allocno_classes, and
	x_ira_allocno_class_translate.  Add x_ira_pressure_classes_num,
	x_ira_pressure_classes, x_ira_pressure_class_translate, and
	x_ira_stack_reg_pressure_class.  Rename x_ira_reg_class_nregs to
	x_ira_reg_class_max_nregs.  Add x_ira_reg_class_min_nregs and
	x_ira_no_alloc_regs.
	(ira_hard_regno_cover_class): Rename to
	ira_hard_regno_allocno_class.
	(ira_reg_class_cover_size, ira_reg_class_cover): Rename to
	ira_allocno_classes_num and ira_allocno_classes.
	(ira_class_translate): Rename to ira_allocno_class_translate.
	(ira_pressure_classes_num, ira_pressure_classes): New definitions.
	(ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto.
	(ira_reg_class_nregs): Rename to ira_reg_class_max_nregs.
	(ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New
	(ira_no_alloc_regs): New.

	* ira-costs.c: Add 2010 to Copyright.  Remove mentioning cover
	classes from the file.  Use ALLOCNO_CLASS instead of
	ALLOCNO_COVER_CLASS.  Use ALLOCNO_CLASS_COST instead of
	ALLOCNO_COVER_CLASS_COST.
	(regno_cover_class): Rename to regno_aclass.
	(record_reg_classes): Use ira_reg_class_subunion instead of
	ira_reg_class_union.
	(record_address_regs): Check overflow.
	(scan_one_insn): Ditto.
	(print_allocno_costs): Print total mem cost fore regional
	allocation.
	(print_pseudo_costs): Use REG_N_REFS.
	(find_costs_and_classes): Use classes intersected with them on the
	1st pass. Check overflow.  Use ira_reg_class_subunion instead of
	ira_reg_class_union.  Use ira_allocno_class_translate and
	regno_aclass instead of ira_class_translate and regno_cover_class.
	Modify code for finding regno_aclass.  Setup preferred classes for
	the next pass.
	(setup_allocno_cover_class_and_costs): Rename to
	setup_allocno_class_and_costs.  Use regno_aclass instead of
	regno_cover_class.  Use ira_set_allocno_class instead of
	ira_set_allocno_cover_class.
	(init_costs, finish_costs): Use regno_aclass instead of
	regno_cover_class.
	(ira_costs): Use setup_allocno_class_and_costs instead of
	setup_allocno_cover_class_and_costs.
	(ira_tune_allocno_costs_and_cover_classes): Rename to
	ira_tune_allocno_costs.  Check overflow.  Skip conflict hard regs
	by processing objects.  Use ira_reg_class_max_nregs instead of
	ira_reg_class_nregs.

	* rtl.h (reg_cover_class): Rename to reg_allocno_class.

	* sched-int.h: Remove mentioning cover classes from the file.
	(sched_regno_cover_class): Rename to sched_regno_pressure_class.

	* reginfo.c: Add 2010 to Copyright.  Remove mentioning cover
	classes from the file.
	(struct reg_pref): Rename coverclass into allocnoclass.
	(reg_cover_class): Rename to reg_allocno_class.

	* Makefile.in (ira-color.o): Remove SPLAY_TREE_H from
	dependencies.

	* config/alpha/alpha.h (IRA_COVER_CLASSES): Remove.

	* config/arm/arm.h (IRA_COVER_CLASSES): Ditto.

	* config/avr/avr.h (IRA_COVER_CLASSES): Ditto.

	* config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto.

	* config/cris/cris.h (IRA_COVER_CLASSES): Ditto.

	* config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto.

	* config/frv/frv.h (IRA_COVER_CLASSES): Ditto.

	* config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto.

	* config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto.

	* config/i386/i386.c (TARGET_IRA_COVER_CLASSES)
	(i386_ira_cover_classes): Ditto.

	* config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto.

	* config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto.

	* config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto.

	* config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto.

	* config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto.

	* config/mep/mep.h (IRA_COVER_CLASSES): Ditto.

	* config/mips/mips.c (TARGET_IRA_COVER_CLASSES)
	(mips_ira_cover_classes): Ditto.

	* config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto.

	* config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto.

	* config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto.

	* config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto.

	* config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto.

	* config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX)
	(IRA_COVER_CLASSES_VSX): Ditto.

	* config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES)
	(rs6000_ira_cover_classes): Ditto.

	* config/rx/rx.h (IRA_COVER_CLASSES): Ditto.

	* config/s390/s390.h (IRA_COVER_CLASSES): Ditto.

	* config/score/score.h (IRA_COVER_CLASSES): Ditto.

	* config/sh/sh.h (IRA_COVER_CLASSES): Ditto.

	* config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto.

	* config/spu/spu.h (IRA_COVER_CLASSES): Ditto.

	* config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto.

	* config/v850/v850.h (IRA_COVER_CLASSES): Ditto.

	* config/vax/vax.h (IRA_COVER_CLASSES): Ditto.

	* config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto.

From-SVN: r171649
2011-03-29 01:02:05 +00:00
Vladimir Makarov 99710245be re PR bootstrap/48307 (Bootstrap failure)
2011-03-27  Vladimir Makarov  <vmakarov@redhat.com>

	PR bootstrap/48307
	Revert the previous patch.

From-SVN: r171589
2011-03-28 01:53:24 +00:00
Vladimir Makarov fe82cdfb59 [multiple changes]
2011-03-27  Vladimir Makarov  <vmakarov@redhat.com>

	* regmove.c (regmove_optimize): Move ira_set_pseudo_classes call
	after regstat_init_n_sets_and_refs.

	* ira.c: Add more comments at the top.
	(setup_stack_reg_pressure_class, setup_pressure_classes):
	Add comments how we compute the register pressure classes.
	(setup_allocno_and_important_classes): Add more comments.
	(setup_class_translate_array, reorder_important_classes)
	(setup_reg_class_relations): Add comments.

	* ira-emit.c: Add 2011 to the Copyright line.  Add comments at the
	start of the file.

	* ira-color.c: Add 2011 to the Copyright line.
	(assign_hard_reg):  Add more comments.
	(improve_allocation): Ditto.

	* ira-costs.c: Add 2011 to the Copyright line.
	(setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more
	comments.
	(setup_regno_cost_classes_by_mode): Ditto.

	Initial patches from ira-improv branch:

	2010-08-13  Vladimir Makarov  <vmakarov@redhat.com>

	* ira-build.c: (ira_create_object): Remove initialization of
	OBJECT_PROFITABLE_HARD_REGS.  Initialize OBJECT_ADD_DATA.
	(ira_create_allocno): Remove initialization of
	ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P,
	ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P,
	ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P,
	ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO,
	ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO.
	Initialize ALLOCNO_ADD_DATA.
	(copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA
	and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and
	ALLOCNO_REG.
	(ira_flattening): Ditto.  Use ALLOCNO_EMIT_DATA instead of
	ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P.

	* ira.c (ira_reallocate): Remove.
	(setup_pressure_classes): Call
	ira_init_register_move_cost_if_necessary.  Use
	ira_register_move_cost instead of ira_get_register_move_cost.
	(setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA.
	(ira): Call ira_initiate_emit_data and ira_finish_emit_data.

	* ira-color.c: Use ALLOCNO_COLOR_DATA instead of
	ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P,
	ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO,
	ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA
	instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE,
	OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM.
	Fix formatting.
	(object_hard_regs_t, object_hard_regs_node_t): Move from
	ira-int.h.
	(struct object_hard_regs, struct object_hard_regs_node): Ditto.
	(struct allocno_color_data): New.
	(allocno_color_data_t): New typedef.
	(allocno_color_data): New definition.
	(ALLOCNO_COLOR_DATA): New macro.
	(struct object_color_data): New.
	(object_color_data_t): New typedef.
	(object_color_data): New definition.
	(OBJECT_COLOR_DATA): New macro.
	(update_copy_costs, calculate_allocno_spill_cost): Call
	ira_init_register_move_cost_if_necessary.  Use
	ira_register_move_cost instead of ira_get_register_move_cost.
	(move_spill_restore, update_curr_costs): Ditto.
	(allocno_spill_priority): Make it inline.
	(color_pass): Allocate and free allocno_color_dat and
	object_color_data.
	(struct coalesce_data, coalesce_data_t): New.
	(allocno_coalesce_data): New definition.
	(ALLOCNO_COALESCE_DATA): New macro.
	(merge_allocnos, coalesced_allocno_conflict_p): Use
	ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO,
	ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP.
	(coalesce_allocnos): Ditto.
	(setup_coalesced_allocno_costs_and_nums): Ditto.
	(collect_spilled_coalesced_allocnos): Ditto.
	(slot_coalesced_allocno_live_ranges_intersect_p): Ditto.
	(setup_slot_coalesced_allocno_live_ranges): Ditto.
	(coalesce_spill_slots): Ditto.
	(ira_sort_regnos_for_alter_reg): Ditto.  Allocate, initialize and
	free allocno_coalesce_data.

	* ira-conflicts.c: Fix formatting.
	(process_regs_for_copy): Call
	ira_init_register_move_cost_if_necessary.  Use
	ira_register_move_cost instead of ira_get_register_move_cost.
	(build_object_conflicts): Optimize.

	* ira-costs.c (record_reg_classes): Optimize.  Call
	ira_init_register_move_cost_if_necessary.  Use
	ira_register_move_cost, ira_may_move_in_cost, and
	ira_may_move_out_cost instead of ira_get_register_move_cost and
	ira_get_may_move_cost.
	(record_address_regs): Ditto.
	(scan_one_insn): Optimize.
	(find_costs_and_classes): Optimize.
	(process_bb_node_for_hard_reg_moves): Call
	ira_init_register_move_cost_if_necessary.  Use
	ira_register_move_cost instead of ira_get_register_move_cost.

	* ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of
	ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST,
	ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P.
	(ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New
	definitions.
	(ira_initiate_emit_data, ira_finish_emit_data)
	(create_new_allocno): New functions.
	(modify_move_list): Call create_new_alloc instead of
	ira_create_allocno.
	(emit_move_list): Call ira_init_register_move_cost_if_necessary.
	Use ira_register_move_cost instead of ira_get_register_move_cost.

	* ira-int.h: Fix some comments.
	(object_hard_regs_t, object_hard_regs_node_t): Move
	to ira-color.c.
	(struct object_hard_regs, struct object_hard_regs_node):
	Ditto.
	(struct ira_object): Remove profitable_hard_regs, hard_regs_node,
	hard_regs_subnodes_start, hard_regs_subnodes_num.  Add new member
	add_data.
	(struct ira_allocno): Make mode and aclass a bitfield.  Move other
	bitfield after mode.  Make hard_regno a short int.  Make
	hard_regno short.  Remove first_coalesced_allocno and
	next_coalesced_allocno.  Move mem_optimized_dest_p,
	somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest
	into struct ira_emit_data.  Remove in_graph_p, may_be_spilled_p,
	available_regs_num, next_bucket_allocno, prev_bucket_allocno,
	temp, colorable_p.  Add new member add_data.
	(ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove.
	(ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove.
	(ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove.
	(ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove.
	(ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove.
	(ALLOCNO_ADD_DATA): New macro.
	(ira_emit_data_t): New typedef.
	(struct ira_emit_data): New.  Move mem_optimized_dest_p,
	somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest
	from struct ira_allocno.
	(ALLOCNO_EMIT_DATA): New macro.
	(ira_allocno_emit_data, allocno_emit_reg): New.
	(ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove.
	(OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM):
	Remove.
	(OBJECT_ADD_DATA): New macro.
	(ira_reallocate): Remove.
	(ira_initiate_emit_data, ira_finish_emit_data): New.
	(ira_get_register_move_cost, ira_get_may_move_cost): Remove.
	(ira_init_register_move_cost_if_necessary): New.
	(ira_object_conflict_iter_next): Merge into
	ira_object_conflict_iter_cond.
	(FOR_EACH_OBJECT_CONFLICT): Don't use
	ira_object_conflict_iter_next.

	* ira-live.c: (process_single_reg_class_operands): Call
	ira_init_register_move_cost_if_necessary.  Use
	ira_register_move_cost instead of ira_get_register_move_cost.

	2010-08-13  Vladimir Makarov  <vmakarov@redhat.com>

	* ira-int.h (struct target_ira_int): Remove x_cost_classes.

	* ira-costs.c: Fix formatting.
	(cost_classes, cost_classes_num): Remove.
	(struct cost_classes, cost_classes_t, const_cost_classes_t): New.
	(regno_cost_classes, cost_classes_hash, cost_classes_eq): New.
	(cost_classes_del, cost_classes_htab): New.
	(cost_classes_aclass_cache, cost_classes_mode_cache): New.
	(initiate_regno_cost_classes, setup_cost_classes): New.
	(setup_regno_cost_classes_by_aclass): New.
	(setup_regno_cost_classes_by_mode, finish_regno_cost_classes):
	New.
	(record_reg_classes): Use regno_cost_classes instead of
	cost_classes.  Move checking opposite operand up.
	(record_address_regs): Use regno_cost_classes
	instead of cost_classes.
	(scan_one_insn): Ditto.  Use always general register.
	(print_allocno_costs): Use regno_cost_classes instead of
	cost_classes.
	(print_pseudo_costs): Ditto.  Use Reg_N_REFS.
	(find_costs_and_classes): Set up cost classes for each registers.
	Use also their mode for this.  Use regno_cost_classes instead of
	cost_classes.
	(setup_allocno_class_and_costs): Use regno_cost_classes instead of
	cost_classes.
	(free_ira_costs, ira_init_costs): Don't use cost_classes.
	(ira_costs, ira_set_pseudo_classes): Call
	initiate_regno_cost_classes and finish_regno_cost_classes.

	2010-10-04  Vladimir Makarov  <vmakarov@redhat.com>

	* target-def.h (TARGET_IRA_COVER_CLASSES): Remove.

	* target.def (ira_cover_classes): Remove.

	* doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and
	IRA_COVER_CLASSES.

	* doc/tm.texi.in: Ditto.

	* ira-conflicts.c: Remove mentioning cover classes from the file.
	Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS.  Use
	ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST.  Fix
	formatting.

	* targhooks.c (default_ira_cover_classes): Remove.

	* targhooks.h (default_ira_cover_classes): Ditto.

	* haifa-sched.c: Remove mentioning cover classes from the file.
	Use ira_reg_pressure_cover instead of ira_reg_class_cover.  Use
	ira_pressure_classes and ira_pressure_classes_num instead of
	ira_reg_class_cover_size and ira_reg_class_cover.  Use
	sched_regno_pressure_class instead of sched_regno_cover_class.
	(mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use
	ira_reg_class_max_nregs instead of ira_reg_class_nregs.

	* ira-int.h: Add 2010 to Copyright.  Remove mentioning cover
	classes from the file.
	(object_hard_regs_t, object_hard_regs_node_t): New typedefs.
	(struct object_hard_regs, struct object_hard_regs_node): New.
	(struct ira_object): New members profitable_hard_regs,
	hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num.
	(struct ira_allocno): Rename cover_class to aclass.  Rename
	cover_class_cost and updated_cover_class_cost to class_cost and
	updated_class_cost.  Remove splay_removed_p and
	left_conflict_size.  Add new members colorable_p.
	(ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove.
	(ALLOCNO_COLORABLE_P): New macro.
	(ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS.
	(ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST):
	Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST.
	(OBJECT_...): Rename parameter C to O.
	(OBJECT_PROFITABLE_HARD_REGS): New macro.
	(OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START)
	(OBJECT_HARD_REGS_SUBNODES_NUM): New macros.
	(struct target_ira_int): New members x_ira_max_memory_move_cost,
	x_ira_max_register_move_cost, x_ira_max_may_move_in_cost,
	x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p,
	x_ira_reg_pressure_class_p, x_ira_important_class_nums,
	x_ira_reg_class_superunion.  Rename x_prohibited_class_mode_reg to
	x_ira_prohibited_class_mode_reg.  Rename x_ira_reg_class_union to
	x_ira_reg_class_subunion.
	(ira_max_memory_move_cost, ira_max_register_move_cost)
	(ira_max_may_move_in_cost, ira_max_may_move_out_cost)
	(ira_reg_allocno_class_p, ira_reg_pressure_class_p)
	(ira_important_class_nums, ira_reg_class_superunion): New macros.
	(prohibited_class_mode_regs): Rename to
	ira_prohibited_class_mode_regs.
	(ira_reg_class_union): Rename to ira_reg_class_subunion.
	(ira_debug_class_cover): Rename to ira_debug_allocno_classes.
	(ira_set_allocno_cover_class): Rename to ira_set_allocno_class.
	(ira_tune_allocno_costs_and_cover_classes): Rename to
	ira_tune_allocno_costs.
	(ira_debug_hard_regs_forest): New.
	(ira_object_conflict_iter_init, ira_object_conflict_iter_cond)
	(ira_object_conflict_iter_next): Fix comments.
	(ira_hard_reg_set_intersection_p, hard_reg_set_size): New
	functions.
	(ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename
	cover_class to aclass.
	(ira_allocate_and_accumulate_costs): Ditto.
	(ira_allocate_and_set_or_copy_costs): Ditto.

	* opts.c (decode_options): Remove ira_cover_class check.

	* ira-color.c: Remove mentioning cover classes from the file.  Use
	ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST
	instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and
	ALLOCNO_UPDATED_COVER_CLASS_COST.  Fix formatting.
	(splay-tree.h): Remove include.
	(allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move
	before copy_freq_compare_func.
	(allocnos_for_spilling, removed_splay_allocno_vec): Remove.
	(object_hard_regs_vec, object_hard_regs_htab, node_check_tick):
	New definitions.
	(hard_regs_roots, hard_regs_node_vec): Ditto.
	(object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto.
	(insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto.
	(finish_object_hard_regs, object_hard_regs_compare): Ditto.
	(create_new_object_hard_regs_node): Ditto.
	(add_new_object_hard_regs_node_to_forest): Ditto.
	(add_object_hard_regs_to_forest, collect_object_hard_regs_cover):
	Ditto.
	(setup_object_hard_regs_nodes_parent, first_common_ancestor_node):
	Ditto.
	(print_hard_reg_set, print_hard_regs_subforest): Ditto.
	(print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto.
	(remove_unused_object_hard_regs_nodes): Ditto.
	(enumerate_object_hard_regs_nodes): Ditto.
	(object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto.
	(object_hard_regs_subnode_t): Ditto.
	(struct object_hard_regs_subnode): Ditto.
	(object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto.
	(setup_object_hard_regs_subnode_index): Ditto.
	(get_object_hard_regs_subnodes_num): Ditto.
	(form_object_hard_regs_nodes_forest): Ditto.
	(finish_object_hard_regs_nodes_tree): Ditto.
	(finish_object_hard_regs_nodes_forest): Ditto.
	(allocnos_have_intersected_live_ranges_p): Rename to
	allocnos_conflict_by_live_ranges_p.  Move before
	copy_freq_compare_func.
	(pseudos_have_intersected_live_ranges_p): Rename to
	conflict_by_live_ranges_p.  Move before copy_freq_compare_func.
	(setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto.
	(empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto.
	(update_copy_costs): Remove assert.  Skip cost update if the hard
	reg does not belong the class.
	(assign_hard_reg): Process only profitable hard regs.
	(uncolorable_allocnos_num): Make it scalar.
	(allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM
	and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE
	and ira_reg_class_max_nregs.
	(bucket_allocno_compare_func): Check frequency first.
	(sort_bucket): Add compare function as a parameter.
	(add_allocno_to_ordered_bucket): Assume no coalesced allocnos.
	(uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove.
	(push_allocno_to_stack): Rewrite for checking new allocno
	colorability.
	(remove_allocno_from_bucket_and_push): Print cost too.  Remove
	assert.
	(push_only_colorable): Pass new parameter to sort_bucket.
	(push_allocno_to_spill): Remove.
	(allocno_spill_priority_compare): Make it inline and rewrite.
	(splay_tree_allocate, splay_tree_free): Remove.
	(allocno_spill_sort_compare): New function.
	(push_allocnos_to_stack): Sort allocnos for spilling once.  Don't
	build and use splay tree.  Choose first allocno in uncolorable
	allocno bucket to spill.  Remove setting spill cost.
	(all_conflicting_hard_regs): Remove.
	(setup_allocno_available_regs_num): Check only profitable hard
	regs.  Print info about hard regs nodes.
	(setup_allocno_left_conflicts_size): Remove.
	(put_allocno_into_bucket): Don't call
	setup_allocno_left_conflicts_size.  Use
	setup_left_conflict_sizes_p.
	(improve_allocation): New.
	(color_allocnos): Call setup_profitable_hard_regs,
	form_object_hard_regs_nodes_forest, improve_allocation,
	finish_object_hard_regs_nodes_forest.  Setup spill cost.
	(print_loop_title): Use pressure classes.
	(color_allocnso): Ditto.
	(do_coloring): Remove allocation and freeing splay_tree_node_pool
	and allocnos_for_spilling.
	(ira_sort_regnos_for_alter_reg): Don't setup members
	{first,next}_coalesced_allocno.
	(color): Remove allocating and freeing removed_splay_allocno_vec.
	(fast_allocation): Use ira_prohibited_class_mode_regs instead of
	prohibited_class_mode_regs.

	* ira-lives.c: Remove mentioning cover classes from the file.  Fix
	formatting.
	(update_allocno_pressure_excess_length): Use pressure classes.
	(inc_register_pressure, dec_register_pressure): Check for pressure
	class.
	(mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use
	pressure class.  Use ira_reg_class_nregs instead of
	ira_reg_class_max_nregs.
	(mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto.
	(mark_hard_reg_live, mark_hard_reg_dead): Use pressure class.
	(single_reg_class): Use ira_reg_class_nregs instead of
	ira_reg_class_max_nregs.
	(process_bb_node_lives): Use pressure classes.

	* ira-emit.c: Remove mentioning cover classes from the file.  Use
	ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS.  Fix formatting.
	(change_loop): Use pressure classes.
	(modify_move_list): Call ira_set_allocno_class instead of
	ira_set_allocno_cover_class.

	* ira-build.c: Remove mentioning cover classes from the file.  Use
	ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of
	ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST.  Use
	ALLOCNO_UPDATED_CLASS_COST instead of
	ALLOCNO_UPDATED_COVER_CLASS_COST.  Fix formatting.
	(ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS.
	(ira_create_allocno): Remove initialization of
	ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE.  Initialize
	ALLOCNO_COLORABLE_P.
	(ira_set_allocno_cover_class): Rename to ira_set_allocno_class.
	Update conflict regs for the objects.
	(create_cap_allocno): Remove assert.  Don't propagate
	ALLOCNO_AVAILABLE_REGS_NUM.
	(ira_free_allocno_costs): New function.
	(finish_allocno): Change a part of code into call of
	ira_free_allocno_costs.
	(low_pressure_loop_node_p): Use pressure classes.
	(object_range_compare_func): Don't compare classes.
	(setup_min_max_conflict_allocno_ids): Ditto.

	* loop-invariant.c: Remove mentioning cover classes from the file.
	Use ira_pressure_classes and ira_pressure_classes_num instead of
	ira_reg_class_cover_size and ira_reg_class_cover.  Fix formatting.
	(get_cover_class_and_nregs): Rename to
	get_cover_pressure_and_nregs.  Use ira_reg_class_max_nregs instead
	of ira_reg_class_nregs.  Use reg_allocno_class instead of
	reg_cover_class.
	(get_inv_cost): Use instead ira_stack_reg_pressure_class of
	STACK_REG_COVER_CLASS.
	(get_regno_cover_class): Rename to get_regno_pressure_class.
	(move_loop_invariants): Initialize and finalize regstat.

	* ira.c: Remove mentioning cover classes from the file.  Add
	comments about coloring without cover classes.  Use ALLOCNO_CLASS
	instead of ALLOCNO_COVER_CLASS.  Fix formatting.
	(alloc_reg_class_subclasses, setup_reg_subclasses): Move it before
	setup_class_subset_and_memory_move_costs.
	(setup_stack_reg_pressure_class, setup_pressure_classes): New.
	(setup_cover_and_important_classes): Rename to
	setup_allocno_and_important_classes.
	(setup_class_translate_array): New.
	(setup_class_translate): Call it for allocno and pressure classes.
	(cover_class_order): Rename to allocno_class_order.
	(comp_reg_classes_func): Use ira_allocno_class_translate instead
	of ira_class_translate.
	(reorder_important_classes): Set up ira_important_class_nums.
	(setup_reg_class_relations): Set up ira_reg_class_superunion.
	(print_class_cover): Rename to print_classes.  Add parameter.
	(ira_debug_class_cover): Rename to ira_debug_allocno_classes.
	Print pressure classes too.
	(find_reg_class_closure): Rename to find_reg_classes.  Don't call
	setup_reg_subclasses.
	(ira_hard_regno_cover_class): Rename to
	ira_hard_regno_allocno_class.
	(ira_reg_class_nregs): Rename to ira_reg_class_max_nregs.
	(setup_prohibited_class_mode_regs): Use
	ira_prohibited_class_mode_regs instead of
	prohibited_class_mode_regs.
	(clarify_prohibited_class_mode_regs): New function.
	(ira_init_register_move_cost): Set up ira_max_register_move_cost,
	ira_max_may_move_in_cost, and ira_max_may_move_out_cost.
	(ira_init_once): Initialize them.
	(free_register_move_costs): Process them.
	(ira_init): Move calls of find_reg_classes and
	setup_hard_regno_aclass after setup_prohibited_class_mode_regs.
	Call clarify_prohibited_class_mode_regs.
	(ira_no_alloc_reg): Remove.
	(too_high_register_pressure_p): Use pressure classes.

	* sched-deps.c: Remove mentioning cover classes from the file.
	Use ira_reg_pressure_cover instead of ira_reg_class_cover.  Use
	ira_pressure_classes and ira_pressure_classes_num instead of
	ira_reg_class_cover_size and ira_reg_class_cover.
	(mark_insn_hard_regno_birth, mark_hard_regno_death): Use
	sched_regno_pressure_class instead of sched_regno_cover_class.
	(mark_insn_pseudo_birth, mark_pseudo_death): Ditto.  Use
	ira_reg_class_max_nregs instead of ira_reg_class_nregs.

	* ira.h: Add 2010 to Copyright.
	(ira_no_alloc_reg): Remove external.
	(struct target_ira): Rename x_ira_hard_regno_cover_class,
	x_ira_reg_class_cover_size, x_ira_reg_class_cover, and
	x_ira_class_translate to x_ira_hard_regno_allocno_class,
	x_ira_allocno_classes_num, x_ira_allocno_classes, and
	x_ira_allocno_class_translate.  Add x_ira_pressure_classes_num,
	x_ira_pressure_classes, x_ira_pressure_class_translate, and
	x_ira_stack_reg_pressure_class.  Rename x_ira_reg_class_nregs to
	x_ira_reg_class_max_nregs.  Add x_ira_reg_class_min_nregs and
	x_ira_no_alloc_regs.
	(ira_hard_regno_cover_class): Rename to
	ira_hard_regno_allocno_class.
	(ira_reg_class_cover_size, ira_reg_class_cover): Rename to
	ira_allocno_classes_num and ira_allocno_classes.
	(ira_class_translate): Rename to ira_allocno_class_translate.
	(ira_pressure_classes_num, ira_pressure_classes): New definitions.
	(ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto.
	(ira_reg_class_nregs): Rename to ira_reg_class_max_nregs.
	(ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New
	(ira_no_alloc_regs): New.

	* ira-costs.c: Add 2010 to Copyright.  Remove mentioning cover
	classes from the file.  Use ALLOCNO_CLASS instead of
	ALLOCNO_COVER_CLASS.  Use ALLOCNO_CLASS_COST instead of
	ALLOCNO_COVER_CLASS_COST.
	(regno_cover_class): Rename to regno_aclass.
	(record_reg_classes): Use ira_reg_class_subunion instead of
	ira_reg_class_union.
	(record_address_regs): Check overflow.
	(scan_one_insn): Ditto.
	(print_allocno_costs): Print total mem cost fore regional
	allocation.
	(print_pseudo_costs): Use REG_N_REFS.
	(find_costs_and_classes): Use classes intersected with them on the
	1st pass. Check overflow.  Use ira_reg_class_subunion instead of
	ira_reg_class_union.  Use ira_allocno_class_translate and
	regno_aclass instead of ira_class_translate and regno_cover_class.
	Modify code for finding regno_aclass.  Setup preferred classes for
	the next pass.
	(setup_allocno_cover_class_and_costs): Rename to
	setup_allocno_class_and_costs.  Use regno_aclass instead of
	regno_cover_class.  Use ira_set_allocno_class instead of
	ira_set_allocno_cover_class.
	(init_costs, finish_costs): Use regno_aclass instead of
	regno_cover_class.
	(ira_costs): Use setup_allocno_class_and_costs instead of
	setup_allocno_cover_class_and_costs.
	(ira_tune_allocno_costs_and_cover_classes): Rename to
	ira_tune_allocno_costs.  Check overflow.  Skip conflict hard regs
	by processing objects.  Use ira_reg_class_max_nregs instead of
	ira_reg_class_nregs.

	* rtl.h (reg_cover_class): Rename to reg_allocno_class.

	* sched-int.h: Remove mentioning cover classes from the file.
	(sched_regno_cover_class): Rename to sched_regno_pressure_class.

	* reginfo.c: Add 2010 to Copyright.  Remove mentioning cover
	classes from the file.
	(struct reg_pref): Rename coverclass into allocnoclass.
	(reg_cover_class): Rename to reg_allocno_class.

	* Makefile.in (ira-color.o): Remove SPLAY_TREE_H from
	dependencies.

	* config/alpha/alpha.h (IRA_COVER_CLASSES): Remove.

	* config/arm/arm.h (IRA_COVER_CLASSES): Ditto.

	* config/avr/avr.h (IRA_COVER_CLASSES): Ditto.

	* config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto.

	* config/cris/cris.h (IRA_COVER_CLASSES): Ditto.

	* config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto.

	* config/frv/frv.h (IRA_COVER_CLASSES): Ditto.

	* config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto.

	* config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto.

	* config/i386/i386.c (TARGET_IRA_COVER_CLASSES)
	(i386_ira_cover_classes): Ditto.

	* config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto.

	* config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto.

	* config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto.

	* config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto.

	* config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto.

	* config/mep/mep.h (IRA_COVER_CLASSES): Ditto.

	* config/mips/mips.c (TARGET_IRA_COVER_CLASSES)
	(mips_ira_cover_classes): Ditto.

	* config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto.

	* config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto.

	* config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto.

	* config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto.

	* config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto.

	* config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX)
	(IRA_COVER_CLASSES_VSX): Ditto.

	* config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES)
	(rs6000_ira_cover_classes): Ditto.

	* config/rx/rx.h (IRA_COVER_CLASSES): Ditto.

	* config/s390/s390.h (IRA_COVER_CLASSES): Ditto.

	* config/score/score.h (IRA_COVER_CLASSES): Ditto.

	* config/sh/sh.h (IRA_COVER_CLASSES): Ditto.

	* config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto.

	* config/spu/spu.h (IRA_COVER_CLASSES): Ditto.

	* config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto.

	* config/v850/v850.h (IRA_COVER_CLASSES): Ditto.

	* config/vax/vax.h (IRA_COVER_CLASSES): Ditto.

	* config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto.

From-SVN: r171583
2011-03-27 23:16:35 +00:00
Jakub Jelinek a58a8e4b1f re PR debug/45882 (No debug info for vars depending on unused parameter)
PR debug/45882
	* rtl.def (ENTRY_VALUE): Change format from "e" to "0".
	* rtl.h (ENTRY_VALUE_EXP): Define.
	* rtl.c (rtx_equal_p_cb, rtx_equal_p): Handle ENTRY_VALUE.
	* cselib.c (rtx_equal_for_cselib_p, cselib_hash_rtx): Likewise.
	* print-rtl.c (print_rtx): Likewise.
	* gengtype.c (adjust_field_rtx_def): Likewise.
	* var-tracking.c (vt_add_function_parameter): Adjust
	gen_rtx_ENTRY_VALUE uses, use ENTRY_VALUE_EXP macro.
	* dwarf2out.c (mem_loc_descriptor): Use ENTRY_VALUE_EXP macro.
	* cfgexpand.c (expand_debug_expr): If a SSA_NAME without
	partition is a default definition of a PARM_DECL, use ENTRY_VALUE
	of its DECL_INCOMING_RTL if possible, or its DECL_RTL if set.

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

From-SVN: r171035
2011-03-16 09:35:31 +01:00
Jakub Jelinek db7ec03597 re PR rtl-optimization/47866 (gcc.dg/torture/vector-2.c fails on IA64)
PR rtl-optimization/47866
	* expr.c (store_field): If MEM_SCALAR_P (target), don't use
	MEM_SET_IN_STRUCT_P (to_rtx, 1), just set MEM_IN_STRUCT_P (to_rtx)
	if target wasn't scalar.
	* function.c (assign_stack_temp_for_type): Assert that neither
	MEM_SCALAR_P nor MEM_IN_STRUCT_P is set previously, set either
	MEM_IN_STRUCT_P or MEM_SCALAR_P instead of using MEM_SET_IN_STRUCT_P
	macro.
	* rtl.h (MEM_SET_IN_STRUCT_P): Removed.

From-SVN: r170834
2011-03-09 21:49:00 +01:00
Jakub Jelinek 80a832cd25 re PR middle-end/47893 (4.6 miscompiles mesa on i686)
PR middle-end/47893
	* rtl.h (ASLK_REDUCE_ALIGN, ASLK_RECORD_PAD): Define.
	(assign_stack_local_1): Change last argument type to int.
	* function.c (assign_stack_local_1): Replace reduce_alignment_ok
	argument with kind.  If bit ASLK_RECORD_PAD is not set in it,
	don't record padding space into frame_space_list nor
	use those areas.
	(assign_stack_local): Adjust caller.
	(assign_stack_temp_for_type): Call assign_stack_local_1 instead
	of assign_stack_local, pass 0 as last argument.
	* caller-save.c (setup_save_areas): Adjust assign_stack_local_1
	callers.

	* gcc.dg/pr47893.c: New test.

From-SVN: r170568
2011-02-28 18:05:07 +01:00
Pat Haugen 3f82421f9c re PR rtl-optimization/47614 (cpu2000 benchmark 301.apsi fails with revision 169782)
PR rtl-optimization/47614
	* rtl.h (check_for_inc_dec): Declare.
	* dse.c (check_for_inc_dec): Externalize...
	* postreload.c (reload_cse_simplify): ...use it before deleting stmt.
	(reload_cse_simplify_operands): Don't simplify opnds with side effects.

	* testsuite/gfortran.dg/pr47614.f: New.

From-SVN: r170059
2011-02-11 20:52:55 +00:00
Alexandre Oliva 4deef538ec re PR debug/43092 (Wrong debuginfo with VTA and -fomit-frame-pointer/-mno-accumulate-outgoing-args)
PR debug/43092
PR rtl-optimization/43494
* rtl.h (for_each_inc_dec_fn): New type.
(for_each_inc_dec): Declare.
* rtlanal.c (struct for_each_inc_dec_ops): New type.
(for_each_inc_dec_find_inc_dec): New fn.
(for_each_inc_dec_find_mem): New fn.
(for_each_inc_dec): New fn.
* dse.c (struct insn_size): Remove.
(replace_inc_dec, replace_inc_dec_mem): Remove.
(emit_inc_dec_insn_before): New fn.
(check_for_inc_dec): Use it, along with for_each_inc_dec.
(canon_address): Pass mem modes to cselib_lookup.
* cselib.h (cselib_lookup): Add memmode argument.  Adjust callers.
(cselib_lookup_from_insn): Likewise.
(cselib_subst_to_values): Likewise.
* cselib.c (find_slot_memmode): New var.
(cselib_find_slot): New fn.  Use it instead of
htab_find_slot_with_hash everywhere.
(entry_and_rtx_equal_p): Use find_slot_memmode.
(autoinc_split): New fn.
(rtx_equal_for_cselib_p): Rename and implement in terms of...
(rtx_equal_for_cselib_1): ... this.  Take memmode, pass it on.
Deal with autoinc.  Special-case recursion into MEMs.
(cselib_hash_rtx): Likewise.
(cselib_lookup_mem): Infer pmode from address mode.  Distinguish
address and MEM modes.
(cselib_subst_to_values): Add memmode, pass it on.
Deal with autoinc.
(cselib_lookup): Add memmode argument, pass it on.
(cselib_lookup_from_insn): Add memmode.
(cselib_invalidate_rtx): Discard obsolete push_operand handling.
(struct cselib_record_autoinc_data): New.
(cselib_record_autoinc_cb): New fn.
(cselib_record_sets): Use it, along with for_each_inc_dec.  Pass MEM
mode to cselib_lookup.  Reset autoinced REGs here instead of...
(cselib_process_insn): ... here.
* var-tracking.c (replace_expr_with_values, use_type): Pass MEM mode
to cselib_lookup.
(add_uses): Likewise, also to cselib_subst_to_values.
(add_stores): Likewise.
* sched-deps.c 	(add_insn_mem_dependence): Pass mode to
cselib_subst_to_values.
(sched_analyze_1, sched_analyze_2): Likewise.  Adjusted.
* gcse.c (do_local_cprop): Adjusted.
* postreload.c (reload_cse_simplify_set): Adjusted.
(reload_cse_simplify_operands): Adjusted.
* sel-sched-dump (debug_mem_addr_value): Pass mode.

From-SVN: r169782
2011-02-03 06:04:04 +00:00
Richard Guenther fa1fabcbbc rtl.h (invalid_mode_change_p): Adjust prototype.
2010-12-09  Richard Guenther  <rguenther@suse.de>

	* rtl.h (invalid_mode_change_p): Adjust prototype.
	* reginfo.c (invalid_mode_change_p): Remove from argument.
	* ira-costs.c (print_allocno_costs): Adjust callers.
	(find_costs_and_classes): Likewise.

2010-12-09  Richard Guenther  <rguenther@suse.de>

	* ira.c (ira): Do not call finish_subregs_of_mode.
	* ira-costs.c (finish_costs): Call finish_subregs_of_mode.

From-SVN: r167631
2010-12-09 10:00:25 +00:00
Joseph Myers 299404a1ec common.opt (initial_max_fld_align, [...]): New Variable entries.
* common.opt (initial_max_fld_align, flag_debug_asm,
	flag_dump_rtl_in_asm, flag_dump_all_passed, rtl_dump_and_exit,
	flag_print_asm_name, graph_dump_format, help_printed,
	help_columns, flag_opts_finished): New Variable entries.
	(fdbg-cnt-list, fdbg-cnt=, fdebug-prefix-map=, frandom-seed,
	frandom-seed=): Mark deferred.
	(fsched-verbose=): Use UInteger and Var.
	* flags.h (set_struct_debug_option, flag_print_asm_name,
	rtl_dump_and_exit, flag_debug_asm, flag_dump_rtl_in_asm,
	graph_dump_format): Don't declare here.
	* haifa-sched.c (sched_verbose_param, fix_sched_param): Remove.
	* opts-global.c: Include dbgcnt.h and debug.h.
	(decode_options): Pass location to finish_options.
	(handle_common_deferred_options): Check flag_dump_all_passed.
	Handle OPT_fdbg_cnt_, OPT_fdbg_cnt_list, OPT_fdebug_prefix_map_,
	OPT_frandom_seed and OPT_frandom_seed_.  Don't assert on
	OPT_fstack_limit.
	* opts.c: Don't include toplev.h, dbgcnt.h or debug.h.
	(set_struct_debug_option): Add location_t parameter.  Update
	recursive call.  Use error_at.
	(default_options_optimization): Use error_at.
	(finish_options): Add location_t parameter.  Use
	opts->x_flag_opts_finished instead of first_time_p.  Use
	opts->x_optimize instead of optimize.  Use error_at.  Pass
	location to inform.
	(print_filtered_help): Use opts->x_help_printed to track what
	options have been printed.
	(print_specific_help): Use opts->x_help_columns to track number of
	columns.
	(common_handle_option): Pass locations and gcc_options pointers to
	more functions.  Use warning_at instead of fnotice and warning.
	Don't handle OPT_fdbg_cnt_, OPT_fdbg_cnt_list or
	OPT_fdebug_prefix_map_.  Use error_at.  Set
	opts->x_initial_max_fld_align; don't set maximum_field_alignment.
	Don't handle OPT_frandom_seed or OPT_frandom_seed_.  Don't handle
	OPT_fsched_verbose_.
	(handle_param): Add location_r parameter.  Use error_at.
	(set_debug_level): Add location_r parameter.  Use error_at and
	warning_at.
	(setup_core_dumping): Add diagnostic_context parameter.
	(decode_d_option): Add gcc_options, location_t and
	diagnostic_context parameters and use them instead of global
	state.  Use warning_at.
	(enable_warning_as_error): Use error_at.
	* opts.h (finish_options): Update prototype.
	(set_struct_debug_option): Declare here.
	* rtl.h (fix_sched_param): Remove.
	* stor-layout.c (initial_max_fld_align): Remove.
	* toplev.c (rtl_dump_and_exit, flag_print_asm_name,
	graph_dump_format, flag_debug_asm, flag_dump_rtl_in_asm): Remove.
	(process_options): Set maximum_field_alignment.
	* tree.h (initial_max_fld_align) Don't declare here.
	* Makefile.in (opts.o, opts-global.o): Update dependencies.

c-family:
	* c-opts.c (c_common_handle_option): Pass location to
	set_struct_debug_option.

testsuite:
	* gcc.dg/opts-5.c: New test.

From-SVN: r167106
2010-11-24 00:54:26 +00:00
Alexander Monakov 8fd0a47488 re PR rtl-optimization/45652 (gcc.dg/compat/scalar-by-value-3 FAILs with -O2 -fselective-scheduling2)
PR rtl-optimization/45652
	* alias.c (get_reg_base_value): New.
	* rtl.h (get_reg_base_value): Add prototype.
	* sel-sched.c (init_regs_for_mode): Use it.  Don't use registers with
	non-null REG_BASE_VALUE for renaming.

testsuite:
	* gcc.dg/pr45652.c: New.

From-SVN: r167025
2010-11-22 13:35:06 +03:00
Richard Henderson cd400280c4 re PR middle-end/46515 (Many libjava failures)
PR middle-end/46515
        * function.c (maybe_copy_prologue_epilogue_insn): Rename from
        maybe_copy_epilogue_insn; handle prologue insns as well.
        * rtl.h, cfglayout.c: Update for rename.
        * recog.c (peep2_attempt): Copy prologue/epilogue data for
        RTX_FRAME_RELATED_P insns.

From-SVN: r166920
2010-11-18 13:08:38 -08:00
Eric Botcazou 885c9b5d3a re PR rtl-optimization/46315 (-O2 -fno-strict-overflow causes wrong code generation)
PR rtl-optimization/46315
	* rtl.h (remove_reg_equal_equiv_notes_for_regno): Declare.
	* rtlanal.c (remove_reg_equal_equiv_notes_for_regno): New function
	extracted from...
	* dce.c (delete_corresponding_reg_eq_notes): ...here.  Rename into...
	(remove_reg_equal_equiv_notes_for_defs): ...this.
	(delete_unmarked_insns): Adjust to above renaming.
	* ifcvt.c (dead_or_predicable): Remove REG_EQUAL and REG_EQUIV notes
	referring to registers set in the insns being moved, if any.

	* df-core.c (df_ref_dump): New function extracted from...
	(df_refs_chain_dump): ...here.  Call it.
	(df_regs_chain_dump): Likewise.
	* df-problems.c (df_chain_dump): Print 'e' for uses in notes.
	* df-scan.c (df_scan_start_dump): Likewise.  Fix long line.

From-SVN: r166827
2010-11-16 22:13:52 +00:00
Jakub Jelinek 61630b2768 re PR debug/46387 (ICE in add_stores, at var-tracking.c:5415)
PR debug/46387
	* rtl.h (vt_equate_reg_base_value): New prototype.
	* alias.c (vt_equate_reg_base_value): New function.
	* var-tracking.c (vt_init_cfa_base): Use it.

	* gcc.dg/pr46387.c: New test.

From-SVN: r166766
2010-11-15 21:07:39 +01:00
Jakub Jelinek d95828db91 rtl.h: Include hashtab.h.
* rtl.h: Include hashtab.h.
	(iterative_hash_rtx): New prototype.
	* rtl.c (iterative_hash_rtx): New function.
	* dwarf2out.c (dw_loc_list_node): Add hash and emitted fields.
	(output_loc_list): Return immediately if emitted is set,
	set it.
	(hash_loc_operands, hash_locs, hash_loc_list,
	compare_loc_operands, compare_locs, loc_list_hash, loc_list_eq,
	optimize_location_lists_1, optimize_location_lists): New function.
	(dwarf2out_finish): Call optimize_location_lists.
	* Makefile.in (RTL_BASE_H): Depend on $(HASHTAB_H).

From-SVN: r165351
2010-10-12 08:24:07 +02:00
Bernd Schmidt 2293974419 re PR target/40457 (use stm and ldm to access consecutive memory words)
PR target/40457
	* postreload.c (move2add_use_add2_insn): Use full_costs for
	comparison.
	(move2add_use_add3_insn): Likewise.
	(reload_cse_move2add): Likewise.
	* rtlanal.c (get_full_rtx_cost): New function.
	* rtl.h (struct full_rtx_costs): New.
	(init_costs_to_max, init_costs_to_zero, costs_lt_p,
	costs_add_n_insns): New inline functions.
	(get_full_rtx_cost): Declare.

testsuite/
	PR target/40457
	* gcc.target/arm/pr40457-3.c: New test.

From-SVN: r164732
2010-09-29 20:06:55 +00:00
Joseph Myers e3339d0f33 optc-gen.awk: Generate global_options initializer instead of individual variables.
gcc:
	* optc-gen.awk: Generate global_options initializer instead of
	individual variables.  Add x_ prefix to names of structure
	members.
	* opth-gen.awk: Generate gcc_options structure.  Add x_ prefix to
	names of structure members.
	* doc/tm.texi.in (HARD_FRAME_POINTER_IS_FRAME_POINTER,
	HARD_FRAME_POINTER_IS_ARG_POINTER): Document.
	* doc/tm.texi: Regenerate.
	* alias.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
	* builtins.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER.
	* c-parser.c (disable_extension_diagnostics,
	restore_extension_diagnostics): Update names of cpp_options
	members.
	* combine.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
	* common.opt (fcompare-debug-second): Don't use Var.
	* config/alpha/alpha.h (target_flags): Remove.
	* config/arm/arm.h (HARD_FRAME_POINTER_IS_FRAME_POINTER,
	HARD_FRAME_POINTER_IS_ARG_POINTER): Define.
	* config/bfin/bfin.h (target_flags): Remove.
	* config/cris/cris.h (target_flags): Remove.
	* config/i386/i386-c.c (ix86_pragma_target_parse): Update names of
	cl_target_option members.
	* config/i386/i386.c (ix86_force_align_arg_pointer): Remove.
	(ix86_function_specific_print, ix86_valid_target_attribute_tree,
	ix86_can_inline_p): Update names of cl_target_option members.
	* config/i386/i386.h (ix86_isa_flags): Remove.
	* config/lm32/lm32.h (target_flags): Remove.
	* config/mcore/mcore.h (mcore_stack_increment): Remove.
	* config/mcore/mcore.md (addsi3): Remove extern declaration of
	flag_omit_frame_pointer.
	* config/mep/mep.h (target_flags): Remove.
	* config/mips/mips.h (HARD_FRAME_POINTER_IS_FRAME_POINTER,
	HARD_FRAME_POINTER_IS_ARG_POINTER): Define.
	* config/mmix/mmix.h (target_flags): Remove.
	* config/rs6000/rs6000.h (rs6000_xilinx_fpu, flag_pic,
	flag_expensive_optimizations): Remove.
	* config/s390/s390.h (flag_pic): Remove.
	* config/score/score-conv.h (target_flags): Remove.
	* config/sh/sh.h (sh_fixed_range_str): Remove.
	* config/spu/spu.h (target_flags, spu_fixed_range_string): Remove.
	* dbxout.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER
	* df-scan.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
	* diagnostic.c (diagnostic_initialize): Update names of
	diagnostic_context members.
	* diagnostic.h (diagnostic_context): Rename inhibit_warnings and
	warn_system_headers.
	(diagnostic_report_warnings_p): Update for new names.
	* dwarf2out.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER
	* emit-rtl.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER and
	HARD_FRAME_POINTER_IS_ARG_POINTER.
	* flags.h (flag_compare_debug): Declare.
	* ira.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
	* opts.c (flag_compare_debug): Define.
	(common_handle_option): Update names of diagnostic_context
	members.  Handle -fcompare-debug-second.
	(fast_math_flags_struct_set_p): Update names of cl_optimization
	members.
	* reginfo.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
	* regrename.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
	* reload.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
	* reload1.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
	* resource.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
	* rtl.h (HARD_FRAME_POINTER_IS_FRAME_POINTER,
	HARD_FRAME_POINTER_IS_ARG_POINTER): Define and use.
	* sel-sched.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
	* stmt.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER.

gcc/c-family:
	* c-common.c (c_cpp_error): Update names of diagnostic_context
	members.
	* c-cppbuiltin.c (c_cpp_builtins_optimize_pragma): Update names of
	cl_optimization members.
	* c-opts.c (warning_as_error_callback, c_common_handle_option,
	sanitize_cpp_opts, finish_options): Update names of cpp_options
	members.

gcc/fortran:
	* cpp.c (cpp_define_builtins): Update names of gfc_option_t
	members.
	(gfc_cpp_post_options): Update names of cpp_options members.
	(cb_cpp_error): Update names of diagnostic_context members.
	* f95-lang.c (gfc_init_builtin_functions): Update names of
	gfc_option_t members.
	* gfortran.h (gfc_option_t): Rename warn_conversion and
	flag_openmp.
	* intrinsic.c (gfc_convert_type_warn): Update names of
	gfc_option_t members.
	* options.c (gfc_init_options, gfc_post_options, set_Wall,
	gfc_handle_option): Update names of gfc_option_t members.
	* parse.c (next_free, next_fixed): Update names of gfc_option_t
	members.
	* scanner.c (pedantic): Remove extern declaration.
	(skip_free_comments, skip_fixed_comments, include_line): Update
	names of gfc_option_t members.
	* trans-decl.c (gfc_generate_function_code): Update names of
	gfc_option_t members.

gcc/java:
	* java-tree.h (flag_filelist_file, flag_assert, flag_jni,
	flag_force_classes_archive_check, flag_redundant, flag_newer,
	flag_use_divide_subroutine, flag_use_atomic_builtins,
	flag_use_boehm_gc, flag_hash_synchronization,
	flag_check_references, flag_optimize_sci, flag_indirect_classes,
	flag_indirect_dispatch, flag_store_check,
	flag_reduced_reflection): Remove.
	* jcf-dump.c (flag_newer): Remove.
	* jcf.h (quiet_flag): Remove.
	* parse.h (quiet_flag): Remove.

libcpp:
	* include/cpplib.h (cpp_options): Rename warn_deprecated,
	warn_traditional, warn_long_long and pedantic.
	* directives.c (directive_diagnostics, _cpp_handle_directive):
	Update names of cpp_options members.
	* expr.c (cpp_classify_number, eval_token): Update names of
	cpp_options members.
	* init.c (cpp_create_reader, post_options): Update names of
	cpp_options members.
	* internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of
	cpp_options members.
	* macro.c (parse_params): Update names of cpp_options members.

From-SVN: r164723
2010-09-29 15:49:14 +01:00
Jakub Jelinek 32990d5bc2 re PR middle-end/45234 (ICE in expand_call, at calls.c:2845 when passing aligned function argument from unaligned stack after alloca)
PR middle-end/45234
	* rtl.h (enum global_rtl_index): Add
	GR_VIRTUAL_PREFERRED_STACK_BOUNDARY.
	(LAST_VIRTUAL_POINTER_REGISTER): Define.
	(virtual_preferred_stack_boundary_rtx,
	VIRTUAL_PREFERRED_STACK_BOUNDARY_REGNUM): Define.
	(LAST_VIRTUAL_REGISTER): Increase by one.
	(REGNO_PTR_FRAME_P): Use LAST_VIRTUAL_POINTER_REGISTER
	instead of LAST_VIRTUAL_REGISTER.
	* function.c (instantiate_new_reg): Handle
	virtual_preferred_stack_boundary_rtx.
	* emit-rtl.c (init_virtual_regs): Handle
	VIRTUAL_PREFERRED_STACK_BOUNDARY_REGNUM.
	(init_emit_regs): Initialize virtual_preferred_stack_boundary_rtx.
	* explow.c (round_push): If crtl->preferred_stack_boundary
	is smaller than MAX_SUPPORTED_STACK_ALIGNMENT, use
	virtual_preferred_stack_boundary_rtx alignment instead of
	crtl->preferred_stack_boundary alignment.
	(allocate_dynamic_stack_space): Use CONST_INT_P and REG_P
	macros.  Never decrease crtl->preferred_stack_boundary,
	use crtl->preferred_stack_boundary or MAX_SUPPORTED_STACK_ALIGNMENT
	instead of PREFERRED_STACK_BOUNDARY.  Don't modify
	stack_pointer_delta in dynamic allocation, even when size
	is constant.
	(probe_stack_range, anti_adjust_stack_and_probe): Use CONST_INT_P
	macro.
	* print-rtl.c (print_rtx): Handle
	VIRTUAL_PREFERRED_STACK_BOUNDARY_REGNUM.
	* config/alpha/alpha.h (NONSTRICT_REG_OK_FP_BASE_P): Use
	LAST_VIRTUAL_POINTER_REGISTER instead of LAST_VIRTUAL_REGISTER.
	* config/frv/frv.c (frv_emit_movsi): Likewise.
	* config/arm/arm.c (thumb1_legitimate_address_p): Likewise.
	* config/rs6000/rs6000.c (virtual_stack_registers_memory_p):
	Likewise.

	* gcc.dg/torture/stackalign/alloca-6.c: New test.
	* gcc.target/i386/pr45234.c: New test.

	Revert:
	2010-09-17  H.J. Lu  <hongjiu.lu@intel.com>

	PR middle-end/45234
	* calls.c (expand_call): Make sure that all variable sized
	adjustments are multiple of preferred stack boundary after
	stack alignment.

From-SVN: r164593
2010-09-24 16:37:02 +02:00
Jakub Jelinek c8a27c4018 rtl.def (DEBUG_IMPLICIT_PTR): New rtl code.
* rtl.def (DEBUG_IMPLICIT_PTR): New rtl code.
	* rtl.h (DEBUG_IMPLICIT_PTR_DECL): Define.
	* rtl.c (rtx_equal_p_cb, rtx_equal_p): Handle DEBUG_IMPLICIT_PTR.
	* print-rtl.c (print_rtx): Likewise.
	* cselib.c (rtx_equal_for_cselib_p, cselib_hash_rtx): Likewise.
	* cfgexpand.c (expand_debug_expr): Generate DEBUG_IMPLICIT_PTR
	for ADDR_EXPR with non-addressable object.
	* dwarf2out.c (enum dw_val_class): Add dw_val_class_decl_ref.
	(struct dw_val_struct): Add v.val_decl_ref.
	(dwarf_stack_op_name, output_loc_operands, output_loc_operands_raw):
	Handle DW_OP_GNU_implicit_pointer.
	(size_of_loc_descr): Likewise.  Fix up DW_OP_call_ref size.
	(get_ref_die_offset_label): New function.
	(implicit_ptr_descriptor): New function.
	(mem_loc_descriptor): Handle DEBUG_IMPLICIT_PTR.
	(loc_descriptor): Likewise.
	(gen_variable_die): Put even definitions into decl_die_table.
	(resolve_addr_in_expr): Resolve still unresolved
	DW_OP_GNU_implicit_pointer operands, if it can't be resolved
	return false.
	(dwarf2out_finish): Call output_location_lists after outputting
	.debug_info and .debug_abbrev instead of before.

	* dwarf2.h (DW_OP_GNU_implicit_pointer): New.

2010-09-09  Roland McGrath  <roland@redhat.com>

	* dwarf2out.c (DWARF_REF_SIZE): Define.
	(size_of_loc_descr): Use it for DW_OP_call_ref.

From-SVN: r164050
2010-09-09 08:43:47 +02:00
Anatoly Sokolov faa832a76d reload.h (register_move_cost, [...]): Adjust prototype.
* reload.h (register_move_cost, memory_move_secondary_cost,
	secondary_reload_class): Adjust prototype.
	* rtl.h (reg_class_subset_p): Adjust prototype.
	* reload.c (secondary_reload_class): Change arguments type from
	enum reg_class to reg_class_t. Change result type to reg_class_t.
	* reginfo.c (register_move_cost, reg_class_subset_p): Change
	arguments type from enum reg_class to reg_class_t.
	(memory_move_secondary_cost): Change arguments type from
	enum reg_class to reg_class_t. Change type of saved_flags to
	reg_class_t.

	* config/mips/mips.h (REGISTER_MOVE_COST, MEMORY_MOVE_COST): 
	Remove macros.
	(mips_cost): Remove.
	(struct mips_rtx_cost_data): Moved to mips.c.
	* config/mips/mips-protos.h (mips_register_move_cost): Remove.
	* config/mips/mips.c (struct mips_rtx_cost_data): Moved from mips.h.
	(mips_cost): Make static.
	(mips_canonicalize_move_class): Change argument type to reg_class_t.
	Change result type to reg_class_t.
	(mips_move_to_gpr_cost, mips_move_from_gpr_cost): Change arguments
	type from enum reg_class to reg_class_t.
	(mips_register_move_cost): Make static. Change arguments
	type from enum reg_class to reg_class_t.
	(mips_memory_move_cost): New function.
	(TARGET_REGISTER_MOVE_COST, TARGET_MEMORY_MOVE_COST): Define.

From-SVN: r163252
2010-08-15 01:46:11 +04:00
Bingfeng Mei c6ea834c83 ddg.c (walk_mems_2): Moved from alias.c, use may_alias_p instead of alias_sets_conflict_p.
2010-08-09  Bingfeng Mei  <bmei@broadcom.com>

	* ddg.c (walk_mems_2): Moved from alias.c, use may_alias_p instead of
	alias_sets_conflict_p.
	(walk_mems_1): Moved from alias.c.
	(insns_may_alias_p): New function, originally insn_alias_sets_conflict_p
	in alias.c. 
        (add_inter_loop_mem_dep): Use insns_may_alias_p now.
        * cse.c (cse_insn): New argument in calling nonoverlapping_memrefs_p.
        * alias.c (walk_mems_2): Moved to ddg.c.
	(walk_mems_1): Ditto.
	(insn_alias_sets_conflict_p): Renamed to insns_may_alias_p and moved
	to ddg.c.
	(nonoverlapping_memrefs_p): Add flag to guard offset-based memory
	disambiguation.
	*(may_alias_p): New function to check whether two memory expression
	may alias or not. Currently used in buidling inter-iteration memory
	dependence.
	*alias.h (nonoverlapping_memrefs_p): New flag as third argument.
	(insn_alias_sets_conflict_p): Removed
	*rtl.h (may_alias_p): New function prototype.

From-SVN: r163037
2010-08-09 14:44:03 +00:00
Bernd Schmidt 5444da31b4 From Martin Thuresson <martint@google.com>
* postreload.c (reload_cse_simplify_operands): Use
	SET_REGNO_RAW instead of SET_REGNO.
	* caller-save.c (reg_save_code): Use SET_REGNO_RAW instead of
	SET_REGNO.
	* ira.c (setup_prohibited_mode_move_regs): Use SET_REGNO_RAW
	instead of SET_REGNO.
	* rtl.h (SET_REGNO_RAW): New macro.

From-SVN: r162924
2010-08-05 22:58:35 +00:00
Jakub Jelinek f0fc0803ea re PR debug/45055 (another -fcompare-debug failure with uninitialised read in walk_gimple_stmt)
PR debug/45055
	PR rtl-optimization/45137
	* rtl.h (prev_nonnote_nondebug_insn, next_nonnote_nondebug_insn): New
	prototypes.
	* emit-rtl.c (prev_nonnote_nondebug_insn, next_nonnote_nondebug_insn):
	New functions.
	* combine.c (next_nonnote_nondebug_insn): Removed.
	* ifcvt.c (noce_process_if_block): Use prev_nonnote_nondebug_insn.
	* haifa-sched.c (queue_to_ready): Use next_nonnote_nondebug_insn.
	* sched-deps.c (sched_analyze_insn): Likewise.
	(fixup_sched_groups, deps_start_bb): Use prev_nonnote_nondebug_insn.
	* rtlanal.c (canonicalize_condition): Likewise.
	* postreload.c (reload_combine_recognize_pattern): Likewise.
	(reload_cse_move2add): Use next_nonnote_nondebug_insn.

	* gcc.dg/pr45055.c: New test.

From-SVN: r162714
2010-07-30 16:36:56 +02:00
Jakub Jelinek 0f953f83c2 revert: rtl.def (NOTE): Swap operands 4 and 5.
Revert:
	* rtl.def (NOTE): Swap operands 4 and 5.
        * rtl.h (NOTE_DATA, NOTE_DELETED_LABEL_NAME, NOTE_BLOCK,
	NOTE_EH_HANDLER, NOTE_BASIC_BLOCK, NOTE_VAR_LOCATION, NOTE_KIND):
	Adjust accordingly.
        * gengtype.c (adjust_field_rtx_def): Swap operands 4 and 5 of NOTEs.

From-SVN: r162692
2010-07-29 21:48:03 +02:00
Bernd Schmidt 418e920fc6 rtl.def (DEBUG_INSN, [...]): Swap operands 4 and 5.
* rtl.def (DEBUG_INSN, INSN, JUMP_INSN, CALL_INSN, NOTE): Swap operands
	4 and 5.
	* rtl.h (PATTERN, INSN_LOCATOR, NOTE_DATA, NOTE_DELETED_LABEL_NAME,
	NOTE_BLOCK, NOTE_EH_HANDLER, NOTE_BASIC_BLOCK, NOTE_VAR_LOCATION,
	NOTE_KIND, LABEL_NUSES, LABEL_REFS): Adjust accordingly.
	* gengtype.c (adjust_field_rtx_def): Swap operands 4 and 5 of
	CODE_LABELs and NOTEs.
	* caller-save.c (init_caller_save): Fix up gen_rtx_INSN call.
	* combine.c (try_combine): Likewise.
	* ira.c (setup_prohibited_mode_move_regs): Likewise.
	* print-rtl.c (print_rtx): Start REG_NOTES on a new line.

From-SVN: r162602
2010-07-27 21:52:39 +00:00
Richard Sandiford 7bf84454ff rtl.h (target_rtl): Add x_static_reg_base_value.
gcc/
	* rtl.h (target_rtl): Add x_static_reg_base_value.
	* alias.c (static_reg_base_value): Redefine as a macro.

From-SVN: r162092
2010-07-12 18:53:49 +00:00
Richard Sandiford 360d045b05 Makefile.in (reginfo.o): Don't depend on $(GGC_H) or gt-reginfo.h.
gcc/
	* Makefile.in (reginfo.o): Don't depend on $(GGC_H) or gt-reginfo.h.
	(GTFILES): Remove reginfo.c.
	* rtl.h (target_rtl): Add x_top_of_stack.
	(top_of_stack): New macro.
	* reginfo.c: Don't include ggc.h or gt-reginfo.h.
	(top_of_stack): Delete.

From-SVN: r162091
2010-07-12 18:53:42 +00:00
Richard Sandiford 5fb0e246f4 Makefile.in (target-globals.o): Depend on $(RTL_H).
gcc/
	* Makefile.in (target-globals.o): Depend on $(RTL_H).
	* rtl.h: (target_rtl): New structure.
	(default_target_rtl): Declare.
	(this_target_rtl): Declare as a variable or define as a macro.
	(global_rtl, pic_offset_table_rtx, return_address_pointer_rtx):
	Redefine as macros.
	* emit-rtl.c (default_target_rtl): New variable.
	(this_target_rtl): New conditional variable.
	(global_rtl, static_regno_reg_rtx, pic_offset_table_rtx)
	(return_address_pointer_rtx): Delete.
	(initial_regno_reg_rtx): New macro.
	(init_emit): Use initial_regno_reg_rtx instead of static_regno_reg_rtx.
	(init_emit_regs): Likewise.
	* target-globals.h (this_target_rtl): Declare.
	(target_globals): Add a rtl field.
	(restore_target_globals): Copy the rtl field to this_target_rtl.
	* target-globals.c: Include rtl.h.
	(default_target_globals): Initialize the rtl field.
	(save_target_globals): Likewise.

From-SVN: r162088
2010-07-12 18:53:17 +00:00
Anatoly Sokolov a56b31caff reginfo.h (reg_classes_intersect_p): Change arguments type to reg_class_t.
* reginfo.h (reg_classes_intersect_p): Change arguments type to
	reg_class_t.
	* rtl.h (reg_classes_intersect_p): Adjust prototype.

	* config/rs6000/rs6000.h (REGISTER_MOVE_COST, MEMORY_MOVE_COST):
	Remove macros.
	* config/rs6000/rs6000-protos.h (rs6000_register_move_cost,
	rs6000_memory_move_cost): Remove
	* config/rs6000/rs6000.c (TARGET_REGISTER_MOVE_COST,
	TARGET_MEMORY_MOVE_COST): Define.
	(rs6000_register_move_cost): Make static. Change arguments type from
	enum reg_class to reg_class_t. Adjust rs6000_memory_move_cost calls.
	(rs6000_memory_move_cost): Make static. Change arguments type from
	'enum reg_class' to reg_class_t.

From-SVN: r162045
2010-07-11 01:42:15 +04:00
Manuel López-Ibáñez 0cbd999369 toplev.h (_fatal_insn_not_found, [...]): Move declarations to rtl.h.
2010-06-30  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	* toplev.h (_fatal_insn_not_found, _fatal_insn): Move declarations
	to rtl.h.
	(error_for_asm,	warning_for_asm): Move declarations to rtl-error.h.
	* rtl.h (_fatal_insn_not_found, _fatal_insn): Move declarations
	here.
	* rtl-error.h: New.
	* regrename.c: Do not include toplev.h. Include rtl-error.h.
	* rtl-error.c: Likewise.
	* reload.c: Likewise.
	* recog.c:  Likewise.
	* sel-sched.c: Likewise.
	* function.c: Likewise.
	* reg-stack.c: Likewise.
	* cfgrtl.c: Likewise.
	* reload1.c: Likewise.
	* final.c: Include rtl-error.
	* Makefile.in: Adjust dependencies.

From-SVN: r161617
2010-06-30 17:12:36 +00:00
Richard Sandiford 600ab3fcfa Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H).
gcc/
	* Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H).
	* genmddeps.c: Include read-md.h.
	(main): Call init_rtx_reader_args instead of init_md_reader_args.
	* genattr.c (main): Likewise.
	* genattrtab.c (main): Likewise.
	* genautomata.c (main): Likewise.
	* gencodes.c (main): Likewise.
	* genconditions.c (main): Likewise.
	* genconfig.c (main): Likewise.
	* genconstants.c (main): Likewise.
	* genemit.c (main): Likewise.
	* genextract.c (main): Likewise.
	* genflags.c (main): Likewise.
	* genopinit.c (main): Likewise.
	* genoutput.c (main): Likewise.
	* genpeep.c (main): Likewise.
	* genrecog.c (main): Likewise.
	* genpreds.c (main): Likewise.
	* gensupport.h (in_fname): Move to read-md.h.
	(init_md_reader_args_cb): Rename to...
	(init_rtx_reader_args_cb): ...this and return a bool.
	(init_md_reader_args): Rename to...
	(init_rtx_reader_args): ...this and return a bool.
	(include_callback): Move to read-md.h.
	* gensupport.c (in_fname, include_callback, base_dir, max_include_len)
	(file_name_list, first_dir_md_include): Move to read-md.c
	(first_bracket_include): Delete unused variable.
	(last_dir_md_include): Move to read-md.c.
	(process_include): Delete, moving code to read-md.c:handle_include.
	(process_rtx): Don't handle INCLUDE.
	(save_string): Delete.
	(rtx_handle_directive): New function.
	(init_md_reader_args_cb): Rename to...
	(init_rtx_reader_args_cb): ...this and return a boolean success value.
	Use read_md_args.
	(init_md_reader_args): Rename to...
	(init_rtx_reader_args): ...this and return a boolean success value.
	* rtl.def (INCLUDE): Delete.
	* rtl.h (read_rtx): Remove "int *" argument.  Add "const char *"
	argument.
	* read-rtl.c (read_conditions): Don't gobble ')' here.
	(read_mapping): Likewise.
	(read_rtx): Remove LINENO argument.  Add RTX_NAME argument.
	Handle top-level non-rtx constructs here rather than in read_rtx_1.
	Store the whole queue in *X.  Remove call to init_md_reader.
	(read_rtx_1): Rename to...
	(read_rtx_code): ...this.  Call read_nested_rtx to read subrtxes.
	Don't handle top-level non-rtx constructs here.  Don't handle (nil)
	here.
	(read_nested_rtx): New function.  Handle (nil) here rather than
	in read_rtx_code.
	(read_rtx_variadic): Call read_nested_rtx to read subrtxes.  Don't
	gobble ')' here.
	* read-md.h (directive_handler_t): New type.
	(in_fname, include_callback): Moved from read-md.h.
	(read_constants, init_md_reader): Delete.
	(read_md_files): Declare.
	* read-md.c (file_name_list, in_fname, base_dir, first_dir_md_include)
	(last_dir_md_include_ptr, include_callback, max_include_len): Moved
	from gensupport.c.
	(read_constants): Rename to...
	(handle_constants): ...this.  Don't gobble ')' here.
	(handle_include, handle_file, handle_toplevel_file)
	(parse_include): New functions, mostly taken from gensupport.c.
	(init_md_reader): Subsume into...
	(read_md_files): ...this new function.

From-SVN: r160577
2010-06-10 20:23:13 +00:00
Richard Sandiford 9f418533f2 Makefile.in (READ_MD_H): Add $(HASHTAB_H).
gcc/
	* Makefile.in (READ_MD_H): Add $(HASHTAB_H).
	(build/genconstants.o): Depend on $(READ_MD_H) gensupport.h.
	* genconstants.c: Include read-md.h.
	* read-rtl.c (md_constants): Move to read-md.c.
	(md_name): Move to read-md.h.
	(initialize_iterators): Use leading_string_hash instead of def_hash
	and leading_string_eq_p instead of def_name_eq_p.
	(read_name): Move to read-md.c.
	(def_hash, def_name_eq_p): Delete.
	(read_constants, traverse_md_constants): Move to read-md.c.
	* rtl.h (md_constant, traverse_md_constants): Move to read-md.h.
	* read-md.h: Include hashtab.h.
	(md_name): Moved from read-rtl.c.
	(md_constant): Moved from read-md.h.
	(leading_string_hash, leading_string_eq_p, read_name)
	(read_constants, traverse_md_constants): Declare.
	* read-md.c (md_constants): Moved from read-rtl.c.
	(leading_string_hash, leading_string_eq_p): New functions.
	(read_name, read_constants, traverse_md_constants): Moved from
	read-rtl.c.

From-SVN: r160575
2010-06-10 20:22:49 +00:00
Richard Sandiford c5e88b399c read-md.h (read_md_file): Declare.
gcc/
	* read-md.h (read_md_file): Declare.
	(read_char, unread_char): New functions.
	(fatal_with_file_and_line, fatal_expected_char, read_skip_spaces)
	(read_quoted_string, read_string): Remove FILE * argument.
	* read-md.c (read_md_file): New variable.
	(read_md_filename, read_md_lineno): Update comments and remove
	unnecessary initialization.
	(fatal_with_file_and_line, fatal_expected_char, read_skip_spaces)
	(read_escape, read_quoted_string, read_braced_string, read_string):
	Remove FILE * argument.  Update calls accordingly, using read_char
	and unread_char instead of getc and ungetc.
	* rtl.h (read_rtx): Remove FILE * argument.
	* read-rtl.c (iterator_group): Remove FILE * argument from
	"find_builtin".
	(iterator_traverse_data): Remove "infile" field.
	(find_mode, find_code, apply_mode_maps, apply_iterator_to_rtx)
	(add_mapping, read_name, read_constants, read_conditions)
	(validate_const_int, find_iterator, read_mapping, check_code_iterator)
	(read_rtx, read_rtx_1, read_rtx_variadic): Remove FILE * argument.
	Remove file arguments from all calls, using read_char and unread_char
	instead of getc and ungetc.
	* gensupport.c (process_include): Preserve read_md_file around
	the include.  Set read_md_file to the handle of the included file.
	Update call to read_rtx.
	(init_md_reader_args_cb): Set read_md_file to the handle of the file
	and remove local FILE *.  Update calls to read_rtx.

From-SVN: r160572
2010-06-10 20:21:44 +00:00
Richard Sandiford 1069247787 Makefile.in (READ_MD_H): New variable.
gcc/
	* Makefile.in (READ_MD_H): New variable.
	(BUILD_RTL): Add build/read-md.o.
	(lto-wrapper.o): Depend on coretypes.h instead of defaults.h.
	(build/gensupport.o, build/read-rtl.o, build/genattr.o)
	(build/genattrtab.o, build/genconditions.o build/genemit.o)
	(build/genextract.o, build/genflags.o, build/genoutput.o)
	(build/genpreds.o, build/genrecog.o): Depend on $(READ_MD_H).
	(build/read-md.o): New rule.
	* defaults.h (obstack_chunk_alloc, obstack_chunk_free)
	(OBSTACK_CHUNK_SIZE, gcc_obstack_init): Move to...
	* coretypes.h: ...here.
	* lto-wrapper.c: Include coretypes.h instead of defaults.h.
	* pretty-print.c (obstack_chunk_alloc, obstack_chunk_free): Delete.
	* genattr.c: Include read-md.h.
	* genattrtab.c: Likewise.
	* genconditions.c: Likewise.
	* genemit.c: Likewise.
	* genextract.c: Likewise.
	* genflags.c: Likewise.
	* genoutput.c: Likewise.
	* genpreds.c: Likewise.
	* genrecog.c: Likewise.
	* rtl.h (read_skip_spaces, copy_rtx_ptr_loc, print_rtx_ptr_loc)
	(join_c_conditions, print_c_condition, read_rtx_filename)
	(read_rtx_lineno): Move to read-md.h.
	* read-rtl.c: Include read-md.h.
	(ptr_loc, string_obstack, ptr_locs, ptr_loc_obstack)
	(joined_conditions, joined_conditions_obstack, read_rtx_lineno)
	(read_rtx_filename, fatal_with_file_and_line, fatal_expected_char)
	(leading_ptr_hash, leading_ptr_eq_p, set_rtx_ptr_loc, get_rtx_ptr_loc)
	(copy_rtx_ptr_loc, print_rtx_ptr_loc, join_c_conditions)
	(print_c_condition, read_skip_spaces, read_escape, read_quoted_string)
	(read_braced_string, read_string): Move to read-md.c.
	(read_rtx): Move some initialization to init_md_reader and call
	init_md_reader here.
	* gensupport.h (message_with_line, n_comma_elts, scan_comma_elt):
	Move to read-md.h.
	* gensupport.c: Include read-md.h.
	(message_with_line, n_comma_elts, scan_comma_elt): Move to
	read-md.c.
	* read-md.h, read-md.c: New files.

From-SVN: r160570
2010-06-10 20:21:23 +00:00
Laurynas Biveinis a9429e29f5 utils.c (init_gnat_to_gnu): Use typed GC allocation.
gcc/ada:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* gcc-interface/utils.c (init_gnat_to_gnu): Use typed GC
	allocation.
	(init_dummy_type): Likewise.
	(gnat_pushlevel): Likewise.

	* gcc-interface/trans.c (Attribute_to_gnu): Likewise.
	(Subprogram_Body_to_gnu): Likewise.
	(Compilation_Unit_to_gnu): Likewise.
	(start_stmt_group): Likewise.
	(extract_encoding): Likewise.
	(decode_name): Likewise.

	* gcc-interface/misc.c (gnat_printable_name): Likewise.

	* gcc-interface/decl.c (annotate_value): Likewise.

	* gcc-interface/ada-tree.h (struct lang_type): Add variable_size
	GTY option.
	(struct lang_decl): Likewise.
	(SET_TYPE_LANG_SPECIFIC): Use typed GC allocation.
	(SET_DECL_LANG_SPECIFIC): Likewise.

gcc/c-family:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* c-pragma.c (push_alignment): Use typed GC allocation.
	(handle_pragma_push_options): Likewise.

	* c-common.c (parse_optimize_options): Likewise.

	* c-common.h (struct sorted_fields_type): Add variable_size GTY
	option.

gcc/cp:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* typeck2.c (abstract_virtuals_error): Likewise.

	* pt.c (maybe_process_partial_specialization): Likewise.
	(register_specialization): Likewise.
	(add_pending_template): Likewise.
	(lookup_template_class): Likewise.
	(push_tinst_level): Likewise.

	* parser.c (cp_lexer_new_main): 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.

	* name-lookup.c (binding_entry_make): Likewise.
	(binding_table_construct): Likewise.
	(binding_table_new): Likewise.
	(cxx_binding_make): Likewise.
	(pushdecl_maybe_friend): Likewise.
	(begin_scope): Likewise.
	(push_to_top_level): Likewise.

	* lex.c (init_reswords): Likewise.
	(retrofit_lang_decl): Likewise.
	(cxx_dup_lang_specific_decl): Likewise.
	(copy_lang_type): Likewise.
	(cxx_make_type): Likewise.

	* decl.c (make_label_decl): Likewise.
	(check_goto): Likewise.
	(start_preparsed_function): Likewise.
	(save_function_data): Likewise.

	* cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise.

	* cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.

	* class.c (finish_struct_1): Likewise.

	* cp-tree.h (struct lang_type): Add variable_size GTY option.
	(struct lang_decl): Likewise.

	* parser.c (cp_parser_new): Update comment to not reference
	ggc_alloc.

gcc/fortran:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* trans-types.c (gfc_get_nodesc_array_type): Use typed GC
	allocation.
	(gfc_get_array_type_bounds): Likewise.

	* trans-decl.c (gfc_allocate_lang_decl): Likewise.
	(gfc_find_module): Likewise.

	* f95-lang.c (pushlevel): Likewise.

	* trans.h (struct lang_type): Add variable_size GTY option.
	(struct lang_decl): Likewise.

gcc/java:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* jcf-reader.c (jcf_parse_constant_pool): Use typed GC allocation.

	* jcf-parse.c (java_parse_file): Likewise.
	(process_zip_dir): Likewise.

	* java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): Likewise.
	(MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Likewise.

	* expr.c (add_type_assertion): Likewise.

	* decl.c (make_binding_level): Likewise.
	(java_dup_lang_specific_decl): Likewise.

	* constants.c (set_constant_entry): Likewise.
	(cpool_for_class): Likewise.

	* class.c (add_method_1): Likewise.
	(java_treetreehash_new): Likewise.

	* java-tree.h (struct lang_type): Add variable_size GTY option.
	(struct lang_decl): Likewise.

	* jch.h (struct cpool_entry): Likewise.

	* java-tree.h (java_treetreehash_create): Remove parameter ggc.

	* except.c (prepare_eh_table_type): Update
	java_treetreehash_create call.

	* class.c (add_method_1): Update java_treetreehash_create call.
	(java_treetreehash_create): Remove parameter gc.  Use
	htab_create_ggc.

gcc/lto:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* lto.c (lto_read_in_decl_state): Use typed GC allocation.
	(lto_file_read): Likewise.
	(new_partition): Likewise.
	(read_cgraph_and_symbols): Likewise.

gcc/objc:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* objc-act.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Use typed GC
	allocation.

	* objc-act.c (objc_volatilize_decl): Likewise.
	(objc_build_string_object): Likewise.
	(hash_init): Likewise.
	(hash_enter): Likewise.
	(hash_add_attr): Likewise.
	(add_class): Likewise.
	(start_class): Likewise.

gcc/objcp:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* objcp-decl.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Use typed GC
	allocation.

gcc:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* doc/tm.texi (Per-Function Data): Do not reference ggc_alloc.

	* doc/gty.texi (GTY Options): Document typed GC allocation and
	variable_size GTY option.

	* ggc-internal.h: New.

	* ggc.h: Update copyright year.
	(digit_string): Move to stringpool.c.
	(ggc_mark_stringpool, ggc_purge_stringpool, ggc_mark_roots)
	(gt_pch_save_stringpool, gt_pch_fixup_stringpool)
	(gt_pach_restore_stringpool, gt_pch_p_S, gt_pch_note_object)
	(init_ggc_pch, ggc_pch_count_object, ggc_pch_total_size)
	(ggc_pch_this_base, ggc_pch_alloc_object, ggc_pch_prepare_write)
	(ggc_pch_write_object, ggc_pch_finish, ggc_pch_read)
	(ggc_force_collect, ggc_get_size, ggc_statistics)
	(ggc_print_common_statistics): Move to ggc-internal.h.
	(digit_vector, new_ggc_zone, destroy_ggc_zone, ggc_alloc_stat)
	(ggc_alloc, ggc_alloc_cleared, ggc_realloc, ggc_calloc, GGC_NEW)
	(GGC_CNEW, GGC_NEWVEC, GGC_CNEWVEC, GGC_NEWVAR, ggc_alloc_rtvec)
	(ggc_alloc_tree, gt_pch_save, ggc_min_expand_heuristic)
	(ggc_min_heapsize_heuristic, ggc_alloc_zone)
	(ggc_alloc_zone_pass_stat): Remove.
	(ggc_internal_alloc_stat, ggc_internal_alloc)
	(ggc_internal_cleared_alloc_stat): New.
	(GGC_RESIZEVEC, GGC_RESIZEVAR): Redefine.
	(ggc_internal_vec_alloc_stat)
	(ggc_internal_cleared_vec_alloc_stat)
	(ggc_internal_vec_alloc_stat, ggc_internal_cleared_vec_alloc)
	(ggc_alloc_atomic_stat, ggc_alloc_atomic)
	(ggc_alloc_cleared_atomic, ggc_cleared_alloc_htab_ignore_args)
	(ggc_cleared_alloc_ptr_array_two_args): New.
	(htab_create_ggc, splay_tree_new_ggc): Redefine.
	(ggc_splay_alloc): Change the type of the first argument to
	enum gt_types_enum.
	(ggc_alloc_string): Make macro.
	(ggc_alloc_string_stat): New.
	(ggc_strdup): Redefine.
	(rtl_zone, tree_zone, tree_id_zone): Declare unconditionally.
	(ggc_alloc_rtvec_sized): New.
	(ggc_alloc_zone_stat): Rename to ggc_internal_alloc_zone_stat.
	(ggc_internal_alloc_zone_pass_stat, ggc_internal_alloc_zone_stat)
	(ggc_internal_cleared_alloc_zone_stat)
	(ggc_internal_zone_alloc_stat)
	(ggc_internal_zone_cleared_alloc_stat)
	(ggc_internal_zone_vec_alloc_stat)
	(ggc_alloc_zone_rtx_def_stat)
	(ggc_alloc_zone_tree_node_stat)
	(ggc_alloc_zone_cleared_tree_node_stat)
	(ggc_alloc_cleared_gimple_statement_d_stat): New.

	* ggc-common.c: Include ggc-internal.h.
	(ggc_internal_cleared_alloc_stat): Rename from
	ggc_alloc_cleared_stat.
	(ggc_realloc_stat): Use ggc_internal_alloc_stat.
	(ggc_calloc): Remove.
	(ggc_cleared_alloc_htab_ignore_args): New.
	(ggc_cleared_alloc_ptr_array_two_args): New.
	(ggc_splay_alloc): Add obj_type parameter.
	(init_ggc_heuristics): Formatting fixes.

	* ggc-none.c: Update copyright year.
	(ggc_alloc_stat): Rename to ggc_alloc_stat.
	(ggc_alloc_cleared_stat): Rename to
	ggc_internal_cleared_alloc_stat.
	(struct alloc_zone, rtl_zone, tree_zone, tree_id_zone): New.

	* ggc-page.c: Update copyright year.  Include ggc-internal.h.
	Remove references to ggc_alloc in comments.
	(ggc_alloc_typed_stat): Call ggc_internal_alloc_stat.
	(ggc_alloc_stat): Rename to ggc_internal_alloc_stat.
	(new_ggc_zone, destroy_ggc_zone): Remove.
	(struct alloc_zone, rtl_zone, tree_zone, tree_id_zone): New.

	* ggc-zone.c: Include ggc-internal.h.  Remove references to
	ggc_alloc in comments.
	(ggc_alloc_zone_stat): ggc_internal_alloc_zone_stat.
	(ggc_internal_alloc_zone_pass_stat): New.
	(ggc_internal_cleared_alloc_zone_stat): New.
	(ggc_alloc_typed_stat): Use ggc_internal_alloc_zone_pass_stat.
	(ggc_alloc_stat): Rename ggc_internal_alloc_stat.
	(new_ggc_zone, destroy_ggc_zone): Remove.

	* stringpool.c: Update copyright year.  Include ggc-internal.h
	(digit_vector): Make static.
	(digit_string): Moved from ggc.h.
	(stringpool_ggc_alloc): Use ggc_alloc_atomic.
	(ggc_alloc_string): Rename to ggc_alloc_string_stat.

	* Makefile.in (GGC_INTERNAL_H): New.
	(ggc_common.o, ggc-page.o, ggc-zone.o, stringpool.o): Add
	$(GGC_INTERNAL_H) to dependencies.

	* gentype.c: Update copyright year.
	(walk_type): Accept variable_size GTY option.
	(USED_BY_TYPED_GC_P): New macro.
	(write_enum_defn): Use USED_BY_TYPED_GC_P.  Do not output
	whitespace at the end of strings.
	(get_type_specifier, variable_size_p): New functions.
	(alloc_quantity, alloc_zone): New enums.
	(write_typed_alloc_def): New function.
	(write_typed_struct_alloc_def): Likewise.
	(write_typed_typed_typedef_alloc_def): Likewise.
	(write_typed_alloc_defns): Likewise.
	(output_typename, write_splay_tree_allocator_def): Likewise.
	(write_splay_tree_allocators): Likewise.
	(main): Call write_typed_alloc_defns and
	write_splay_tree_allocators.

	* lto-streamer.h (lto_file_decl_data_ptr): New.

	* passes.c (order): Define using cgraph_node_ptr.

	* strinpool.c (struct string_pool_data): Declare nested_ptr using
	ht_identifier_ptr.

	* gimple.h (union gimple_statement_d): Likewise.

	* rtl.h (struct rtx_def): Likewise.
	(struct rtvec_def): Likewise.

	* tree.h (union tree_node): Likewise.

	* tree-ssa-operands.h (struct ssa_operand_memory_d): Likewise.

	* cfgloop.c (record_loop_exits): Use htab_create_ggc.

	* tree-scalar-evolution.c (scev_initialize): Likewise.

	* alias.c (record_alias_subset): Update splay_tree_new_ggc call.

	* dwarf2asm.c (dw2_force_const_mem): Likewise.

	* omp-low.c (lower_omp_critical): Likewise.

	* bitmap.h (struct bitmap_head_def): Update comment to not
	reference ggc_alloc.

	* config/pa/pa.c (get_deferred_label): Use GGC_RESIZEVEC.

	* ira.c (fix_reg_equiv_init): Use GGC_RESIZEVEC.

	* ipa-prop.c (duplicate_ggc_array): Rename to
	duplicate_ipa_jump_func_array.  Use typed GC allocation.
	(ipa_edge_duplication_hook): Call duplicate_ipa_jump_func_array.

	* gimple.c (gimple_alloc_stat): Use
	ggc_alloc_cleared_gimple_statement_d_stat.

	* varasm.c (create_block_symbol): Use ggc_alloc_zone_rtx_def.

	* tree.c (make_node_stat): Use
	ggc_alloc_zone_cleared_tree_node_stat.
	(make_tree_vec_stat): Likewise.
	(build_vl_exp_stat): Likewise.
	(copy_node_stat): Use ggc_alloc_zone_tree_node_stat.
	(make_tree_binfo_stat): Likewise.
	(tree_cons_stat): Likewise.

	* rtl.c (rtx_alloc_stat): Use ggc_alloc_zone_rtx_def_stat.
	(shallow_copy_rtx_stat): Likewise.
	(make_node_stat): Likewise.

	* lto-symtab.c: Fix comment.

	* tree-cfg.c (create_bb): Update comment to not reference
	ggc_alloc_cleared.
	* tree-ssa-structalias.c (struct heapvar_for_stmt): Fix param_is
	value.

	* varpool.c (varpool_node): Use typed GC allocation.
	(varpool_extra_name_alias): Likewise.

	* varasm.c (emutls_decl): Likewise.
	(get_unnamed_section): Likewise.
	(get_noswitch_section): Likewise.
	(get_section): Likewise.
	(get_block_for_section): Likewise.
	(build_constant_desc): Likewise.
	(create_constant_pool): Likewise.
	(force_const_mem): Likewise.

	* tree.c (build_vl_exp_stat): Likewise.
	(build_real): Likewise.
	(build_string): Likewise.
	(decl_debug_expr_insert): Likewise.
	(decl_value_expr_insert): Likewise.
	(type_hash_add): Likewise.
	(build_omp_clause): Likewise.

	* tree-ssanames.c (duplicate_ssa_name_ptr_info): Likewise.

	* tree-ssa.c (init_tree_ssa): Likewise.

	* tree-ssa-structalias.c (heapvar_insert): Likewise.

	* tree-ssa-operands.c (ssa_operand_alloc): Likewise.

	* tree-ssa-loop-niter.c (record_estimate): Likewise.

	* tree-ssa-alias.c (get_ptr_info): Likewise.

	* tree-scalar-evolution.c (new_scev_info_str): Likewise.

	* tree-phinodes.c (allocate_phi_node): Likewise.

	* tree-iterator.c (tsi_link_before): Likewise.
	(tsi_link_after): Likewise.

	* tree-eh.c (add_stmt_to_eh_lp_fn): Likewise.

	* tree-dfa.c (create_var_ann): Likewise.

	* tree-cfg.c (create_bb): Likewise.

	* toplev.c (alloc_for_identifier_to_locale): Likewise.
	(general_init): Likewise.

	* stringpool.c (stringpool_ggc_alloc): Likewise.
	(gt_pch_save_stringpool): Likewise.

	* sese.c (if_region_set_false_region): Likewise.

	* passes.c (do_per_function_toporder): Likewise.

	* optabs.c (set_optab_libfunc): Likewise.
	(set_conv_libfunc): Likewise.

	* lto-symtab.c (lto_symtab_register_decl): Likewise.

	* lto-streamer-in.c (lto_input_eh_catch_list): Likewise.
	(input_eh_region): Likewise.
	(input_eh_lp): Likewise.
	(make_new_block): Likewise.
	(unpack_ts_real_cst_value_fields): Likewise.

	* lto-section-in.c (lto_new_in_decl_state): Likewise.

	* lto-cgraph.c (input_node_opt_summary): Likewise.

	* loop-init.c (loop_optimizer_init): Likewise.

	* lambda.h (lambda_vector_new): Likewise.

	* lambda-code.c (replace_uses_equiv_to_x_with_y): Likewise.

	* ira.c (update_equiv_regs): Likewise.

	* ipa.c (cgraph_node_set_new): Likewise.
	(cgraph_node_set_add): Likewise.
	(varpool_node_set_new): Likewise.
	(varpool_node_set_add): Likewise.

	* ipa-prop.c (ipa_compute_jump_functions_for_edge): Likewise.
	(duplicate_ipa_jump_func_array): Likewise.
	(ipa_read_node_info): Likewise.

	* ipa-cp.c (ipcp_create_replace_map): Likewise.

	* integrate.c (get_hard_reg_initial_val): Likewise.

	* gimple.c (gimple_alloc_stat): Likewise.
	(gimple_build_omp_for): Likewise.
	(gimple_seq_alloc): Likewise.
	(gimple_copy): Likewise.

	* gimple-iterator.c (gsi_insert_before_without_update): Likewise.
	(gsi_insert_after_without_update): Likewise.

	* function.c (add_frame_space): Likewise.
	(insert_temp_slot_address): Likewise.
	(assign_stack_temp_for_type): Likewise.
	(allocate_struct_function): Likewise.
	(types_used_by_var_decl_insert): 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.

	* emit-rtl.c (get_mem_attrs): Likewise.
	(get_reg_attrs): Likewise.
	(start_sequence): Likewise.
	(init_emit): Likewise.

	* dwarf2out.c (new_cfi): Likewise.
	(queue_reg_save): Likewise.
	(dwarf2out_frame_init): Likewise.
	(new_loc_descr): Likewise.
	(find_AT_string): 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.
	(loc_descriptor): Likewise.
	(add_loc_descr_to_each): Likewise.
	(add_const_value_attribute): Likewise.
	(tree_add_const_value_attribute): Likewise.
	(add_comp_dir_attribute): Likewise.
	(add_name_and_src_coords_attributes): Likewise.
	(lookup_filename): Likewise.
	(store_vcall_insn): Likewise.
	(dwarf2out_init): Likewise.

	* dbxout.c (dbxout_init): Likewise.

	* config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise.

	* config/sparc/sparc.c (sparc_init_machine_status): Likewise.

	* config/score/score7.c (score7_output_external): Likewise.

	* config/score/score3.c (score3_output_external): Likewise.

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

	* config/rs6000/rs6000.c (builtin_function_type): Likewise.
	(rs6000_init_machine_status): Likewise.
	(output_toc): Likewise.

	* config/pa/pa.c (pa_init_machine_status): Likewise.
	(get_deferred_plabel): Likewise.

	* config/moxie/moxie.c (moxie_init_machine_status): Likewise.

	* config/mmix/mmix.c (mmix_init_machine_status): Likewise.

	* config/mips/mips.c (mflip_mips16_use_mips16_p): Likewise.

	* config/mep/mep.c (mep_init_machine_status): Likewise.
	(mep_note_pragma_flag): Likewise.

	* config/m32c/m32c.c (m32c_init_machine_status): Likewise.

	* config/iq2000/iq2000.c (iq2000_init_machine_status): Likewise.

	* config/ia64/ia64.c (ia64_init_machine_status): Likewise.

	* config/i386/winnt.c (i386_pe_record_external_function): Likewise.
	(i386_pe_maybe_record_exported_symbol): Likewise.

	* config/i386/i386.c (get_dllimport_decl): Likewise.
	(ix86_init_machine_status): Likewise.
	(assign_386_stack_local): Likewise.

	* config/frv/frv.c (frv_init_machine_status): Likewise.

	* config/darwin.c (machopic_indirection_name): Likewise.

	* config/cris/cris.c (cris_init_machine_status): Likewise.

	* config/bfin/bfin.c (bfin_init_machine_status): Likewise.

	* config/avr/avr.c (avr_init_machine_status): Likewise.

	* config/arm/arm.c (arm_init_machine_status): Likewise.

	* config/alpha/alpha.c (alpha_init_machine_status): Likewise.
	(alpha_need_linkage): Likewise.
	(alpha_use_linkage): Likewise.

	* cgraph.c (cgraph_allocate_node): Likewise.
	(cgraph_create_edge_1): Likewise.
	(cgraph_create_indirect_edge): Likewise.
	(cgraph_add_asm_node): Likewise.

	* cfgrtl.c (init_rtl_bb_info): Likewise.

	* cfgloop.c (alloc_loop): Likewise.
	(rescan_loop_exit): Likewise.

	* cfg.c (init_flow): Likewise.
	(alloc_block): Likewise.
	(unchecked_make_edge): Likewise.

	* c-parser.c (c_parse_init): Likewise.
	(c_parse_file): Likewise.

	* c-decl.c (bind): Likewise.
	(record_inline_static): Likewise.
	(push_scope): Likewise.
	(make_label): Likewise.
	(lookup_label_for_goto): Likewise.
	(finish_struct): Likewise.
	(finish_enum): Likewise.
	(c_push_function_context): Likewise.

	* bitmap.c (bitmap_element_allocate): Likewise.
	(bitmap_gc_alloc_stat): Likewise.

	* alias.c (record_alias_subset): Likewise.
	(init_alias_analysis): Likewise.

include:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* splay-tree.h: Update copyright years.
	(splay_tree_s): Document fields.
	(splay_tree_new_typed_alloc): New.

	* hashtab.h: Update copyright years.
	(htab_create_typed_alloc): New.

libcpp:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* include/symtab.h (ht_identifier_ptr): New.

libiberty:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* splay-tree.c: Update copyright years.
	(splay_tree_new_typed_alloc): New.
	(splay_tree_new_with_allocator): Use it.

	* hashtab.c: Update copyright years.
	(htab_create_typed_alloc): New.
	(htab_create_alloc): Use it.

	* functions.texi: Regenerate.

From-SVN: r160425
2010-06-08 07:25:24 +00:00
Jan Hubicka 5936d944f8 fwprop.c: Make emit-rtl.h include last.
* fwprop.c: Make emit-rtl.h include last.
	* rtlanal.c: Include emit-rtl.h.
	* genautomata.c: Output emit-rtl include into insn-automata.c
	* df-scan.c: Include emit-rtl.h.
	* haifa-sched.c: Indlude emit-rtl.h.
	* mode-switching.c: Indlude emit-rtl.h.
	* graph.c: Indlude emit-rtl.h.
	* sel-sched.c: Include emit-rtl.h.
	* sel-sched-ir.c: Include emit-rtl.h.
	* ira-build.c: Include emit-rtl.h.
	* emit-rtl.c: (first_insn, last_insn): Remove defines.
	(get_insns, set_first_insn, get_last_insn, set_last_insn, get_max_uid):
	Move to emit-rtl.h.
	(set_new_first_and_last_insn, get_last_insn_anywhere, get_first_nonnote_insn,
	get_last_nonnote_insn, try_split, make_call_insn_raw, add_insn_after,
	add_insn_before, remove_insn, delete_insns_since, reorder_insns_nobb,
	emit_insn_after_1, emit_debug_insn_before, emit_insn, start_sequence,
	push_to_sequence, push_to_sequence2, push_topmost_sequence, end_sequence,
	copy_insn): Use accessor functions.
	* emit-rtl.h (gen_blockage, gen_rtvec, copy_insn_1, copy_insn,
	 gen_int_mode, emit_copy_of_insn_after, set_reg_attrs_from_value,
	set_reg_attrs_for_parm, set_reg_attrs_for_decl_rtl, adjust_reg_mode,
	mem_expr_equal_p): Move here from rtl.h
	(get_insns, set_first-insn, get_last_insn, set_last_insn, get_max_uid):
	Move here from emit-rtl.c; make inline.
	* cfglayout.h: Include emit-rtl.h
	* rtl.h (gen_blockage, gen_rtvec, copy_insn_1, copy_insn,
	 gen_int_mode, emit_copy_of_insn_after, set_reg_attrs_from_value,
	set_reg_attrs_for_parm, set_reg_attrs_for_decl_rtl, adjust_reg_mode,
	mem_expr_equal_p, get_insns, set_first-insn, get_last_insn, set_last_insn,
	get_max_uid): Move to emit-rtl.h.
	* reg-stack.c: Include emit-rtl.h
	* dce.c: Likewise.

From-SVN: r160111
2010-06-01 15:49:37 +00:00
Steven Bosscher d477d1feda explow.c (set_stack_check_libfunc): Adjust to accept name as a string instead of SYMBOL_REF rtx.
gcc/ChangeLog:
	* explow.c (set_stack_check_libfunc): Adjust to accept name as a
	string instead of SYMBOL_REF rtx.
	* rtl.h (set_stack_check_libfunc): Move prototype from here...
	* libfuncs.h: ...to here.  Adjust for explow.c change.

ada/ChangeLog:
	* gcc-interface/trans.c: Do not include rtl.h, insclude libfuncs.h.
	(gigi): Adjust call to set_stack_check_libfunc.

From-SVN: r159900
2010-05-26 21:46:22 +00:00
Steven Bosscher d347d97ea2 rtl.h (decl_default_tls_model): Move prototype from here...
gcc/ChangeLog:
	* rtl.h (decl_default_tls_model): Move prototype from here...
	* output.h: ...to here.
	* c-decl.c: Do not include rtl.h.
	* c-pragma.c: Likewise.
	* c-parser.c: Likewise.
	* c-gimplify.c: Likewise.  And also not hard-reg-set.
	* c-common.c: Do not include rtl.h.  Include tm_p.h and add a
	FIXME note for it.  Add a FIXME note for expr.h.
	* config/i386/i386-protos.h (ix86_enum_va_list, ix86_fn_abi_va_list,
	ix86_canonical_va_list_type): Make visible even if RTX_CODE is not
	defined.

cp/ChangeLog:
	* decl.c: Do not include rtl.h
	* semantics.c: Likewise.

ada/ChangeLog:
	* gcc-interface/utils.c: Do not include rtl.h.

fortran/ChangeLog:
	* trans-common.c: Do not include rtl.h, include output.h instead.
	* trans-decl.c: Likewise.

From-SVN: r159856
2010-05-26 08:36:49 +00:00
Steven Bosscher a2c9fe4253 rtl.h (union rtunion_def): Remove rt_bit member.
* rtl.h (union rtunion_def): Remove rt_bit member.
	(XBITMAP, X0BITMAP, XCBITMAP): Remove.
	* print-rtl (print_rtx): Do not print the member.
	* gengtype.c (adjust_field_rtx_def): Do not handle it.
	* gengenrtl.c (type_from_format): Likewise.
	(accessor_from_format): Likewise.

From-SVN: r159698
2010-05-22 14:15:50 +00:00
Steven Bosscher f4ce02c5bf vecir.h: New file with VEC primitives for tree, gimple, and rtl.
gcc/ChangeLog
	* vecir.h: New file with VEC primitives for tree, gimple, and rtl.
	* Makefile.in: Add it.
	Fix all other Makefile dependencies for changes below.
	* tree.h: Include it instead of defining VEC primitives here.
	* gimple.h: Likewise.
	* rtl.h: Likewise.
	* tree-inline.h: Inlclude vecir.h instead of gimple.h.
	* except.h: Include vecir.h, break dependence on tree.h.

	* gimplify.c (append_to_statement_list_1, append_to_statement_list):
	Move from here...
	* tree-iterator.c: ...to here.
	* tree-iterator.h: Fix file introduction comment.  Add extern markers.

	* c-lex.c: Include fixed-value.h instead of rtl.h.  Do not include
	tm_p.h.
	* c-cppbuiltin.c: Explain why debug.h and tm_p.h are included.
	* c-objc-common.h: Do not include tm.h, rtl.h, insn-config.h,
	integrate.h, function.h, toplev.h, tree-inline.h, ggc.h,
	tree-mudflap.h, and target.h.
	* c-semantics.c: Do not include except.h, ggc.h, rtl.h, timevar.h,
	predict.h, tree-inline.h, gimple.h, and langhooks.h.
	* c-decl.c: Do not include expr.h, ggc.h, libfuncs.h, except.h.
	Add FIXME for why gimple.h is still included (should be unnecessary
	since GCC 4.5 gimplification unit-at-a-time).
	* c-typeck.c: Do not include rtl.h, tm_p.h, ggc.h, and gimple.h.
	* c-pragma.c: Add FIXME for why function.h needs to be included just
	for cfun, at front-end level.
	Add note that REGISTER_TARGET_PRAGMAS should probably be a target hook.
	Do not include ggc.h, but include vecprim.h for VEC(char).
	* c-opts.c: Do not include tm.h, tree-inline.h, and tm_p.h.
	Explain why target.h is included.
	* c-omp.h: Do not include tm.h, function.h, and bitmap.h.
	Explain why gimple.h is included.
	* c-ppoutput.c: Do not include tm.h.
	* c-common.c: Do not include gimple.h.  Explain why expr.h is included.
	* c-parses.c: Explain why rtl.h is included, and that this (and only
	this) is also why tm.h must be included.
	Do not include except.h.
	* c-lang.c: Do not include ggc.h.

cp/ChangeLog
	* decl.c: Include tree-iterator.h, as fixup for tree-inline.h changes.
	* Make-lang.in: Fix dependencies accordingly.

From-SVN: r159442
2010-05-15 20:02:11 +00:00
Alexandre Oliva e972a1d38a re PR debug/43478 (Missing DW_AT_location for a variable)
PR debug/43478
	* df-problems.c (struct dead_debug_use, struct dead_debug): New.
	(dead_debug_init, dead_debug_finish): New functions.
	(dead_debug_add, dead_debug_insert_before): Likewise.
	(df_note_bb_compute): Initialize a dead_debug object, add dead
	debug uses to it, insert debug bind insns before death insns,
	reset debug insns that refer to pending uses at the end.
	* rtl.h (make_debug_expr_from_rtl): New prototype.
	* varasm.c (make_debug_expr_from_rtl): New function.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>

From-SVN: r159063
2010-05-05 12:43:36 +02:00
Anatoly Sokolov 3e93ff8196 rtl.h (CONST_DOUBLE_P): Define.
* rtl.h (CONST_DOUBLE_P): Define.
	(rtx_to_double_int): Declare.
	* emit-rtl.c (rtx_to_double_int): New function.
	* dwarf2out.c (insert_double): New function.
	(loc_descriptor, add_const_value_attribute): Clean up, use
	rtx_to_double_int and insert_double functions.

From-SVN: r158963
2010-05-01 21:52:02 +04:00
Anatoly Sokolov 54fb1ae03e double-int.h (double_int_setbit): Declare.
* double-int.h (double_int_setbit): Declare.
	* double-int.c (double_int_setbit): New function.
	* rtl.h (immed_double_int_const): Declare.
	* emit-rtl.c (immed_double_int_const): New function.
	* builtins.c (expand_builtin_signbit): Clean up, use double_int_*
	and immed_double_int_const functions.
	* optabs.c (expand_absneg_bit, expand_copysign_absneg,
	expand_copysign_bit):  (Ditto.).
	* simplify-rtx.c (simplify_binary_operation_1): (Ditto.).
	* tree-ssa-address.c (addr_for_mem_ref): (Ditto.).
	* dojump.c (prefer_and_bit_test): (Ditto.).
	* expr.c (convert_modes, reduce_to_bit_field_precision,
	const_vector_from_tree): (Ditto.).
	* expmed.c (mask_rtx, lshift_value): (Ditto.).

From-SVN: r158566
2010-04-20 20:33:46 +04:00
Jakub Jelinek 457eeaae81 re PR debug/43051 (VTA causes a stack living parameter unavailable in most of the function)
PR debug/43051
	PR debug/43092
	* cselib.c (cselib_preserve_constants,
	cfa_base_preserved_val): New static variables.
	(preserve_only_constants): New function.
	(cselib_reset_table): If cfa_base_preserved_val is non-NULL, don't
	clear its REG_VALUES.  If cselib_preserve_constants, don't 
	empty the whole hash table, but preserve there VALUEs with constants,
	cfa_base_preserved_val and cfa_base_preserved_val plus constant.
	(cselib_preserve_cfa_base_value): New function.
	(cselib_invalidate_regno): Don't invalidate cfa_base_preserved_val.
	(cselib_init): Change argument to int bitfield.  Set
	cselib_preserve_constants to whether CSELIB_PRESERVE_CONSTANTS
	is in it.
	(cselib_finish): Clear cselib_preserve_constants and
	cfa_base_preserved_val.
	* cselib.h (enum cselib_record_what): New enum.
	(cselib_init): Change argument to int.
	(cselib_preserve_cfa_base_value): New prototype.
	* postreload.c (reload_cse_regs_1): Adjust cselib_init caller.
	* dse.c (dse_step1): Likewise.
	* cfgcleanup.c (thread_jump): Likewise.
	* sched-deps.c (sched_analyze): Likewise.
	* gcse.c (local_cprop_pass): Likewise.
	* simplify-rtx.c (simplify_replace_fn_rtx): Add argument to callback.
	If FN is non-NULL, call the callback always and whenever it returns
	non-NULL just return that.  Only do rtx_equal_p if FN is NULL.
	* rtl.h (simplify_replace_fn_rtx): Add argument to callback.
	* combine.c (propagate_for_debug_subst): Add old_rtx argument,
	compare from with old_rtx and if it isn't rtx_equal_p, return NULL.
	* Makefile.in (var-tracking.o): Depend on $(RECOG_H).
	* var-tracking.c: Include recog.h.
	(bb_stack_adjust_offset): Remove.
	(vt_stack_adjustments): Don't call it, instead just gather the
	adjustments using insn_stack_adjust_offset_pre_post on each bb insn.
	(adjust_stack_reference): Remove.
	(compute_cfa_pointer): New function.
	(hard_frame_pointer_adjustment, cfa_base_rtx): New static variables.
	(struct adjust_mem_data): New type.
	(adjust_mems, adjust_mem_uses, adjust_mem_stores, adjust_insn): New
	functions.
	(get_address_mode): New function.
	(replace_expr_with_values): Use it.
	(use_type): Don't do cselib_lookup for VAR_LOC_UNKNOWN_P.
	Use get_address_mode.  For cfa_base_rtx return MO_CLOBBER.
	(adjust_sets): Remove.
	(add_uses): Don't add extra MO_VAL_USE for cfa_base_rtx plus constant.
	Use get_address_mode.
	(get_adjusted_src): Remove.
	(add_stores): Don't call it.  Never reuse expr SET.  Don't add extra
	MO_VAL_USE for cfa_base_rtx plus constant.  Use get_address_mode.
	(add_with_sets): Don't call adjust_sets.
	(fp_setter, vt_init_cfa_base): New functions.
	(vt_initialize): Change return type to bool.  Move most of pool etc.
	initialization to the beginning of the function from end.  Pass
	CSELIB_RECORD_MEMORY | CSELIB_PRESERVE_CONSTANTS to cselib_init.
	If !frame_pointer_needed, call vt_stack_adjustment before mos
	vector is filled, call vt_init_cfa_base if argp/framep has been
	eliminated to sp.  If frame_pointer_needed and argp/framep has
	been eliminated to hard frame pointer, set
	hard_frame_pointer_adjustment and call vt_init_cfa_base after
	encountering fp setter in the prologue.  For MO_ADJUST, call
	log_op_type before pusing the op into mos vector, not afterwards.
	Call adjust_insn before cselib_process_insn/add_with_sets,
	call cancel_changes (0) afterwards.
	(variable_tracking_main_1): Adjust for vt_initialize calling
	vt_stack_adjustments and returning whether it succeeded or not.

	* gcc.dg/guality/pr43051-1.c: New test.

From-SVN: r157476
2010-03-16 11:50:42 +01:00
Jakub Jelinek ad3b056c27 re PR bootstrap/43121 (Bootstrap failure)
PR bootstrap/43121
	* except.c (sjlj_emit_function_enter): Don't call
	add_reg_br_prob_note, instead add REG_BR_PROB note to the last insn
	directly.
	* rtl.h (add_reg_br_prob_note): Remove prototype.

From-SVN: r156913
2010-02-19 23:12:25 +01:00
H.J. Lu b8698a0f37 Remove trailing white spaces.
2009-11-25  H.J. Lu  <hongjiu.lu@intel.com>

	* alias.c: Remove trailing white spaces.
	* alloc-pool.c: Likewise.
	* alloc-pool.h: Likewise.
	* attribs.c: Likewise.
	* auto-inc-dec.c: Likewise.
	* basic-block.h: Likewise.
	* bb-reorder.c: Likewise.
	* bt-load.c: Likewise.
	* builtins.c: Likewise.
	* builtins.def: Likewise.
	* c-common.c: Likewise.
	* c-common.h: Likewise.
	* c-cppbuiltin.c: Likewise.
	* c-decl.c: Likewise.
	* c-format.c: Likewise.
	* c-lex.c: Likewise.
	* c-omp.c: Likewise.
	* c-opts.c: Likewise.
	* c-parser.c: Likewise.
	* c-pretty-print.c: Likewise.
	* c-tree.h: Likewise.
	* c-typeck.c: Likewise.
	* caller-save.c: Likewise.
	* calls.c: Likewise.
	* cfg.c: Likewise.
	* cfganal.c: Likewise.
	* cfgexpand.c: Likewise.
	* cfghooks.c: Likewise.
	* cfghooks.h: Likewise.
	* cfglayout.c: Likewise.
	* cfgloop.c: Likewise.
	* cfgloop.h: Likewise.
	* cfgloopmanip.c: Likewise.
	* cfgrtl.c: Likewise.
	* cgraph.c: Likewise.
	* cgraph.h: Likewise.
	* cgraphbuild.c: Likewise.
	* cgraphunit.c: Likewise.
	* cif-code.def: Likewise.
	* collect2.c: Likewise.
	* combine.c: Likewise.
	* convert.c: Likewise.
	* coverage.c: Likewise.
	* crtstuff.c: Likewise.
	* cse.c: Likewise.
	* cselib.c: Likewise.
	* dbgcnt.c: Likewise.
	* dbgcnt.def: Likewise.
	* dbgcnt.h: Likewise.
	* dbxout.c: Likewise.
	* dce.c: Likewise.
	* ddg.c: Likewise.
	* ddg.h: Likewise.
	* defaults.h: Likewise.
	* df-byte-scan.c: Likewise.
	* df-core.c: Likewise.
	* df-problems.c: Likewise.
	* df-scan.c: Likewise.
	* df.h: Likewise.
	* dfp.c: Likewise.
	* diagnostic.c: Likewise.
	* diagnostic.h: Likewise.
	* dominance.c: Likewise.
	* domwalk.c: Likewise.
	* double-int.c: Likewise.
	* double-int.h: Likewise.
	* dse.c: Likewise.
	* dwarf2asm.c: Likewise.
	* dwarf2asm.h: Likewise.
	* dwarf2out.c: Likewise.
	* ebitmap.c: Likewise.
	* ebitmap.h: Likewise.
	* emit-rtl.c: Likewise.
	* et-forest.c: Likewise.
	* except.c: Likewise.
	* except.h: Likewise.
	* expmed.c: Likewise.
	* expr.c: Likewise.
	* expr.h: Likewise.
	* final.c: Likewise.
	* flags.h: Likewise.
	* fold-const.c: Likewise.
	* function.c: Likewise.
	* function.h: Likewise.
	* fwprop.c: Likewise.
	* gcc.c: Likewise.
	* gcov-dump.c: Likewise.
	* gcov-io.c: Likewise.
	* gcov-io.h: Likewise.
	* gcov.c: Likewise.
	* gcse.c: Likewise.
	* genattr.c: Likewise.
	* genattrtab.c: Likewise.
	* genautomata.c: Likewise.
	* genchecksum.c: Likewise.
	* genconfig.c: Likewise.
	* genflags.c: Likewise.
	* gengtype-parse.c: Likewise.
	* gengtype.c: Likewise.
	* gengtype.h: Likewise.
	* genmddeps.c: Likewise.
	* genmodes.c: Likewise.
	* genopinit.c: Likewise.
	* genpreds.c: Likewise.
	* gensupport.c: Likewise.
	* ggc-common.c: Likewise.
	* ggc-page.c: Likewise.
	* ggc-zone.c: Likewise.
	* ggc.h: Likewise.
	* gimple-iterator.c: Likewise.
	* gimple-low.c: Likewise.
	* gimple-pretty-print.c: Likewise.
	* gimple.c: Likewise.
	* gimple.def: Likewise.
	* gimple.h: Likewise.
	* gimplify.c: Likewise.
	* graphds.c: Likewise.
	* graphite-clast-to-gimple.c: Likewise.
	* gthr-nks.h: Likewise.
	* gthr-posix.c: Likewise.
	* gthr-posix.h: Likewise.
	* gthr-posix95.h: Likewise.
	* gthr-single.h: Likewise.
	* gthr-tpf.h: Likewise.
	* gthr-vxworks.h: Likewise.
	* gthr.h: Likewise.
	* haifa-sched.c: Likewise.
	* hard-reg-set.h: Likewise.
	* hooks.c: Likewise.
	* hooks.h: Likewise.
	* hosthooks.h: Likewise.
	* hwint.h: Likewise.
	* ifcvt.c: Likewise.
	* incpath.c: Likewise.
	* init-regs.c: Likewise.
	* integrate.c: Likewise.
	* ipa-cp.c: Likewise.
	* ipa-inline.c: Likewise.
	* ipa-prop.c: Likewise.
	* ipa-pure-const.c: Likewise.
	* ipa-reference.c: Likewise.
	* ipa-struct-reorg.c: Likewise.
	* ipa-struct-reorg.h: Likewise.
	* ipa-type-escape.c: Likewise.
	* ipa-type-escape.h: Likewise.
	* ipa-utils.c: Likewise.
	* ipa-utils.h: Likewise.
	* ipa.c: Likewise.
	* ira-build.c: Likewise.
	* ira-color.c: Likewise.
	* ira-conflicts.c: Likewise.
	* ira-costs.c: Likewise.
	* ira-emit.c: Likewise.
	* ira-int.h: Likewise.
	* ira-lives.c: Likewise.
	* ira.c: Likewise.
	* jump.c: Likewise.
	* lambda-code.c: Likewise.
	* lambda-mat.c: Likewise.
	* lambda-trans.c: Likewise.
	* lambda.h: Likewise.
	* langhooks.c: Likewise.
	* lcm.c: Likewise.
	* libgcov.c: Likewise.
	* lists.c: Likewise.
	* loop-doloop.c: Likewise.
	* loop-init.c: Likewise.
	* loop-invariant.c: Likewise.
	* loop-iv.c: Likewise.
	* loop-unroll.c: Likewise.
	* lower-subreg.c: Likewise.
	* lto-cgraph.c: Likewise.
	* lto-compress.c: Likewise.
	* lto-opts.c: Likewise.
	* lto-section-in.c: Likewise.
	* lto-section-out.c: Likewise.
	* lto-streamer-in.c: Likewise.
	* lto-streamer-out.c: Likewise.
	* lto-streamer.c: Likewise.
	* lto-streamer.h: Likewise.
	* lto-symtab.c: Likewise.
	* lto-wpa-fixup.c: Likewise.
	* matrix-reorg.c: Likewise.
	* mcf.c: Likewise.
	* mode-switching.c: Likewise.
	* modulo-sched.c: Likewise.
	* omega.c: Likewise.
	* omega.h: Likewise.
	* omp-low.c: Likewise.
	* optabs.c: Likewise.
	* optabs.h: Likewise.
	* opts-common.c: Likewise.
	* opts.c: Likewise.
	* params.def: Likewise.
	* params.h: Likewise.
	* passes.c: Likewise.
	* plugin.c: Likewise.
	* postreload-gcse.c: Likewise.
	* postreload.c: Likewise.
	* predict.c: Likewise.
	* predict.def: Likewise.
	* pretty-print.c: Likewise.
	* pretty-print.h: Likewise.
	* print-rtl.c: Likewise.
	* print-tree.c: Likewise.
	* profile.c: Likewise.
	* read-rtl.c: Likewise.
	* real.c: Likewise.
	* recog.c: Likewise.
	* reg-stack.c: Likewise.
	* regcprop.c: Likewise.
	* reginfo.c: Likewise.
	* regmove.c: Likewise.
	* regrename.c: Likewise.
	* regs.h: Likewise.
	* regstat.c: Likewise.
	* reload.c: Likewise.
	* reload1.c: Likewise.
	* resource.c: Likewise.
	* rtl.c: Likewise.
	* rtl.def: Likewise.
	* rtl.h: Likewise.
	* rtlanal.c: Likewise.
	* sbitmap.c: Likewise.
	* sched-deps.c: Likewise.
	* sched-ebb.c: Likewise.
	* sched-int.h: Likewise.
	* sched-rgn.c: Likewise.
	* sched-vis.c: Likewise.
	* sdbout.c: Likewise.
	* sel-sched-dump.c: Likewise.
	* sel-sched-dump.h: Likewise.
	* sel-sched-ir.c: Likewise.
	* sel-sched-ir.h: Likewise.
	* sel-sched.c: Likewise.
	* sel-sched.h: Likewise.
	* sese.c: Likewise.
	* sese.h: Likewise.
	* simplify-rtx.c: Likewise.
	* stack-ptr-mod.c: Likewise.
	* stmt.c: Likewise.
	* stor-layout.c: Likewise.
	* store-motion.c: Likewise.
	* stringpool.c: Likewise.
	* stub-objc.c: Likewise.
	* sync-builtins.def: Likewise.
	* target-def.h: Likewise.
	* target.h: Likewise.
	* targhooks.c: Likewise.
	* targhooks.h: Likewise.
	* timevar.c: Likewise.
	* tlink.c: Likewise.
	* toplev.c: Likewise.
	* toplev.h: Likewise.
	* tracer.c: Likewise.
	* tree-affine.c: Likewise.
	* tree-affine.h: Likewise.
	* tree-browser.def: 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-dump.c: Likewise.
	* tree-dump.h: Likewise.
	* tree-eh.c: Likewise.
	* tree-flow-inline.h: Likewise.
	* tree-flow.h: Likewise.
	* tree-if-conv.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-into-ssa.c: Likewise.
	* tree-loop-distribution.c: Likewise.
	* tree-loop-linear.c: Likewise.
	* tree-mudflap.c: Likewise.
	* tree-nested.c: Likewise.
	* tree-nomudflap.c: Likewise.
	* tree-nrv.c: Likewise.
	* tree-object-size.c: Likewise.
	* tree-optimize.c: Likewise.
	* tree-outof-ssa.c: Likewise.
	* tree-parloops.c: Likewise.
	* tree-pass.h: Likewise.
	* tree-phinodes.c: Likewise.
	* tree-predcom.c: Likewise.
	* tree-pretty-print.c: Likewise.
	* tree-profile.c: Likewise.
	* tree-scalar-evolution.c: Likewise.
	* tree-ssa-address.c: Likewise.
	* tree-ssa-alias.c: Likewise.
	* tree-ssa-ccp.c: Likewise.
	* tree-ssa-coalesce.c: Likewise.
	* tree-ssa-copy.c: Likewise.
	* tree-ssa-copyrename.c: Likewise.
	* tree-ssa-dce.c: Likewise.
	* tree-ssa-dom.c: Likewise.
	* tree-ssa-dse.c: Likewise.
	* tree-ssa-forwprop.c: Likewise.
	* tree-ssa-ifcombine.c: Likewise.
	* tree-ssa-live.c: Likewise.
	* tree-ssa-live.h: Likewise.
	* tree-ssa-loop-ch.c: 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-loop-unswitch.c: Likewise.
	* tree-ssa-loop.c: Likewise.
	* tree-ssa-math-opts.c: Likewise.
	* tree-ssa-operands.c: Likewise.
	* tree-ssa-operands.h: 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-sink.c: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-ssa-ter.c: Likewise.
	* tree-ssa-threadedge.c: Likewise.
	* tree-ssa-threadupdate.c: Likewise.
	* tree-ssa-uncprop.c: Likewise.
	* tree-ssa.c: Likewise.
	* tree-ssanames.c: Likewise.
	* tree-switch-conversion.c: Likewise.
	* tree-tailcall.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.def: Likewise.
	* tree.h: Likewise.
	* treestruct.def: Likewise.
	* unwind-compat.c: Likewise.
	* unwind-dw2-fde-glibc.c: Likewise.
	* unwind-dw2.c: Likewise.
	* value-prof.c: Likewise.
	* value-prof.h: Likewise.
	* var-tracking.c: Likewise.
	* varasm.c: Likewise.
	* varpool.c: Likewise.
	* vec.c: Likewise.
	* vec.h: Likewise.
	* vmsdbgout.c: Likewise.
	* web.c: Likewise.
	* xcoffout.c: Likewise.

From-SVN: r154645
2009-11-25 02:55:54 -08:00
David Binderman 2d8882865f cfgrtl.c (commit_one_edge_insertion): Remove set but not used local variable bb_note.
2009-11-24  David Binderman <dcb314@hotmail.com>

	* cfgrtl.c (commit_one_edge_insertion): Remove set but not used
	local variable bb_note.
        * dominance.c (get_dominated_by): Likewise local var n.
        (output_file_names): Likewise local var idx.
        (add_location_or_const_value_attribute): Likewise local var status.
        * dwarf2out.c (gen_variable_die): Likewise local var field.
        * emit-rtl.c (no_line_numbers): Remove.
	(init_emit_once): Remove line_numbers parameter.
        * rtl.h (init_emit_once): Adjust prototype.
        * toplev.c (backend_init): Adjust init_emit_once call.

From-SVN: r154496
2009-11-24 12:59:00 +00:00
Ben Elliston d4ebfa65c9 tm.texi (TARGET_ADDR_SPACE_POINTER_MODE): Document.
2009-10-26  Ben Elliston  <bje@au.ibm.com>
	    Michael Meissner  <meissner@linux.vnet.ibm.com>
	    Ulrich Weigand  <uweigand@de.ibm.com>

	* doc/tm.texi (TARGET_ADDR_SPACE_POINTER_MODE): Document.
	(TARGET_ADDR_SPACE_ADDRESS_MODE): Likewise.
	(TARGET_ADDR_SPACE_VALID_POINTER_MODE): Likewise.

	* target.h (struct target_def): Add pointer_mode, address_mode,
	and valid_pointer_mode to addr_space substructure.
	* target-def.h (TARGET_ADDR_SPACE_POINTER_MODE): Define.
	(TARGET_ADDR_SPACE_ADDRESS_MODE): Likewise.
	(TARGET_ADDR_SPACE_VALID_POINTER_MODE): Likewise.
	(TARGET_ADDR_SPACE_HOOKS): Add them.
	* targhooks.c (target_default_pointer_address_modes_p): New function.
	* target.h (target_default_pointer_address_modes_p): Add prototype.
	* targhooks.c (default_addr_space_pointer_mode): New function.
	(default_addr_space_address_mode): Likewise.
	(default_addr_space_valid_pointer_mode): Likewise.
	* targhooks.h (default_addr_space_pointer_mode): Add prototype.
	(default_addr_space_address_mode): Likewise.
	(default_addr_space_valid_pointer_mode): Likewise.
	* output.h (default_valid_pointer_mode): Move to ...
	* targhooks.h (default_valid_pointer_mode): ... here.
	* varasm.c (default_valid_pointer_mode): Move to ...
	* targhooks.c (default_valid_pointer_mode): ... here.

	* varasm.c (output_constant): Use targetm.addr_space.valid_pointer_mode
	instead of targetm.valid_pointer_mode.

	* fold-const.c (fit_double_type): Use int_or_pointer_precision.
	* tree.c (integer_pow2p): Likewise.
	(tree_log2): Likewise.
	(tree_floor_log2): Likewise.
	(signed_or_unsigned_type_for): Support pointer type of different size.
	(int_or_pointer_precision): New function.
	* tree.h (int_or_pointer_precision): Add prototype.
	* stor-layout.c (layout_type): Set TYPE_PRECISION for offset types.
	* varasm.c (initializer_constant_valid_p): Use TYPE_PRECISION of
	incoming pointer type instead of POINTER_SIZE.

	* tree.c (build_pointer_type): Use appropriate pointer mode
	instead of ptr_mode.
	(build_reference_type): Likewise.
	* expr.c (store_expr): Likewise.
	(expand_expr_addr_expr): Likewise.
	* tree-vect-data-refs.c (vect_create_data_ref_ptr): Likewise.
	* cfgexpand.c (expand_debug_expr): Likewise.
	
	* auto-inc-dec.c: Include "target.h".
	(try_merge): Use appropriate address mode instead of Pmode.
	(find_inc): Likewise.
	* combine.c (find_split_point): Likewise.
	* cselib.c (cselib_record_sets): Likewise.
	* dse.c (replace_inc_dec): Likewise.
	(canon_address): Likewise.
	* var-tracking.c (replace_expr_with_values): Likewise.
	(count_uses): Likewise.
	(add_uses): Likewise.
	(add_stores): Likewise.
	* emit-rtl.c: Include "target.h".
	(adjust_address_1): Use appropriate address mode instead of Pmode.
	(offset_address): Likewise.
	* explow.c (break_out_memory_refs): Likewise.
	(memory_address_addr_space): Likewise.
	(promote_mode): Likewise.
	* expr.c (move_by_pieces): Likewise.
	(emit_block_move_via_loop): Likewise.
	(store_by_pieces): Likewise.
	(store_by_pieces_1): Likewise.
	(expand_assignment): Likewise.
	(store_constructor): Likewise.
	(expand_expr_addr_expr): Likewise.
	(expand_expr_real_1): Likewise.
	* cfgexpand.c (expand_debug_expr): Likewise.
	* ifcvt.c (noce_try_cmove_arith): Likewise.
	* regcprop.c (kill_autoinc_value): Likewise.
	* regmove.c (try_auto_increment): Likewise.
	* reload.c (find_reloads): Likewise.
	(find_reloads_address): Likewise.
	(find_reloads_address_1): Likewise.
	* sched-deps.c: Include "target.h".
	(sched_analyze_1): Use appropriate address mode instead of Pmode.
	(sched_analyze_2): Likewise.
	* sel-sched-dump.c: Include "target.h".
	(debug_mem_addr_value): Use appropriate address mode instead of Pmode.
	* stor-layout.c (layout_type): Likewise.
	* tree-ssa-loop-ivopts.c (produce_memory_decl_rtl): Likewise.
	(multiplier_allowed_in_address_p): Likewise.
	(get_address_cost): Likewise.
	* varasm.c (make_decl_rtl): Likewise.
	
	* expr.c (expand_assignment): Always convert offsets to appropriate
	address mode.
	(store_expr): Likewise.
	(store_constructor): Likewise.
	(expand_expr_real_1): Likewise.

	* reload.h (form_sum): Add MODE argument.
	* reload.c (form_sum): Add MODE argument, use it instead of Pmode.
	Update recursive calls.
	(subst_indexed_address): Update calls to form_sum.
	
	* tree-flow.h (addr_for_mem_ref): Add ADDRSPACE argument.
	* tree-ssa-address.c: Include "target.h".
	(templates): Replace by ...
	(mem_addr_template_list): ... this new vector.
	(TEMPL_IDX): Handle address space numbers.
	(gen_addr_rtx): Add address mode argument, use it instead of Pmode.
	(addr_for_mem_ref): Add ADDRSPACE argument.  Use per-address-space
	instead of global cache.  Update call to gen_addr_rtx.
	(valid_mem_ref_p): Update call to addr_for_mem_ref.
	* expr.c (expand_expr_real_1): Update call to addr_for_mem_ref.
	
	* rtl.h (convert_memory_address_addr_space): Add prototype.
	(convert_memory_address): Define as macro.
	* explow.c (convert_memory_address): Rename to ...
	(convert_memory_address_addr_space): ... this.  Add ADDRSPACE argument.
	Use appropriate pointer and address modes instead of ptr_mode / Pmode.
	Update recursive calls.
	(memory_address_addr_space): Call convert_memory_address_addr_space.
	* expmed.c (make_tree): Likewise.
	* expr.c (expand_assignment): Likewise.
	(expand_expr_addr_expr_1): Likewise.  Also, add ADDRSPACE argument.
	(expand_expr_addr_expr): Likewise.  Also, update call.

	* alias.c (find_base_value): Guard pointer size optimizations.
	(find_base_term): Likewise.
	* rtlanal.c (nonzero_bits1): Likewise.
	(num_sign_bit_copies1): Likewise.
	* simplify-rtx.c (simplify_unary_operation_1): Likewise.

	* Makefile.in (tree-ssa-address.o): Add $(TARGET_H) dependency.
	(emit-rtl.o): Likewise.
	(auto-inc-dec.o): Likewise.
	(sched-deps.o): Likewise.

Co-Authored-By: Michael Meissner <meissner@linux.vnet.ibm.com>
Co-Authored-By: Ulrich Weigand <uweigand@de.ibm.com>

From-SVN: r153573
2009-10-26 21:57:10 +00:00
Ben Elliston 09e881c9e2 extend.texi (Named Address Spaces): New section.
2009-10-26  Ben Elliston  <bje@au.ibm.com>
	    Michael Meissner  <meissner@linux.vnet.ibm.com>
	    Ulrich Weigand  <uweigand@de.ibm.com>

	* doc/extend.texi (Named Address Spaces): New section.
	* coretypes.h (addr_space_t): New type.
	(ADDR_SPACE_GENERIC): New define.
	(ADDR_SPACE_GENERIC_P): New macro.

	* doc/tm.texi (Named Address Spaces): New section.
	(TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Document.
	(TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Document.
	(TARGET_ADDR_SPACE_SUBSET_P): Document.
	(TARGET_ADDR_SPACE_CONVERT): Document.
	* target.h (struct gcc_target): Add addr_space substructure.
	* target-def.h (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Define.
	(TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Likewise.
	(TARGET_ADDR_SPACE_SUBSET_P): Likewise.
	(TARGET_ADDR_SPACE_CONVERT): Likewise.
	(TARGET_ADDR_SPACE_HOOKS): Likewise.
	(TARGET_INITIALIZER): Initialize addr_space hooks.
	* targhooks.c (default_addr_space_legitimate_address_p): New function.
	(default_addr_space_legitimize_address): Likewise.
	(default_addr_space_subset_p): Likewise.
	(default_addr_space_convert): Likewise.
	* targhooks.h (default_addr_space_legitimate_address_p): Add prototype.
	(default_addr_space_legitimize_address): Likewise.
	(default_addr_space_subset_p): Likewise.
	(default_addr_space_convert): Likewise.

	* doc/rtl.texi (MEM_ADDR_SPACE): Document.
	* rtl.h (mem_attrs): Add ADDRSPACE memory attribute.
	(MEM_ADDR_SPACE): New macro.
	* emit-rtl.c (get_mem_attrs): Add ADDRSPACE argument and set
	address space memory attribute.
	(mem_attrs_htab_hash): Handle address space memory attribute.
	(mem_attrs_htab_eq): Likewise.
	(set_mem_attributes_minus_bitpos): Likewise.
	(set_mem_alias_set): Likewise.
	(set_mem_align): Likewise.
	(set_mem_expr): Likewise.
	(set_mem_offset): Likewise.
	(set_mem_size): Likewise.
	(adjust_address_1): Likewise.
	(offset_address): Likewise.
	(widen_memoy_address): Likewise.
	(get_spill_slot_decl): Likewise.
	(set_mem_attrs_for_spill): Likewise.
	(set_mem_addr_space): New function.
	* emit-rtl.h (set_mem_addr_space): Add prototype.
	* print-rtl.c (print_rtx): Print address space memory attribute.
	* expr.c (expand_assignment): Set address space memory attribute
	of generated MEM RTXes as appropriate.
	(expand_expr_real_1): Likewise.
	* cfgexpand.c (expand_debug_expr): Likewise.
	* tree-ssa-loop-ivopts.c (produce_memory_decl_rtl): Likewise.

	* tree.h (struct tree_base): Add address_space bitfield.  Reduce
	size of "spare" bitfield.
	(TYPE_ADDR_SPACE): New macro.
	(ENCODE_QUAL_ADDR_SPACE): Likewise.
	(DECODE_QUAL_ADDR_SPACE): Likewise.
	(CLEAR_QUAL_ADDR_SPACE): Likewise.
	(KEEP_QUAL_ADDR_SPACE): Likewise.
	(TYPE_QUALS): Encode type address space.
	(TYPE_QUALS_NO_ADDR_SPACE): New macro.
	* tree.c (set_type_quals): Set type address space.
	(build_array_type): Inherit array address space from element type.
	* print-tree.c (print_node_brief): Print type address space.
	(print_node): Likewise.
	* tree-pretty-print.c (dump_generic_node): Likewise.

	* explow.c (memory_address): Rename to ...
	(memory_address_addr_space): ... this.  Add ADDRSPACE argument.
	Use address-space aware variants of memory address routines.
	* recog.c (memory_address_p): Rename to ...
	(memory_address_addr_space_p): ... this.  Add ADDSPACE argument.
	Use address-space aware variants of memory address routines.
	(offsettable_address_p): Rename to ...
	(offsettable_address_addr_space_p): ... this.  Add ADDRSPACE argument.
	Use address-space aware variants of memory address routines.
	* reload.c (strict_memory_address_p): Rename to ...
	(strict_memory_address_addr_space_p): ... this.  Add ADDSPACE argument.
	Use address-space aware variants of memory address routines.
	(maybe_memory_address_p): Rename to ...
	(maybe_memory_address_addr_space_p): ... this.  Add ADDSPACE argument.
	Use address-space aware variants of memory address routines.
	* expr.h (memory_address_addr_space): Add prototype.
	(memory_address): Define as macro.
	* recog.h (memory_address_addr_space_p): Add prototype.
	(memory_address_p): Define as macro.
	(offsettable_address_addr_space_p): Add prototype.
	(offsettable_address_p): Define as macro.
	(strict_memory_address_addr_space_p): Add prototype.
	(strict_memory_address_p): Define as macro.

	* combine.c (find_split_point): Use address-space aware variants
	of memory address routines.
	* emit-rtl.c (operand_subword): Likewise.
	(change_address_1): Likewise.
	(adjust_address_1): Likewise.
	(offset_address): Likewise.
	* expr.c (emit_move_insn): Likewise.
	(expand_assignment): Likewise.
	(expand_expr_real_1): Likewise.
	* recog.c (verify_changes): Likewise.
	(general_operand): Likewise.
	(offsettable_memref_p): Likewise.
	(offsettable_nonstrict_memref_p): Likewise.
	(constrain_operands): Likewise.
	* reload.c (get_secondary_mem): Likewise.
	(find_reloads_toplev): Likewise.
	(find_reloads_address): Likewise.
	(find_reloads_subreg_address): Likewise.
	* reload1.c (reload): Likewise.
	* rtlhooks.c (gen_lowpart_if_possible): Likewise.
	* rtl.h (address_cost): Add ADDRSPACE argument.
	* rtlanal.c (address_cost): Add ADDRSPACE argument.  Use address-space
	aware variant of memory address routines.
	* loop-invariant.c (create_new_invariant): Update address_cost call.
	* tree-ssa-loop-ivopts.c (computation_cost): Likewise.
	* fwprop.c (should_replace_address): Add ADDRSPACE argument.
	Use address-space aware variant of memory address routines.
	(propagate_rtx_1): Update call to should_replace_address.
	* tree-flow.h (multiplier_allowed_in_address_p): Add ADDRSPACE
	argument.
	* tree-ssa-loop-ivopts.c (multiplier_allowed_in_address_p): Add
	ADDRSPACE argument.  Use per-address-space instead of global cache.
	Use address-space aware variant of memory address routines.
	(get_address_cost): Likewise.
	(get_computation_cost_at): Update calls.
	* tree-ssa-address.c (valid_mem_ref_p): Add ADDRSPACE argument.
	Use address-space aware variant of memory address routines.
	(create_mem_ref_raw): Update call to valid_mem_ref_p.
	(most_expensive_mult_to_index): Update call to
	multiplier_allowed_in_address_p.

	* dwarf2out.c (modified_type_die): Output DW_AT_address_class
	attribute to indicate named address spaces.

	* varasm.c (get_variable_section): DECLs in named address spaces
	cannot be "common".

	* reload.c (find_reloads_address): Do not use LEGITIMIZE_RELOAD_ADDRESS
	for addresses in a non-generic address space.

	* expr.c (emit_block_move_hints): Do not use libcalls for
	memory in non-generic address spaces.
	(clear_storage_hints): Likewise.
	(expand_assignment): Likewise.

	* fold-const.c (operand_equal_p): Expressions refering to different
	address spaces are not equivalent.

	* rtl.c (rtx_equal_p_cb): MEMs refering to different address
	spaces are not equivalent.
	(rtx_equal_p): Likewise.
	* cse.c (exp_equiv_p): Likewise.
	* jump.c (rtx_renumbered_equal_p): Likewise.
	* reload.c (operands_match_p): Likewise.

	* alias.c (nonoverlapping_memrefs_p): MEMs refering to different
	address spaces may alias.
	(true_dependence): Likewise.
	(canon_true_dependence): Likewise.
	(write_dependence_p): Likewise.

	* dse.c (canon_address): Handle named address spaces.
	* ifcvt.c (noce_try_cmove_arith): Likewise.

	* tree.def (ADDR_SPACE_CONVERT_EXPR): New tree code.
	* expr.c (expand_expr_real_2): Expand ADDR_SPACE_CONVERT_EXPR.
	* convert.c (convert_to_pointer): Generate ADDR_SPACE_CONVERT_EXPR
	to handle conversions between different address spaces.
	* fold-const.c (fold_convert_loc): Likewise.
	(fold_unary_loc): Handle ADDR_SPACE_CONVERT_EXPR.
	* tree-pretty-print.c (dump_generic_node): Likewise.
	* gimple-pretty-print.c (dump_unary_rhs): Likewise.
	* tree-cfg.c (verify_gimple_assign_unary): Likewise.
	* tree-inline.c (estimate_operator_cost): Likewise.
	* tree-ssa.c (useless_type_conversion_p): Conversions between pointers
	to different address spaces are not useless.

Co-Authored-By: Michael Meissner <meissner@linux.vnet.ibm.com>
Co-Authored-By: Ulrich Weigand <uweigand@de.ibm.com>

From-SVN: r153572
2009-10-26 21:55:59 +00:00
Richard Sandiford bd7960b1e4 rtl.h (shallow_copy_rtvec): Declare.
gcc/
	* rtl.h (shallow_copy_rtvec): Declare.
	* rtl.c (shallow_copy_rtvec): New function.
	* cselib.c (cselib_subst_to_values): Use it.  Only modify an
	rtx field if the subrtx has changed.

From-SVN: r153475
2009-10-22 22:30:12 +00:00
Richard Sandiford 3af4ba41cc rtl.h (simplify_replace_fn_rtx): Declare.
gcc/
	* rtl.h (simplify_replace_fn_rtx): Declare.
	(wrap_constant, unwrap_constant): Delete.
	* cfgexpand.c (unwrap_constant, wrap_constant): Delete.
	(expand_debug_expr): Don't call wrap_constant.
	* combine.c (rtx_subst_pair): Only define for AUTO_INC_DEC.
	(auto_adjust_pair): Fold into...
	(propagate_for_debug_subst): ...here.  Only define for AUTO_INC_DEC.
	Just return a new value.
	(propagate_for_debug): Use simplify_replace_fn_rtx for AUTO_INC_DEC,
	otherwise use simplify_replace_rtx.
	* cselib.c (wrap_constant): Reinstate old definition.
	(cselib_expand_value_rtx_1): Don't wrap constants.
	* gcse.c (try_replace_reg): Don't use copy_rtx in the call to
	simplify_replace_rtx.
	(bypass_block): Fix formatting in calls to simplify_replace_rtx.
	* reload1.c (reload): Skip all uses for an insn before adjusting it.
	Use simplify_replace_rtx.
	* simplify-rtx.c (simplify_replace_fn_rtx): New function,
	adapted from...
	(simplify_replace_rtx): ...here.  Turn into a wrapper for
	simplify_replace_fn_rtx.
	(simplify_unary_operation): Don't unwrap CONSTs.
	* var-tracking.c (check_wrap_constant): Delete.
	(vt_expand_loc_callback): Don't call it.
	(vt_expand_loc): Likewise.

From-SVN: r153037
2009-10-20 19:50:38 +00:00
Alexandre Oliva 15f01e4ad6 * rtl.h (RTL_LOCATION): Fix typo.
From-SVN: r152929
2009-10-17 06:29:47 +00:00
Vladimir Makarov 1833192f30 params.def (PARAM_IRA_LOOP_RESERVED_REGS): New.
2009-09-26  Vladimir Makarov  <vmakarov@redhat.com>

	* params.def (PARAM_IRA_LOOP_RESERVED_REGS): New.
	* params.h (IRA_LOOP_RESERVED_REGS): New
	* tree-pass.h (pass_subregs_of_mode_init,
	pass_subregs_of_mode_finish): Remove.
	* passes.c (pass_subregs_of_mode_init,
	pass_subregs_of_mode_finish): Remove.
	(pass_reginfo_init): Move before loop optimizations.
	* config/i386/i386.h (STACK_REG_COVER_CLASS): Define.
	* common.opt (fira-loop-pressure): New.
	* toplev.h (flag_ira_loop_pressure): New.
	* rtl.h (init_subregs_of_mode, finish_subregs_of_mode): New
	externals.
	* reginfo.c (init_subregs_of_mode, finish_subregs_of_mode):
	Make external and void type functions.
	(gate_subregs_of_mode_init, pass_subregs_of_mode_init,
	pass_subregs_of_mode_finish): Remove.
	* ira-costs.c (init_costs): Call init_subregs_of_mode.
	* regmove.c: Include ira.h.
	(regmove_optimize): Call ira_set_pseudo_classes after IRA based
	register pressure calculation in loops.
	* loop-invariant.c: Include REGS_H and ira.h.
	(struct loop_data): New members max_reg_pressure, regs_ref, and
	regs_live.
	(struct invariant): New member orig_regno.
	(curr_loop): New variable.
	(find_exits): Initialize regs_ref and regs_live.
	(create_new_invariant): Initialize orig_regno.
	(get_cover_class_and_nregs): New.
	(get_inv_cost): Make aregs_needed an array.  Use regs_needed as an
	array.  Add code for flag_ira_loop_pressure.
	(gain_for_invariant): Make new_regs an array.  Add code for
	flag_ira_loop_pressure.
	(best_gain_for_invariant): Ditto.
	(set_move_mark): New parameter gain.  Use it for debugging output.
	(find_invariants_to_move): Make regs_needed and new_regs an array.
	Add code for flag_ira_loop_pressure.
	(move_invariant_reg): Set up orig_regno.
	(move_invariants): Set up reg classes for pseudos for
	flag_ira_loop_pressure.
	(free_loop_data): Clear regs_ref and regs_live.
	(curr_regs_live, curr_reg_pressure, regs_set, n_regs_set,
	get_regno_cover_class, change_pressure, mark_regno_live,
	mark_regno_death, mark_reg_store, mark_reg_clobber,
	mark_reg_death, mark_ref_regs, calculate_loop_reg_pressure): New.
	(move_loop_invariants): Calculate pressure.  Initialize curr_loop.
	* ira.c (ira): Call ira_set_pseudo_classes after IRA based
	register pressure calculation in loops if new regs were added.
	Call finish_subregs_of_mode.
	* opts.c (decode_options): Set up flag_ira_loop_pressure.
	* Makefile.in (loop-invariant.o): Add ira.h.
	(regmove.o): Ditto.
	* doc/invoke.texi (-fira-loop-pressure, ira-loop-reserved-regs):
	Describe.
	* doc/tm.texi (STACK_REG_COVER_CLASS): Describe.

From-SVN: r152770
2009-10-14 16:24:11 +00:00
Jakub Jelinek e4fb38bd17 re PR target/41693 (RTL Check Failure in expand_debug_expr, at cfgexpand.c:2371)
PR target/41693
	* rtl.h (DEBUG_EXPR_TREE_DECL): Define.
	* sched-vis.c (print_value): Use it.
	* cselib.c (cselib_hash_rtx): Likewise.
	* print-rtl.c (print_rtx): Likewise.
	* cfgexpand.c (expand_debug_rtx): Likewise.
	* var-tracking.c (vt_expand_loc_callback): Likewise.

From-SVN: r152707
2009-10-13 15:56:07 +02:00
Andrew Pinski 2bd1d2c8d2 re PR tree-optimization/40992 (cunroll ignoring asm size)
2009-10-05  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR tree-opt/40992
        * final.c (asm_str_count): Split out from asm_insn_count.
        * rtl.h (asm_str_count): New prototype.
        * tree-inline (estimate_num_insns) <case GIMPLE_ASM>: Call
        asm_str_count.

From-SVN: r152458
2009-10-05 10:46:35 -07:00
Richard Henderson 531ca746f9 re PR target/41246 (should "sorry" when regparm=3 and nested functions are encountered)
PR target/41246
	* target.h (struct gcc_target): Add asm_out.trampoline_template,
	calls.static_chain, calls.trampoline_init,
	calls.trampoline_adjust_address.
	* target-def.h (TARGET_ASM_TRAMPOLINE_TEMPLATE): New.
	(TARGET_STATIC_CHAIN, TARGET_TRAMPOLINE_INIT): New.
	(TARGET_TRAMPOLINE_ADJUST_ADDRESS): New.
	* builtins.c (expand_builtin_setjmp_receiver): Use
	targetm.calls.static_chain; only clobber registers.
	(expand_builtin_init_trampoline): Use targetm.calls.trampoline_init;
	set up memory attributes properly for the trampoline block.
	(expand_builtin_adjust_trampoline): Use
	targetm.calls.trampoline_adjust_address.
	* calls.c (prepare_call_address): Add fndecl argument.  Use
	targetm.calls.static_chain.
	* df-scan.c (df_need_static_chain_reg): Remove.
	(df_get_entry_block_def_set): Use targetm.calls.static_chain;
	consolodate static chain handling.
	* doc/tm.texi: Document new hooks.
	* emit-rtl.c (static_chain_rtx, static_chain_incoming_rtx): Remove.
	(init_emit_regs): Don't initialize them.
	* expr.h (prepare_call_address): Update decl.
	* final.c (profile_function): Use targetm.calls.static_chain.
	* function.c (expand_function_start): Likewise.
	* rtl.h (static_chain_rtx, static_chain_incoming_rtx): Remove.
	* stmt.c (expand_nl_goto_receiver): Use targetm.calls.static_chain;
	only clobber registers.
	* targhooks.c (default_static_chain): New.
	(default_asm_trampoline_template, default_trampoline_init): New.
	(default_trampoline_adjust_address): New.
	* targhooks.h: Declare them.
	* varasm.c (assemble_trampoline_template): Use
	targetm.asm_out.trampoline_template.  Make the memory block const
	and set its size.

From-SVN: r151983
2009-09-22 08:11:37 -07:00
Richard Henderson 1c384bf142 builtins.c (expand_builtin_synchronize): Use gimple_build_asm_vec.
* builtins.c (expand_builtin_synchronize): Use gimple_build_asm_vec.
	* cfgbuild.c (make_edges): Handle asm goto.
	* cfglayout.c (fixup_reorder_chain): Likewise.
	* cfgrtl.c (patch_jump_insn): Likewise.
	* gimple-pretty-print.c (dump_gimple_asm): Likewise.
	* gimple.c (gimple_build_asm_1): Add and use nlabels parameter.
	(gimple_build_asm_vec): Add and use labels parameter.
	(gimple_build_asm): Remove.
	(walk_gimple_asm): Walk labels too.
	* gimple.def (GIMPLE_ASM): Update docs.
	* gimple.h: Update decls.
	(struct gimple_statement_asm): Change nc to use unsigned char;
	add nl member.
	(gimple_asm_nlabels): New.
	(gimple_asm_label_op, gimple_asm_set_label_op): New.
	* gimplify.c (gimplify_asm_expr): Copy labels from ASM_EXPR
	into gimple_build_asm_vec.
	* jump.c (mark_jump_label_asm): New.
	(mark_jump_label): Use it.
	(redirect_jump_1): Handle asm goto.
	(invert_jump_1): Soft fail if X is null.
	* recog.c (extract_asm_operands): New.
	(asm_noperands): Use it; handle asm labels.
	(decode_asm_operands): Use extract_asm_operands.
	(asm_operand_ok): Properly handle empty string.
	* reg-stack.c (get_asm_operands_in_out): Rename from
	get_asm_operand_n_inputs; use extract_asm_operands; return both
	inputs and outputs by reference; update all callers.
	* rtl.def (ASM_OPERANDS): Add label vector as operand 6.
	* rtl.h (ASM_OPERANDS_LABEL_VEC): New.
	(ASM_OPERANDS_LABEL_LENGTH, ASM_OPERANDS_LABEL): New.
	(ASM_OPERANDS_SOURCE_LOCATION): Renumber.
	(extract_asm_operands): Declare.
	* stmt.c (expand_asm_operands): Add and use labels parameter.
	(check_unique_operand_names): Likewise.
	(resolve_asm_operand_names, resolve_operand_name_1): Likewise.
	(expand_asm_stmt): Handle asm labels.
	* tree-cfg.c (make_gimple_asm_edges): New.
	(make_edges): Use it.
	(cleanup_dead_labels): Handle asm labels.
	(is_ctrl_altering_stmt): Likewise.
	(gimple_redirect_edge_and_branch): Likewise.
	* tree.def (ASM_EXPR): Add 5th operand.
	* tree.h (ASM_LABELS): New.
	(resolve_asm_operand_names): Update decl.

	* c-parser.c (c_parser_asm_statement): Parse asm goto.
	(c_parser_asm_goto_operands): New.
	* c-tree.h (build_asm_expr): Update decl.
	* c-typeck.c (build_asm_expr): Add and use labels parameter.
	* doc/extend.texi: Document asm goto.

gcc/ada/
	* gcc-interface/trans.c (Pragma_to_gnu): Use build5 for ASM_EXPR.

gcc/cp/
	* cp-tree.h (finish_asm_stmt): Update decl.
	* parser.c (cp_parser_asm_definition): Parse asm goto.
	(cp_parser_asm_label_list): New.
	* pt.c (tsubst_copy_asm_operands): Don't recurse on labels.
	(tsubst_expr): Handle asm labels.
	* semantics.c (finish_asm_stmt): Add and use labels parameter.

gcc/testsuite/
	* c-c++-common/asmgoto-1.c, c-c++-common/asmgoto-2.c,
	c-c++-common/asmgoto-3.c, gcc.c-torture/compile/asmgoto-1.c,
	gcc.dg/tree-ssa/asmgoto-1.c: New files.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>

From-SVN: r151701
2009-09-14 13:17:24 -07:00
Richard Henderson 1d65f45cfa Squash commit of EH in gimple
From-SVN: r151696
2009-09-14 12:18:58 -07:00
Michael Matz 4e18a7d41d re PR middle-end/41268 (bootstrap is broken after r151350 (expand from tuples))
PR middle-end/41268
	* cfgexpand.c (expand_gimple_stmt_1): Use an int for storing
	SUBREG_PROMOTED_UNSIGNED_P, instead of a bool.
	* rtl.h (struct rtx, SUBREG_PROMOTED_UNSIGNED_P): Update comments
	to reflect reality.

From-SVN: r151544
2009-09-09 00:43:36 +00:00
Andreas Krebbel 3fce100b40 rtl.h (PREFETCH_SCHEDULE_BARRIER_P): New macro.
2009-09-07  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

	* rtl.h (PREFETCH_SCHEDULE_BARRIER_P): New macro.	
	* sched-deps.c (sched_analyze_2): Make prefetches a hard barrier
	when volatile flag is set.
	* doc/rtl.texi (PREFETCH_SCHEDULE_BARRIER_P): Add documentation pieces.

From-SVN: r151475
2009-09-07 10:30:32 +00:00
David Daney 896aa4eae3 cfgbuild.c (find_bb_boundaries): Split blocks containing a barrier.
2009-09-02  David Daney  <ddaney@caviumnetworks.com>

	* cfgbuild.c (find_bb_boundaries): Split blocks containing a
	barrier.
	* emit-rtl.c (prev_nonnote_insn_bb): New function.
	* rtl.h (prev_nonnote_insn_bb): Declare it.

2009-09-02  David Daney  <ddaney@caviumnetworks.com>

	* gcc.c-torture/compile/builtin_unreachable-1.c: New testcase.

From-SVN: r151361
2009-09-03 05:01:40 +00:00
Vladimir Makarov ce18efcb54 invoke.texi (-fsched-pressure): Document it.
2009-09-02  Vladimir Makarov  <vmakarov@redhat.com>

	* doc/invoke.texi (-fsched-pressure): Document it.
	(-fsched-reg-pressure-heuristic): Remove it.
	
	* reload.c (ira.h): Include.
	(find_reloads): Add choosing reload on number of small spilled
	classes.
	
	* haifa-sched.c (ira.h): Include.
	(sched_pressure_p, sched_regno_cover_class, curr_reg_pressure,
	saved_reg_pressure, curr_reg_live, saved_reg_live,
	region_ref_regs): New variables.
	(sched_init_region_reg_pressure_info, mark_regno_birth_or_death,
	initiate_reg_pressure_info, setup_ref_regs,
	initiate_bb_reg_pressure_info, save_reg_pressure,
	restore_reg_pressure, dying_use_p, print_curr_reg_pressure): New
	functions.
	(setup_insn_reg_pressure_info): New function.
	(rank_for_schedule): Add pressure checking and insn issue time.
	Remove comparison of insn reg weights.
	(ready_sort): Set insn reg pressure info.
	(update_register_pressure, setup_insn_max_reg_pressure,
	update_reg_and_insn_max_reg_pressure,
	sched_setup_bb_reg_pressure_info): New functions.
	(schedule_insn): Add code for printing and updating reg pressure
	info.
	(find_set_reg_weight, find_insn_reg_weight): Remove.
	(ok_for_early_queue_removal): Do nothing if pressure_only_p.
	(debug_ready_list): Print reg pressure info.
	(schedule_block): Ditto.  Check insn issue time.
	(sched_init): Set up sched_pressure_p.  Allocate and set up some
	reg pressure related info.
	(sched_finish): Free some reg pressure related info.
	(fix_tick_ready): Make insn always ready if pressure_p.
	(init_h_i_d): Don't call find_insn_reg_weight.
	(haifa_finish_h_i_d): Free insn reg pressure info.
	
	* ira-int.h (ira_hard_regno_cover_class, ira_reg_class_nregs,
	ira_memory_move_cost, ira_class_hard_regs,
	ira_class_hard_regs_num, ira_no_alloc_regs,
	ira_available_class_regs, ira_reg_class_cover_size,
	ira_reg_class_cover, ira_class_translate): Move to ira.h.

	* ira-lives.c (single_reg_class): Check mode to find how many
	registers are necessary for operand.
	(ira_implicitly_set_insn_hard_regs): New.

	* common.opt (fsched-pressure): New options.
	(fsched-reg-pressure-heuristic): Remove.

	* ira.c (setup_eliminable_regset): Rename to
	ira_setup_eliminable_regset.  Make it external.
	(expand_reg_info): Pass cover class to setup_reg_classes.
	(ira): Call resize_reg_info instead of allocate_reg_info.

	* sched-deps.c: Include ira.h.
	(implicit_reg_pending_clobbers, implicit_reg_pending_uses): New.
	(create_insn_reg_use, create_insn_reg_set, setup_insn_reg_uses,
	reg_pressure_info, insn_use_p, mark_insn_pseudo_birth,
	mark_insn_hard_regno_birth, mark_insn_reg_birth,
	mark_pseudo_death, mark_hard_regno_death, mark_reg_death,
	mark_insn_reg_store, mark_insn_reg_clobber,
	setup_insn_reg_pressure_info): New.
	(sched_analyze_1): Update implicit_reg_pending_uses.
	(sched_analyze_insn): Find implicit sets, uses, clobbers of regs.
	Use them to create dependencies.  Set insn reg uses and pressure
	info.  Process reg_pending_uses in one place.
	(free_deps): Free implicit sets.
	(remove_from_deps): Remove implicit sets if necessary.  Check
	implicit sets when clearing reg_last_in_use.
	(init_deps_global): Clear implicit_reg_pending_clobbers and
	implicit_reg_pending_uses.
	
	* ira.h (ira_hard_regno_cover_class, ira_reg_class_nregs,
	ira_memory_move_cost, ira_class_hard_regs,
	ira_class_hard_regs_num, ira_no_alloc_regs,
	ira_available_class_regs, ira_reg_class_cover_size,
	ira_reg_class_cover, ira_class_translate): Move from ira-int.h.
	(ira_setup_eliminable_regset, ira_set_pseudo_classes,
	ira_implicitly_set_insn_hard_regs): New prototypes.
	
	* ira-costs.c (pseudo_classes_defined_p, allocno_p,
	cost_elements_num): New variables.
	(allocno_costs, total_costs): Rename to costs and
	total_allocno_costs.
	(COSTS_OF_ALLOCNO): Rename to COSTS.
	(allocno_pref): Rename to pref.
	(allocno_pref_buffer): Rename to pref_buffer.
	(common_classes): Rename to regno_cover_class.
	(COST_INDEX): New.
	(record_reg_classes): Set allocno attributes only if allocno_p.
	(record_address_regs): Ditto.  Use COST_INDEX instead of
	ALLOCNO_NUM.
	(scan_one_insn): Use COST_INDEX and COSTS instead of ALLOCNO_NUM
	and COSTS_OF_ALLOCNO.
	(print_costs): Rename to print_allocno_costs.
	(print_pseudo_costs): New.
	(process_bb_node_for_costs): Split into 2 functions with new
	function process_bb_for_costs.  Pass BB to process_bb_for_costs.
	(find_allocno_class_costs): Rename to find_costs_and_classes.  Add
	new parameter dump_file.  Use cost_elements_num instead of
	ira_allocnos_num.  Make one iteration if preferred classes were
	already calculated for scheduler.  Make 2 versions of code
	depending on allocno_p.
	(setup_allocno_cover_class_and_costs): Check allocno_p.  Use
	regno_cover_class and COSTS instead of common_classes and
	COSTS_OF_ALLOCNO.
	(init_costs, finish_costs): New.
	(ira_costs): Set up allocno_p and cost_elements_num.  Call
	init_costs and finish_costs.
	(ira_set_pseudo_classes): New.

	* rtl.h (allocate_reg_info): Remove.
	(resize_reg_info): Change return type.
	(reg_cover_class): New.
	(setup_reg_classes): Add new parameter.
	
	* sched-int.h (struct deps_reg): New member implicit_sets.
	(sched_pressure_p, sched_regno_cover_class): New external
	definitions.
	(INCREASE_BITS): New macro.
	(struct reg_pressure_data, struct reg_use_data): New.
	(struct _haifa_insn_data): Remove reg_weight.  Add members
	reg_pressure, reg_use_list, reg_set_list, and
	reg_pressure_excess_cost_change.
	(struct deps): New member implicit_sets.
	(pressure_p): New variable.
	(COVER_CLASS_BITS, INCREASE_BITS): New macros.
	(struct reg_pressure_data, struct reg_use_data): New.
	(INSN_REG_WEIGHT): Remove.
	(INSN_REG_PRESSURE, INSN_MAX_REG_PRESSURE, INSN_REG_USE_LIST,
	INSN_REG_SET_LIST, INSN_REG_PRESSURE_EXCESS_COST_CHANGE): New
	macros.
	(sched_init_region_reg_pressure_info,
	sched_setup_bb_reg_pressure_info): New prototypes.
	
        * reginfo.c (struct reg_pref): New member coverclass.
	(reg_cover_class): New function.
	(reginfo_init, pass_reginfo_init): Move after free_reg_info.
	(reg_info_size): New variable.
	(allocate_reg_info): Make static.  Setup reg_info_size.
	(resize_reg_info): Use reg_info_size.  Return flag of resizing.
	(setup_reg_classes): Add a new parameter.  Setup cover class too.

	* Makefile.in (reload.o, haifa-sched.o, sched-deps.o): Add ira.h to the
	dependencies.

	* sched-rgn.c (deps_join): Set up implicit_sets.
	(schedule_region): Set up region and basic blocks pressure
	relative info.
	
	* passes.c (init_optimization_passes): Move
	pass_subregs_of_mode_init before pass_sched.

From-SVN: r151348
2009-09-02 18:54:25 +00:00
Alexandre Oliva b5b8b0ac64 invoke.texi (-fvar-tracking-assignments): New.
gcc/ChangeLog:
* doc/invoke.texi (-fvar-tracking-assignments): New.
(-fvar-tracking-assignments-toggle): New.
(-fdump-final-insns=file): Mark filename as optional.
(--param min-nondebug-insn-uid): New.
(-gdwarf-@{version}): Mention version 4.
* opts.c (common_handle_option): Accept it.
* tree-vrp.c (find_assert_locations_1): Skip debug stmts.
* regrename.c (regrename_optimize): Drop last.  Don't count debug
insns as uses.  Don't reject change because of debug insn.
(do_replace): Reject DEBUG_INSN as chain starter.  Take base_regno
from the chain starter, and check for inexact matches in
DEBUG_INSNS.
(scan_rtx_reg): Accept inexact matches in DEBUG_INSNs.
(build_def_use): Simplify and fix the marking of DEBUG_INSNs.
* sched-ebb.c (schedule_ebbs): Skip boundary debug insns.
* fwprop.c (forward_propagate_and_simplify): ...into debug insns.
* doc/gimple.texi (is_gimple_debug): New.
(gimple_debug_bind_p): New.
(is_gimple_call, gimple_assign_cast_p): End sentence with period.
* doc/install.texi (bootstrap-debug): More details.
(bootstrap-debug-big, bootstrap-debug-lean): Document.
(bootstrap-debug-lib): More details.
(bootstrap-debug-ckovw): Update.
(bootstrap-time): New.
* tree-into-ssa.c (mark_def_sites): Skip debug stmts.
(insert_phi_nodes_for): Insert debug stmts.
(rewrite_stmt): Take iterator.  Insert debug stmts.
(rewrite_enter_block): Adjust.
(maybe_replace_use_in_debug_stmt): New.
(rewrite_update_stmt): Use it.
(mark_use_interesting): Return early for debug stmts.
* tree-ssa-loop-im.c (rewrite_bittest): Propagate DEFs into debug
stmts before replacing stmt.
(move_computations_stmt): Likewise.
* ira-conflicts.c (add_copies): Skip debug insns.
* regstat.c (regstat_init_n_sets_and_refs): Discount debug insns.
(regstat_bb_compute_ri): Skip debug insns.
* tree-ssa-threadupdate.c (redirection_block_p): Skip debug stmts.
* tree-ssa-loop-manip.c (find_uses_to_rename_stmt,
check_loop_closed_ssa_stmt): Skip debug stmts.
* tree-tailcall.c (find_tail_calls): Likewise.
* tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise.
* tree.h (MAY_HAVE_DEBUG_STMTS): New.
(build_var_debug_value_stat): Declare.
(build_var_debug_value): Define.
(target_for_debug_bind): Declare.
* reload.c (find_equiv_reg): Skip debug insns.
* rtlanal.c (reg_used_between_p): Skip debug insns.
(side_effects_p): Likewise.
(canonicalize_condition): Likewise.
* ddg.c (create_ddg_dep_from_intra_loop_link): Check that non-debug
insns never depend on debug insns.
(create_ddg_dep_no_link): Likewise.
(add_cross_iteration_register_deps): Use ANTI_DEP for debug insns.
Don't add inter-loop dependencies for debug insns.
(build_intra_loop_deps): Likewise.
(create_ddg): Count debug insns.
* ddg.h (struct ddg::num_debug): New.
(num_backargs): Pair up with previous int field.
* diagnostic.c (diagnostic_report_diagnostic): Skip notes on
-fcompare-debug-second.
* final.c (get_attr_length_1): Skip debug insns.
(rest_of_clean-state): Don't dump CFA_RESTORE_STATE.
* gcc.c (invoke_as): Call compare-debug-dump-opt.
(driver_self_specs): Map -fdump-final-insns to
-fdump-final-insns=..
(get_local_tick): New.
(compare_debug_dump_opt_spec_function): Test for . argument and
compute output name.  Compute temp output spec without flag name.
Compute -frandom-seed.
(OPT): Undef after use.
* cfgloopanal.c (num_loop_insns): Skip debug insns.
(average_num_loop_insns): Likewise.
* params.h (MIN_NONDEBUG_INSN_UID): New.
* gimple.def (GIMPLE_DEBUG): New.
* ipa-reference.c (scan_stmt_for_static_refs): Skip debug stmts.
* auto-inc-dec.c (merge_in_block): Skip debug insns.
(merge_in_block): Fix whitespace.
* toplev.c (flag_var_tracking): Update comment.
(flag_var_tracking_assignments): New.
(flag_var_tracking_assignments_toggle): New.
(process_options): Don't open final insns dump file if we're not
going to write to it.  Compute defaults for var_tracking.
* df-scan.c (df_insn_rescan_debug_internal): New.
(df_uses_record): Handle debug insns.
* haifa-sched.c (ready): Initialize n_debug.
(contributes_to_priority): Skip debug insns.
(dep_list_size): New.
(priority): Use it.
(rank_for_schedule): Likewise.  Schedule debug insns as soon as
they're ready.  Disregard previous debug insns to make decisions.
(queue_insn): Never queue debug insns.
(ready_add, ready_remove_first, ready_remove): Count debug insns.
(schedule_insn): Don't reject debug insns because of issue rate.
(get_ebb_head_tail, no_real_insns_p): Skip boundary debug insns.
(queue_to_ready): Skip and discount debug insns.
(choose_ready): Let debug insns through.
(schedule_block): Check boundary debug insns.  Discount debug
insns, schedule them early.  Adjust whitespace.
(set_priorities): Check for boundary debug insns.
(add_jump_dependencies): Use dep_list_size.
(prev_non_location_insn): New.
(check_cfg): Use it.
* tree-ssa-loop-ivopts.c (find-interesting_users): Skip debug
stmts.
(remove_unused_ivs): Reset debug stmts.
* modulo-sched.c (const_iteration_count): Skip debug insns.
(res_MII): Discount debug insns.
(loop_single_full_bb_p): Skip debug insns.
(sms_schedule): Likewise.
(sms_schedule_by_order): Likewise.
(ps_has_conflicts): Likewise.
* caller-save.c (refmarker_fn): New.
(save_call_clobbered_regs): Replace regs with saved mem in
debug insns.
(mark_referenced_regs): Take pointer, mark and arg.  Adjust.
Call refmarker_fn mark for hardregnos.
(mark_reg_as_referenced): New.
(replace_reg_with_saved_mem): New.
* ipa-pure-const.c (check_stmt): Skip debug stmts.
* cse.c (cse_insn): Canonicalize debug insns.  Skip them when
searching back.
(cse_extended_basic_block): Skip debug insns.
(count_reg_usage): Likewise.
(is_dead_reg): New, split out of...
(set_live_p): ... here.
(insn_live_p): Use it for debug insns.
* tree-stdarg.c (check_all_va_list_escapes): Skip debug stmts.
(execute_optimize_stdarg): Likewise.
* tree-ssa-dom.c (propagate_rhs_into_lhs): Likewise.
* tree-ssa-propagate.c (substitute_and_fold): Don't regard
changes in debug stmts as changes.
* sel-sched.c (moving_insn_creates_bookkeeping_block_p): New.
(moveup_expr): Don't move across debug insns.  Don't move
debug insn if it would create a bookkeeping block.
(moveup_expr_cached): Don't use cache for debug insns that
are heads of blocks.
(compute_av_set_inside_bb): Skip debug insns.
(sel_rank_for_schedule): Schedule debug insns first.  Remove
dead code.
(block_valid_for_bookkeeping_p); Support lax searches.
(create_block_for_bookkeeping): Adjust block numbers when
encountering debug-only blocks.
(find_place_for_bookkeeping): Deal with debug-only blocks.
(generate_bookkeeping_insn): Accept no place to insert.
(remove_temp_moveop_nops): New argument full_tidying.
(prepare_place_to_insert): Deal with debug insns.
(advance_state_on_fence): Debug insns don't start cycles.
(update_boundaries): Take fence as argument.  Deal with
debug insns.
(schedule_expr_on_boundary): No full_tidying on debug insns.
(fill_insns): Deal with debug insns.
(track_scheduled_insns_and_blocks): Don't count debug insns.
(need_nop_to_preserve_insn_bb): New, split out of...
(remove_insn_from_stream): ... this.
(fur_orig_expr_not_found): Skip debug insns.
* rtl.def (VALUE): Move up.
(DEBUG_INSN): New.
* tree-ssa-sink.c (all_immediate_uses_same_place): Skip debug
stmts.
(nearest_common_dominator_of_uses): Take debug_stmts argument.
Set it if debug stmts are found.
(statement_sink_location): Skip debug stmts.  Propagate
moving defs into debug stmts.
* ifcvt.c (first_active_insn): Skip debug insns.
(last_active_insns): Likewise.
(cond_exec_process_insns): Likewise.
(noce_process_if_block): Likewise.
(check_cond_move_block): Likewise.
(cond_move_convert_if_block): Likewise.
(block_jumps_and_fallthru_p): Likewise.
(dead_or_predicable): Likewise.
* dwarf2out.c (debug_str_hash_forced): New.
(find_AT_string): Add comment.
(gen_label_for_indirect_string): New.
(get_debug_string_label): New.
(AT_string_form): Use it.
(mem_loc_descriptor): Handle non-TLS symbols.  Handle MINUS , DIV,
MOD, AND, IOR, XOR, NOT, ABS, NEG, and CONST_STRING.  Accept but
discard COMPARE, IF_THEN_ELSE, ROTATE, ROTATERT, TRUNCATE and
several operations that cannot be represented with DWARF opcodes.
(loc_descriptor): Ignore SIGN_EXTEND and ZERO_EXTEND.  Require
dwarf_version 4 for DW_OP_implicit_value and DW_OP_stack_value.
(dwarf2out_var_location): Take during-call mark into account.
(output_indirect_string): Update comment.  Output if there are
label and references.
(prune_indirect_string): New.
(prune_unused_types): Call it if debug_str_hash_forced.
More in dwarf2out.c, from Jakub Jelinek <jakub@redhat.com>:
(dw_long_long_const): Remove.
(struct dw_val_struct): Change val_long_long type to rtx.
(print_die, attr_checksum, same_dw_val_p, loc_descriptor): Adjust for
val_long_long change to CONST_DOUBLE rtx from a long hi/lo pair.
(output_die): Likewise.  Use HOST_BITS_PER_WIDE_INT size of each
component instead of HOST_BITS_PER_LONG.
(output_loc_operands): Likewise.   For const8* assert
HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64.
(output_loc_operands_raw): For const8* assert HOST_BITS_PER_WIDE_INT
rather than HOST_BITS_PER_LONG is >= 64.
(add_AT_long_long): Remove val_hi and val_lo arguments, add
val_const_double.
(size_of_die): Use HOST_BITS_PER_WIDE_INT size multiplier instead of
HOST_BITS_PER_LONG for dw_val_class_long_long.
(add_const_value_attribute): Adjust add_AT_long_long caller.  Don't
handle TLS SYMBOL_REFs.  If CONST wraps a constant, tail recurse.
(dwarf_stack_op_name): Handle DW_OP_implicit_value and
DW_OP_stack_value.
(size_of_loc_descr, output_loc_operands, output_loc_operands_raw):
Handle DW_OP_implicit_value.
(extract_int): Move prototype earlier.
(mem_loc_descriptor): For SUBREG punt if inner
mode size is wider than DWARF2_ADDR_SIZE.  Handle SIGN_EXTEND
and ZERO_EXTEND by DW_OP_shl and DW_OP_shr{a,}.  Handle
EQ, NE, GT, GE, LT, LE, GTU, GEU, LTU, LEU, SMIN, SMAX, UMIN,
UMAX, SIGN_EXTRACT, ZERO_EXTRACT.
(loc_descriptor): Compare mode size with DWARF2_ADDR_SIZE
instead of Pmode size.
(loc_descriptor): Add MODE argument.  Handle CONST_INT, CONST_DOUBLE,
CONST_VECTOR, CONST, LABEL_REF and SYMBOL_REF if mode != VOIDmode,
attempt to handle other expressions.  Don't handle TLS SYMBOL_REFs.
(concat_loc_descriptor, concatn_loc_descriptor,
loc_descriptor_from_tree_1): Adjust loc_descriptor callers.
(add_location_or_const_value_attribute): Likewise.  For single
location loc_lists attempt to use add_const_value_attribute
for constant decls.  Add DW_AT_const_value even if
NOTE_VAR_LOCATION is VAR_LOCATION with CONSTANT_P or CONST_STRING
in its expression.
* cfgbuild.c (inside_basic_block_p): Handle debug insns.
(control_flow_insn_p): Likewise.
* tree-parloops.c (eliminate_local_variables_stmt): Handle debug
stmt.
(separate_decls_in_region_debug_bind): New.
(separate_decls_in_region): Process debug bind stmts afterwards.
* recog.c (verify_changes): Handle debug insns.
(extract_insn): Likewise.
(peephole2_optimize): Skip debug insns.
* dse.c (scan_insn): Skip debug insns.
* sel-sched-ir.c (return_nop_to_pool): Take full_tidying argument.
Pass it on.
(setup_id_for_insn): Handle debug insns.
(maybe_tidy_empty_bb): Adjust whitespace.
(tidy_control_flow): Skip debug insns.
(sel_remove_insn): Adjust for debug insns.
(sel_estimate_number_of_insns): Skip debug insns.
(create_insn_rtx_from_pattern): Handle debug insns.
(create_copy_of_insn_rtx): Likewise.
* sel-sched-.h (sel_bb_end): Declare.
(sel_bb_empty_or_nop_p): New.
(get_all_loop_exits): Use it.
(_eligible_successor_edge_p): Likewise.
(return_nop_to_pool): Adjust.
* tree-eh.c (tre_empty_eh_handler_p): Skip debug stmts.
* ira-lives.c (process_bb_node_lives): Skip debug insns.
* gimple-pretty-print.c (dump_gimple_debug): New.
(dump_gimple_stmt): Use it.
(dump_bb_header): Skip gimple debug stmts.
* regmove.c (optimize_reg_copy_1): Discount debug insns.
(fixup_match_2): Likewise.
(regmove_backward_pass): Likewise.  Simplify combined
replacement.  Handle debug insns.
* function.c (instantiate_virtual_regs): Handle debug insns.
* function.h (struct emit_status): Add x_cur_debug_insn_uid.
* print-rtl.h: Include cselib.h.
(print_rtx): Print VALUEs.  Split out and recurse for
VAR_LOCATIONs.
* df.h (df_inns_rescan_debug_internal): Declare.
* gcse.c (alloc_hash_table): Estimate n_insns.
(cprop_insn): Don't regard debug insns as changes.
(bypass_conditional_jumps): Skip debug insns.
(one_pre_gcse_pass): Adjust.
(one_code_hoisting_pass): Likewise.
(compute_ld_motion_mems): Skip debug insns.
(one_cprop_pass): Adjust.
* tree-if-conv.c (tree_if_convert_stmt): Reset debug stmts.
(if_convertible_stmt_p): Handle debug stmts.
* init-regs.c (initialize_uninitialized_regs): Skip debug insns.
* tree-vect-loop.c (vect_is_simple_reduction): Skip debug stmts.
* ira-build.c (create_bb_allocnos): Skip debug insns.
* tree-flow-inline.h (has_zero_uses): Discount debug stmts.
(has_single_use): Likewise.
(single_imm_use): Likewise.
(num_imm_uses): Likewise.
* tree-ssa-phiopt.c (empty_block_p): Skip debug stmts.
* tree-ssa-coalesce.c (build_ssa_conflict_graph): Skip debug stmts.
(create_outofssa_var_map): Likewise.
* lower-subreg.c (adjust_decomposed_uses): New.
(resolve_debug): New.
(decompose_multiword_subregs): Use it.
* tree-dfa.c (find_referenced_vars): Skip debug stmts.
* emit-rtl.c: Include params.h.
(cur_debug_insn_uid): Define.
(set_new_first_and_last_insn): Set cur_debug_insn_uid too.
(copy_rtx_if_shared_1): Handle debug insns.
(reset_used_flags): Likewise.
(set_used_flags): LIkewise.
(get_max_insn_count): New.
(next_nondebug_insn): New.
(prev_nondebug_insn): New.
(make_debug_insn_raw): New.
(emit_insn_before_noloc): Handle debug insns.
(emit_jump_insn_before_noloc): Likewise.
(emit_call_insn_before_noloc): Likewise.
(emit_debug_insn_before_noloc): New.
(emit_insn_after_noloc): Handle debug insns.
(emit_jump_insn_after_noloc): Likewise.
(emit_call_insn_after_noloc): Likewise.
(emit_debug_insn_after_noloc): Likewise.
(emit_insn_after): Take loc from earlier non-debug insn.
(emit_jump_insn_after): Likewise.
(emit_call_insn_after): Likewise.
(emit_debug_insn_after_setloc): New.
(emit_debug_insn_after): New.
(emit_insn_before): Take loc from later non-debug insn.
(emit_jump_insn_before): Likewise.
(emit_call_insn_before): Likewise.
(emit_debug_insn_before_setloc): New.
(emit_debug_insn_before): New.
(emit_insn): Handle debug insns.
(emit_debug_insn): New.
(emit_jump_insn): Handle debug insns.
(emit_call_insn): Likewise.
(emit): Likewise.
(init_emit): Take min-nondebug-insn-uid into account.
Initialize cur_debug_insn_uid.
(emit_copy_of_insn_after): Handle debug insns.
* cfgexpand.c (gimple_assign_rhs_to_tree): Do not overwrite
location of single rhs in place.
(maybe_dump_rtl_for_gimple_stmt): Dump lineno.
(floor_sdiv_adjust): New.
(cell_sdiv_adjust): New.
(cell_udiv_adjust): New.
(round_sdiv_adjust): New.
(round_udiv_adjust): New.
(wrap_constant): Moved from cselib.
(unwrap_constant): New.
(expand_debug_expr): New.
(expand_debug_locations): New.
(expand_gimple_basic_block): Drop hiding redeclaration.  Expand
debug bind stmts.
(gimple_expand_cfg): Expand debug locations.
* cselib.c: Include tree-pass.h.
(struct expand_value_data): New.
(cselib_record_sets_hook): New.
(PRESERVED_VALUE_P, LONG_TERM_PRESERVED_VALUE_P): New.
(cselib_clear_table): Move, and implemnet in terms of...
(cselib_reset_table_with_next_value): ... this.
(cselib_get_next_unknown_value): New.
(discard_useless_locs): Don't discard preserved values.
(cselib_preserve_value): New.
(cselib_preserved_value_p): New.
(cselib_preserve_definitely): New.
(cselib_clear_preserve): New.
(cselib_preserve_only_values): New.
(new_cselib_val): Take rtx argument.  Dump it in details.
(cselib_lookup_mem): Adjust.
(expand_loc): Take regs_active in struct.  Adjust.  Silence
dumps unless details are requested.
(cselib_expand_value_rtx_cb): New.
(cselib_expand_value_rtx): Rename and reimplment in terms of...
(cselib_expand_value_rtx_1): ... this.  Adjust.  Silence dumps
without details.  Copy more subregs.  Try to resolve values
using a callback.  Wrap constants.
(cselib_subst_to_values): Adjust.
(cselib_log_lookup): New.
(cselib_lookup): Call it.
(cselib_invalidate_regno): Don't count preserved values as
useless.
(cselib_invalidate_mem): Likewise.
(cselib_record_set): Likewise.
(struct set): Renamed to cselib_set, moved to cselib.h.
(cselib_record_sets): Adjust.  Call hook.
(cselib_process_insn): Reset table when it would be cleared.
(dump_cselib_val): New.
(dump_cselib_table): New.
* tree-cfgcleanup.c (tree_forwarded_block_p): Skip debug stmts.
(remove_forwarder_block): Support moving debug stmts.
* cselib.h (cselib_record_sets_hook): Declare.
(cselib_expand_callback): New type.
(cselib_expand_value_rtx_cb): Declare.
(cselib_reset_table_with_next_value): Declare.
(cselib_get_next_unknown_value): Declare.
(cselib_preserve_value): Declare.
(cselib_preserved_value_p): Declare.
(cselib_preserve_only_values): Declare.
(dump_cselib_table): Declare.
* cfgcleanup.c (flow_find_cross_jump): Skip debug insns.
(try_crossjump_to_edge): Likewise.
(delete_unreachable_blocks): Remove dominant GIMPLE blocks after
dominated blocks when debug stmts are present.
* simplify-rtx.c (delegitimize_mem_from_attrs): New.
* tree-ssa-live.c (remove_unused_locals): Skip debug stmts.
(set_var_live_on_entry): Likewise.
* loop-invariant.c (find_invariants_bb): Skip debug insns.
* cfglayout.c (curr_location, last_location): Make static.
(set_curr_insn_source_location): Don't avoid bouncing.
(get_curr_insn_source_location): New.
(get_curr_insn_block): New.
(duplicate_insn_chain): Handle debug insns.
* tree-ssa-forwprop.c (forward_propagate_addr_expr): Propagate
into debug stmts.
* common.opt (fcompare-debug): Move to sort order.
(fdump-unnumbered-links): Likewise.
(fvar-tracking-assignments): New.
(fvar-tracking-assignments-toggle): New.
* tree-ssa-dce.c (mark_stmt_necessary): Don't mark blocks
because of debug stmts.
(mark_stmt_if_obviously_necessary): Mark debug stmts.
(eliminate_unnecessary_stmts): Walk dominated blocks before
dominators.
* tree-ssa-ter.c (find_replaceable_in_bb): Skip debug stmts.
* ira.c (memref_used_between_p): Skip debug insns.
(update_equiv_regs): Likewise.
* sched-deps.c (sd_lists_size): Accept empty list.
(sd_init_insn): Mark debug insns.
(sd_finish_insn): Unmark them.
(sd_add_dep): Reject non-debug deps on debug insns.
(fixup_sched_groups): Give debug insns group treatment.
Skip debug insns.
(sched_analyze_reg): Don't mark debug insns for sched before call.
(sched_analyze_2): Handle debug insns.
(sched_analyze_insn): Compute next non-debug insn.  Handle debug
insns.
(deps_analyze_insn): Handle debug insns.
(deps_start_bb): Skip debug insns.
(init_deps): Initialize last_debug_insn.
* tree-ssa.c (target_for_debug_bind): New.
(find_released_ssa_name): New.
(propagate_var_def_into_debug_stmts): New.
(propagate_defs_into_debug_stmts): New.
(verify_ssa): Skip debug bind stmts without values.
(warn_uninialized_vars): Skip debug stmts.
* target-def.h (TARGET_DELEGITIMIZE_ADDRESS): Set default.
* rtl.c (rtx_equal_p_cb): Handle VALUEs.
(rtx_equal_p): Likewise.
* ira-costs.c (scan_one_insn): Skip debug insns.
(process_bb_node_for_hard_reg_moves): Likewise.
* rtl.h (DEBUG_INSN_P): New.
(NONDEBUG_INSN_P): New.
(MAY_HAVE_DEBUG_INSNS): New.
(INSN_P): Accept debug insns.
(RTX_FRAME_RELATED_P): Likewise.
(INSN_DELETED_P): Likewise
(PAT_VAR_LOCATION_DECL): New.
(PAT_VAR_LOCATION_LOC): New.
(PAT_VAR_OCATION_STATUS): New.
(NOTE_VAR_LOCATION_DECL): Reimplement.
(NOTE_VAR_LOCATION_LOC): Likewise.
(NOTE_VAR_LOCATION_STATUS): Likewise.
(INSN_VAR_LOCATION): New.
(INSN_VAR_LOCATION_DECL): New.
(INSN_VAR_LOCATION_LOC): New.
(INSN_VAR_LOCATION_STATUS): New.
(gen_rtx_UNKNOWN_VAR_LOC): New.
(VAR_LOC_UNKNOWN_P): New.
(NOTE_DURING_CALL_P): New.
(SCHED_GROUP_P): Accept debug insns.
(emit_debug_insn_before): Declare.
(emit_debug_insn_before_noloc): Declare.
(emit_debug_insn_beore_setloc): Declare.
(emit_debug_insn_after): Declare.
(emit_debug_insn_after_noloc): Declare.
(emit_debug_insn_after_setloc): Declare.
(emit_debug_insn): Declare.
(make_debug_insn_raw): Declare.
(prev_nondebug_insn): Declare.
(next_nondebug_insn): Declare.
(delegitimize_mem_from_attrs): Declare.
(get_max_insn_count): Declare.
(wrap_constant): Declare.
(unwrap_constant): Declare.
(get_curr_insn_source_location): Declare.
(get_curr_insn_block): Declare.
* tree-inline.c (insert_debug_decl_map): New.
(processing_debug_stmt): New.
(remap_decl): Don't create new mappings in debug stmts.
(remap_gimple_op_r): Don't add references in debug stmts.
(copy_tree_body_r): Likewise.
(remap_gimple_stmt): Handle debug bind stmts.
(copy_bb): Skip debug stmts.
(copy_edges_for_bb): Likewise.
(copy_debug_stmt): New.
(copy_debug_stmts): New.
(copy_body): Copy debug stmts at the end.
(insert_init_debug_bind): New.
(insert_init_stmt): Take id.  Skip and emit debug stmts.
(setup_one_parameter): Remap variable earlier, register debug
mapping.
(estimate_num_insns): Skip debug stmts.
(expand_call_inline): Preserve debug_map.
(optimize_inline_calls): Check for no debug_stmts left-overs.
(unsave_expr_now): Preserve debug_map.
(copy_gimple_seq_and_replace_locals): Likewise.
(tree_function_versioning): Check for no debug_stmts left-overs.
Init and destroy debug_map as needed.  Split edges unconditionally.
(build_duplicate_type): Init and destroy debug_map as needed.
* tree-inline.h: Include gimple.h instead of pointer-set.h.
(struct copy_body_data): Add debug_stmts and debug_map.
* sched-int.h (struct ready_list): Add n_debug.
(struct deps): Add last_debug_insn.
(DEBUG_INSN_SCHED_P): New.
(BOUNDARY_DEBUG_INSN_P): New.
(SCHEDULE_DEBUG_INSN_P): New.
(sd_iterator_cond): Accept empty list.
* combine.c (create_log_links): Skip debug insns.
(combine_instructions): Likewise.
(cleanup_auto_inc_dec): New.  From Jakub Jelinek: Make sure the
return value is always unshared.
(struct rtx_subst_pair): New.
(auto_adjust_pair): New.
(propagate_for_debug_subst): New.
(propagate_for_debug): New.
(try_combine): Skip debug insns.  Propagate removed defs into
debug insns.
(next_nonnote_nondebug_insn): New.
(distribute_notes): Use it.  Skip debug insns.
(distribute_links): Skip debug insns.
* tree-outof-ssa.c (set_location_for_edge): Likewise.
* resource.c (mark_target_live_regs): Likewise.
* var-tracking.c: Include cselib.h and target.h.
(enum micro_operation_type): Add MO_VAL_USE, MO_VAL_LOC, and
MO_VAL_SET.
(micro_operation_type_name): New.
(enum emit_note_where): Add EMIT_NOTE_AFTER_CALL_INSN.
(struct micro_operation_def): Update comments.
(decl_or_value): New type.  Use instead of decls.
(struct emit_note_data_def): Add vars.
(struct attrs_def): Use decl_or_value.
(struct variable_tracking_info_def): Add permp, flooded.
(struct location_chain_def): Update comment.
(struct variable_part_def): Use decl_or_value.
(struct variable_def): Make var_part a variable length array.
(valvar_pool): New.
(scratch_regs): New.
(cselib_hook_called): New.
(dv_is_decl_p): New.
(dv_is_value_p): New.
(dv_as_decl): New.
(dv_as_value): New.
(dv_as_opaque): New.
(dv_onepart_p): New.
(dv_pool): New.
(IS_DECL_CODE): New.
(check_value_is_not_decl): New.
(dv_from_decl): New.
(dv_from_value): New.
(dv_htab_hash): New.
(variable_htab_hash): Use it.
(variable_htab_eq): Support values.
(variable_htab_free): Free from the right pool.
(attrs_list_member, attrs_list_insert): Use decl_or_value.
(attrs_list_union): Adjust.
(attrs_list_mpdv_union): New.
(tie_break_pointers): New.
(canon_value_cmp): New.
(unshare_variable): Return possibly-modified slot.
(vars_copy_1): Adjust.
(var_reg_decl_set): Adjust.  Split out of...
(var_reg_set): ... this.
(get_init_value): Adjust.
(var_reg_delete_and_set): Adjust.
(var_reg_delete): Adjust.
(var_regno_delete): Adjust.
(var_mem_decl_set): Split out of...
(var_mem_set): ... this.
(var_mem_delete_and_set): Adjust.
(var_mem_delete): Adjust.
(val_store): New.
(val_reset): New.
(val_resolve): New.
(variable_union): Adjust.  Speed up merge of 1-part vars.
(variable_canonicalize): Use unshared slot.
(VALUED_RECURSED_INTO): New.
(find_loc_in_1pdv): New.
(struct dfset_merge): New.
(insert_into_intersection): New.
(intersect_loc_chains): New.
(loc_cmp): New.
(canonicalize_loc_order_check): New.
(canonicalize_values_mark): New.
(canonicalize_values_star): New.
(variable_merge_over_cur): New.
(variable_merge_over_src): New.
(dataflow_set_merge): New.
(dataflow_set_equiv_regs): New.
(remove_duplicate_values): New.
(struct dfset_post_merge): New.
(variable_post_merge_new_vals): New.
(variable_post_merge_perm_vals): New.
(dataflow_post_merge_adjust): New.
(find_mem_expr_in_1pdv): New.
(dataflow_set_preserve_mem_locs): New.
(dataflow_set_remove_mem_locs): New.
(dataflow_set_clear_at_call): New.
(onepart_variable_different_p): New.
(variable_different_p): Use it.
(dataflow_set_different_1): Adjust.  Make detailed dump
more verbose.
(track_expr_p): Add need_rtl parameter.  Don't generate rtl
if not needed.
(track_loc_p): Pass it true.
(struct count_use_info): New.
(find_use_val): New.
(replace_expr_with_values): New.
(log_op_type): New.
(use_type): New, partially split out of...
(count_uses): ... this.  Count new micro-ops.
(count_uses_1): Adjust.
(count_stores): Adjust.
(count_with_sets): New.
(VAL_NEEDS_RESOLUTION): New.
(VAL_HOLDS_TRACK_EXPR): New.
(VAL_EXPR_IS_COPIED): New.
(VAL_EXPR_IS_CLOBBERED): New.
(add_uses): Adjust.  Generate new micro-ops.
(add_uses_1): Adjust.
(add_stores): Generate new micro-ops.
(add_with_sets): New.
(find_src_status): Adjust.
(find_src_set_src): Adjust.
(compute_bb_dataflow): Use dataflow_set_clear_at_call.
Handle new micro-ops.  Canonicalize value equivalances.
(vt_find_locations): Compute total size of hash tables for
dumping.  Perform merge for var-tracking-assignments.  Don't
disregard single-block loops.
(dump_attrs_list): Handle decl_or_value.
(dump_variable): Take variable.  Deal with decl_or_value.
(dump_variable_slot): New.
(dump_vars): Use it.
(dump_dataflow_sets): Adjust.
(set_slot_part): New, extended to support one-part variables
after splitting out of...
(set_variable_part): ... this.
(clobber_slot_part): New, split out of...
(clobber_variable_part): ... this.
(delete_slot_part): New, split out of...
(delete_variable_part): .... this.
(check_wrap_constant): New.
(vt_expand_loc_callback): New.
(vt_expand_loc): New.
(emit_note_insn_var_location): Adjust.  Handle values.  Handle
EMIT_NOTE_AFTER_CALL_INSN.
(emit_notes_for_differences_1): Adjust.  Handle values.
(emit_notes_for_differences_2): Likewise.
(emit_notes_for_differences): Adjust.
(emit_notes_in_bb): Take pointer to set.  Emit AFTER_CALL_INSN
notes.  Adjust.  Handle new micro-ops.
(vt_add_function_parameters): Adjust.  Create and bind values.
(vt_initialize): Adjust.  Initialize scratch_regs and
valvar_pool, flooded and perm..  Initialize and use cselib.  Log
operations.  Move some code to count_with_sets and add_with_sets.
(delete_debug_insns): New.
(vt_debug_insns_local): New.
(vt_finalize): Release permp, valvar_pool, scratch_regs.  Finish
cselib.
(var_tracking_main): If var-tracking-assignments is enabled
but var-tracking isn't, delete debug insns and leave.  Likewise
if we exceed limits or fail the stack adjustments tests, and
after all var-tracking processing.
More in var-tracking, from Jakub Jelinek <jakub@redhat.com>:
(dataflow_set): Add traversed_vars.
(value_chain, const_value_chain): New typedefs.
(value_chain_pool, value_chains): New variables.
(value_chain_htab_hash, value_chain_htab_eq, add_value_chain,
add_value_chains, add_cselib_value_chains, remove_value_chain,
remove_value_chains, remove_cselib_value_chains): New functions.
(shared_hash_find_slot_unshare_1, shared_hash_find_slot_1,
shared_hash_find_slot_noinsert_1, shared_hash_find_1): New
static inlines.
(shared_hash_find_slot_unshare, shared_hash_find_slot,
shared_hash_find_slot_noinsert, shared_hash_find): Update.
(dst_can_be_shared): New variable.
(unshare_variable): Unshare set->vars if shared, use shared_hash_*.
Clear dst_can_be_shared.  If set->traversed_vars is non-NULL and
different from set->vars, look up slot again instead of using the
passed in slot.
(dataflow_set_init): Initialize traversed_vars.
(variable_union): Use shared_hash_*.  Use initially NO_INSERT
lookup if set->vars is shared.  Don't keep slot cleared before
calling unshare_variable.  Unshare set->vars if needed.  Adjust
unshare_variable callers.  Clear dst_can_be_shared if needed.
Even ->refcount == 1 vars must be unshared if set->vars is shared
and var needs to be modified.
(dataflow_set_union): Set traversed_vars during canonicalization.
(VALUE_CHANGED, DECL_CHANGED): Define.
(set_dv_changed, dv_changed_p): New static inlines.
(track_expr_p): Clear DECL_CHANGED.
(dump_dataflow_sets): Set it.
(variable_was_changed): Call set_dv_changed.
(emit_note_insn_var_location): Likewise.
(changed_variables_stack): New variable.
(check_changed_vars_1, check_changed_vars_2): New functions.
(emit_notes_for_changes): Do nothing if changed_variables is
empty.  Traverse changed_variables with check_changed_vars_1,
call check_changed_vars_2 on each changed_variables_stack entry.
(emit_notes_in_bb): Add SET argument.  Just clear it at the
beginning, use it instead of local &set, don't destroy it at the
end.
(vt_emit_notes): Call dataflow_set_clear early on all
VTI(bb)->out sets, never use them, instead use emit_notes_in_bb
computed set, dataflow_set_clear also VTI(bb)->in when we are
done with the basic block.  Initialize changed_variables_stack,
free it afterwards.  If ENABLE_CHECKING verify that after noting
differences to an empty set value_chains hash table is empty.
(vt_initialize): Initialize value_chains and value_chain_pool.
(vt_finalize): Delete value_chains htab, free value_chain_pool.
(variable_tracking_main): Call dump_dataflow_sets before calling
vt_emit_notes, not after it.
* tree-flow.h (propagate_defs_into_debug_stmts): Declare.
(propagate_var_def_into_debug_stmts): Declare.
* df-problems.c (df_lr_bb_local_compute): Skip debug insns.
(df_set_note): Reject debug insns.
(df_whole_mw_reg_dead_p): Take added_notes_p argument.  Don't
add notes to debug insns.
(df_note_bb_compute): Adjust.  Likewise.
(df_simulate_uses): Skip debug insns.
(df_simulate_initialize_backwards): Likewise.
* reg-stack.c (subst_stack_regs_in_debug_insn): New.
(subst_stack_regs_pat): Reject debug insns.
(convert_regs_1): Handle debug insns.
* Makefile.in (TREE_INLINE_H): Take pointer-set.h from GIMPLE_H.
(print-rtl.o): Depend on cselib.h.
(cselib.o): Depend on TREE_PASS_H.
(var-tracking.o): Depend on cselib.h and TARGET_H.
* sched-rgn.c (rgn_estimate_number_of_insns): Discount
debug insns.
(init_ready_list): Skip boundary debug insns.
(add_branch_dependences): Skip debug insns.
(free_block_dependencies): Check for blocks with only debug
insns.
(compute_priorities): Likewise.
* gimple.c (gss_for_code): Handle GIMPLE_DEBUG.
(gimple_build_with_ops_stat): Take subcode as unsigned.  Adjust
all callers.
(gimple_build_debug_bind_stat): New.
(empty_body_p): Skip debug stmts.
(gimple_has_side_effects): Likewise.
(gimple_rhs_has_side_effects): Likewise.
* gimple.h (enum gimple_debug_subcode, GIMPLE_DEBUG_BIND): New.
(gimple_build_debug_bind_stat): Declare.
(gimple_build_debug_bind): Define.
(is_gimple_debug): New.
(gimple_debug_bind_p): New.
(gimple_debug_bind_get_var): New.
(gimple_debug_bind_get_value): New.
(gimple_debug_bind_get_value_ptr): New.
(gimple_debug_bind_set_var): New.
(gimple_debug_bind_set_value): New.
(GIMPLE_DEBUG_BIND_NOVALUE): New internal temporary macro.
(gimple_debug_bind_reset_value): New.
(gimple_debug_bind_has_value_p): New.
(gsi_next_nondebug): New.
(gsi_prev_nondebug): New.
(gsi_start_nondebug_bb): New.
(gsi_last_nondebug_bb): New.
* sched-vis.c (print_pattern): Handle VAR_LOCATION.
(print_insn): Handle DEBUG_INSN.
* tree-cfg.c (remove_bb): Walk stmts backwards.  Let loc
of first insn prevail.
(first_stmt): Skip debug stmts.
(first_non_label_stmt): Likewise.
(last_stmt): Likewise.
(has_zero_uses_1): New.
(single_imm_use_1): New.
(verify_gimple_debug): New.
(verify_types_in_gimple_stmt): Handle debug stmts.
(verify_stmt): Likewise.
(debug_loop_num): Skip debug stmts.
(remove_edge_and_dominated_blocks): Remove dominators last.
* tree-ssa-reasssoc.c (rewrite_expr_tree): Propagate into
debug stmts.
(linearize_expr): Likewise.
* config/i386/i386.c (ix86_delegitimize_address): Call
default implementation.
* config/ia64/ia64.c (ia64_safe_itanium_class): Handle debug
insns.
(group_barrier_needed): Skip debug insns.
(emit_insn_group_barriers): Likewise.
(emit_all_insn_group_barriers): Likewise.
(ia64_variable_issue): Handle debug insns.
(ia64_dfa_new_cycle): Likewise.
(final_emit_insn_group_barriers): Skip debug insns.
(ia64_dwarf2out_def_steady_cfa): Take frame argument.  Don't
def cfa without frame.
(process_set): Likewise.
(process_for_unwind_directive): Pass frame on.
* config/rs6000/rs6000.c (TARGET_DELEGITIMIZE_ADDRESS): Define.
(rs6000_delegitimize_address): New.
(rs6000_debug_adjust_cost): Handle debug insns.
(is_microcoded_insn): Likewise.
(is_cracked_insn): Likewise.
(is_nonpipeline_insn): Likewise.
(insn_must_be_first_in_group): Likewise.
(insn_must_be_last_in_group): Likewise.
(force_new_group): Likewise.
* cfgrtl.c (rtl_split_block): Emit INSN_DELETED note if block
contains only debug insns.
(rtl_merge_blocks): Skip debug insns.
(purge_dead_edges): Likewise.
(rtl_block_ends_with_call_p): Skip debug insns.
* dce.c (deletable_insn_p): Handle VAR_LOCATION.
(mark_reg_dependencies): Skip debug insns.
* params.def (PARAM_MIN_NONDEBUG_INSN_UID): New.
* tree-ssanames.c (release_ssa_name): Propagate def into
debug stmts.
* tree-ssa-threadedge.c
(record_temporary_equivalences_from_stmts): Skip debug stmts.
* regcprop.c (replace_oldest_value_addr): Skip debug insns.
(replace_oldest_value_mem): Use ALL_REGS for debug insns.
(copyprop_hardreg_forward_1): Handle debug insns.
* reload1.c (reload): Skip debug insns.  Replace unassigned
pseudos in debug insns with their equivalences.
(eliminate_regs_in_insn): Skip debug insns.
(emit_input_reload_insns): Skip debug insns at first, adjust
them later.
* tree-ssa-operands.c (add_virtual_operand): Reject debug stmts.
(get_indirect_ref_operands): Pass opf_no_vops on.
(get_expr_operands): Likewise.  Skip debug stmts.
(parse_ssa_operands): Scan debug insns with opf_no_vops.
gcc/testsuite/ChangeLog:
* gcc.dg/guality/guality.c: New.
* gcc.dg/guality/guality.h: New.
* gcc.dg/guality/guality.exp: New.
* gcc.dg/guality/example.c: New.
* lib/gcc-dg.exp (cleanup-dump): Remove .gk files.
(cleanup-saved-temps): Likewise, .gkd files too.
gcc/cp/ChangeLog:
* cp-tree.h (TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS): New.
* cp-lang.c (cxx_dwarf_name): Pass it.
* error.c (count_non_default_template_args): Take flags as
argument.  Adjust all callers.  Skip counting of default
arguments if the new flag is given.
ChangeLog:
* Makefile.tpl (BUILD_CONFIG): Default to bootstrap-debug.
* Makefile.in: Rebuilt.
contrib/ChangeLog:
* compare-debug: Look for .gkd files and compare them.
config/ChangeLog:
* bootstrap-debug.mk: Add comments.
* bootstrap-debug-big.mk: New.
* bootstrap-debug-lean.mk: New.
* bootstrap-debug-ckovw.mk: Add comments.
* bootstrap-debug-lib.mk: Drop CFLAGS for stages.  Use -g0
for TFLAGS in stage1.  Drop -fvar-tracking-assignments-toggle.

From-SVN: r151312
2009-09-02 02:42:21 +00:00
Adam Nemet 842e098c5f combine.c (try_widen_shift_mode): Factor out code to check if an integer constant is a low-order bitmask from here ...
* combine.c (try_widen_shift_mode): Factor out code to check if an
        integer constant is a low-order bitmask from here ...
	* rtlanal.c (low_bitmask_len): ... to here.
	* rtl.h (low_bitmask_len): Declare.

From-SVN: r150656
2009-08-11 17:31:09 +00:00
David Daney 1e211590c3 re PR rtl-optimization/40445 (g++ void f() { __builtin_unreachable(); })
2009-07-25  David Daney  <ddaney@caviumnetworks.com>

	PR rtl-optimization/40445
	* emit-rtl.c (next_nonnote_insn_bb): New function.
	* rtl.h (next_nonnote_insn_bb): Declare new function.
	* cfgcleanup.c (try_optimize_cfg): Don't remove an empty block
	with no successors that is the successor of the ENTRY_BLOCK.
	Continue from the top after removing an empty fallthrough block.
	* cfgrtl.c (get_last_bb_insn): Call next_nonnote_insn_bb instead
	of next_nonnote_insn.

2009-07-25  David Daney  <ddaney@caviumnetworks.com>

	PR rtl-optimization/40445
	* g++.dg/other/builtin-unreachable-1.C: New testcase.

From-SVN: r150090
2009-07-25 20:25:18 +00:00
Ian Lance Taylor 50ae5feab3 * rtl.h (SUBREG_PROMOTED_UNSIGNED_P): Add cast to int.
From-SVN: r148712
2009-06-19 15:53:07 +00:00
Aldy Hernandez c2255bc488 java-gimplify.c (java_gimplify_block): New argument to build_empty_stmt.
gcc/java/
	* java-gimplify.c (java_gimplify_block): New argument to
	build_empty_stmt.
	* expr.c (force_evaluation_order): Same.
	* typeck.c: Add location to build_decl or PUSH_FIELD calls.
	* class.c: Same.
	* decl.c: Same.
	* jcf-parse.c: Same.
	* constants.c: Same.
	* resource.c: Same.
	* except.c: Same.
	* builtins.c: Same.
	* expr.c: Same.
	* java-tree.h (PUSH_FIELD): Add location field.
gcc/objc/
	* objc-act.c (finish_var_decl): Pass location to finish_decl.
	(objc_get_parm_info): Same.
	(get_super_receiver): Same.
	* objc-act.c (objc_build_component_ref): Pass location to
	build_compound_ref.
	(build_module_initializer_routine): Pass location to
	c_end_compound_stmt.
	(objc_generate_static_init_call): Pass location to build_stmt.
	(build_typed_selector_reference): New location argument.
	(build_selector_reference): Same.
	(objc_substitute_decl): Pass location to build_array_ref.
	(next_sjlj_build_try_catch_finally): Pass location to build_stmt.
	(objc_begin_catch_clause): Same.
	(objc_finish_try_stmt): Same.
	(objc_finish_catch_clause): Pass location to c_end_compound_stmt.
	(objc_build_throw_stmt): New argument.
	(generate_shared_structures): Pass location to build_c_cast.
	(objc_build_message_expr): Use local location.
	(objc_finish_message_expr): Use input_location.
	(build_objc_method_call): New argument.
	(objc_build_selector_expr): Same.
	(get_super_receiver): Pass location to build_c_cast,
	build_modify_expr, build_compound_expr.
	* objc-act.c: Add location to all calls to start_struct, build_decl,
	finish_struct.
gcc/
	* tree-pretty-print.c (dump_generic_node): Dump column numbers.
	* gimple-pretty-print.c (dump_gimple_stmt): Same.
	* gimplify.c (gimplify_modify_expr): Set location for GIMPLE_ASSIGNs
	created.
	* c-parser.c (c_parser_binary_expression): Use current column while
	building binary operations.
	* common.opt (fshow-column): Enable by default.
	* tree-vrp.c (check_array_ref): Use warning_at.
	(check_array_bounds): Use location from call back if expr has no
	location.
	* tree.h: Add location argument to maybe_fold_*.
	* tree-ssa-ccp.c (ccp_fold): Pass location to maybe_fold_*.
	(maybe_fold_offset_to_array_ref): Add location argument and use it.
	(maybe_fold_offset_to_component_ref): Same.
	(maybe_fold_offset_to_reference): Same.
	(maybe_fold_offset_to_address): Same.
	(maybe_fold_stmt_indirect): Same.
	(maybe_fold_stmt_addition): Same.
	(fold_stmt_r): Pass location to maybe_fold_*.
	(fold_gimple_assign): Same.
	* c-tree.h: Add location argument to finish_decl,
	default_function_array_conversion, store_init_value.
	* c-decl.c (define_label): Use error_at.
	(c_make_fname_decl): Pass location to finish_decl.
	(finish_decl): New location argument.
	(build_compound_literal): Pass location to store_init_value.
	(grokdeclarator): Pass location to finish_decl.
	(grokfield): Same.
	* c-typeck.c (array_to_pointer_conversion): New location argument.
	(function_to_pointer_conversion): Same.
	(default_function_array_conversion): Same.
	(parser_build_unary_op): Pass location to overflow_warning.
	(parser_build_binary_op): Same.  Use warning_at.
	(build_unary_op): Pass location to array_to_pointer_conversion.
	(build_c_cast): Pass location to digest_init.
	(build_modify_expr): New location argument.
	(convert_for_assignment): Same.
	(store_init_value): Same.
	(digest_init): Same.
	(output_init_element): Pass location to digest_init and
	array_to_pointer_conversion.
	(c_finish_return): Pass location to convert_for_assignment.
	* gimplify.c (gimplify_conversion): Pass location to
	maybe_fold_offset_to_address.
	* tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Pass location
	to maybe_fold_stmt_addition.
	* c-omp.c (c_finish_omp_atomic): Pass new location to
	build_modify_expr.
	(c_finish_omp_for): Same.
	* c-common.c (overflow_warning): New argument.
	* c-common.h: New argument to build_modify_expr, overflow_warning.
	* c-parser.c (c_parser_declaration_or_fndef): Pass location to
	finish_decl.
	(c_parser_initializer): Pass location to
	default_function_array_conversion.
	(c_parser_initelt): Same.
	(c_parser_initval): Same.
	(c_parser_asm_operands): Same.
	(c_parser_expr_no_commas): Same.  Pass location to build_modify_expr.
	(c_parser_conditional_expression): Same.
	(c_parser_binary_expression): Add location info to stack.  Use it.
	(c_parser_unary_expression): Pass location to
	default_function_array_conversion, parser_build_unary_op,
	build_indirect_ref, c_parser_postfix_expression_after_primary.
	(c_parser_postfix_expression_after_primary): New location argument.
	Use it.
	(c_parser_expression_conv): Pass location to
	default_function_array_conversion.
	(c_parser_expr_list): Same.
	(c_parser_omp_atomic): Same.
	(c_parser_omp_for_loop): Same.
	* c-tree.h: (struct c_declarator): Add comment to id_loc.
	(build_array_declarator): New argument.
	* c-decl.c (build_array_declarator): Add location argument.
	(grokdeclarator): Set id_loc for cdk_array.
	* c-parser.c (c_parser_direct_declarator_inner): Pass location to
	build_array_declarator.
	* tree.c (build_omp_clause): Add location argument.
	* tree.h (OMP_CLAUSE_HAS_LOCATION): New macro.
	(OMP_CLAUSE_LOCATION): New macro.
	(struct tree_omp_clause): Add location field.
	(build_omp_clause): Add argument.
	* testsuite/gcc.dg/gomp/for-1.c: Fix column.
	* cp/pt.c (tsubst_omp_for_iterator): Pass location to
	build_omp_clause.
	* cp/parser.c (cp_parser_omp_var_list_no_open): Same.
	(cp_parser_omp_clause_collapse): Same.
	(cp_parser_omp_clause_default): Same.
	(cp_parser_omp_clause_if): Same.
	(cp_parser_omp_clause_nowait): Same.
	(cp_parser_omp_clause_num_threads): Same.
	(cp_parser_omp_clause_ordered): Same.
	(cp_parser_omp_clause_schedule): Same.
	(cp_parser_omp_clause_untied): Same.
	(cp_parser_omp_for_loop): Same.
	(cp_parser_omp_parallel): Pass location to c_split_parallel_clauses.
	* c-tree.h (c_start_case): Add location argument.
	(c_process_expr_stmt): Same.
	(c_finish_goto_*): Same.
	* tree-parloops.c (initialize_reductions): Pass location to
	build_omp_clause.
	(create_parallel_loop): Same.
	* fortran/trans-openmp.c (gfc_trans_omp_variable_list): Same.
	(gfc_trans_omp_reduction_list): Same.
	(gfc_trans_omp_clauses): Same.
	(gfc_trans_omp_do): Same.
	* c-typeck.c (c_finish_goto_label): Same.
	(c_finish_goto_ptr): New location argument.
	(c_start_case): Same.
	(emit_side_effect_warnings): Same.
	(c_process_expr_stmt): Same.
	(c_finish_stmt_expr): Same.
	(c_finish_omp_clauses): Use error_at instead of error.
	* gimplify.c (gimplify_adjust_omp_clauses_1): Pass location to
	build_omp_clause.
	* c-omp.c (c_split_parallel_clauses): New location argument.
	* tree-nested.c (convert_nonlocal_reference_stmt): Pass location
	to build_omp_clause.
	(convert_local_reference_stmt): Same.
	(convert_gimple_call): Same.
	* c-common.h (c_split_parallel_clauses): New argument.
	* c-parser.c (c_parser_statement_after_labels): Pass location to
	c_finish_goto_label.
	(c_parser_switch_statement): Pass location to c_start_case.
	(c_parser_for_statement): Pass location to c_finish_expr_stmt,
	and c_process_expr_stmt.
	(c_parser_omp_variable_list): Add location argument.
	(c_parser_omp_clause_collapse): Pass location to
	build_omp_clause.
	(c_parser_omp_clause_default): Same.
	(c_parser_omp_clause_if): Same.
	(c_parser_omp_clause_num_threads): Same.
	(-c_parser_omp_clause_ordered): Same.
	(c_parser_omp_clause_reduction): Pass location to
	c_parser_omp_variable_list.
	(c_parser_omp_clause_schedule): Pass location to build_omp_clause.
	(c_parser_omp_clause_untied): Same.
	(c_parser_omp_for_loop): Pass location to c_process_expr_stmt.
	(c_parser_omp_parallel): Pass location to
	c_split_parallel_clauses.
	* c-tree.h (check_for_loop_decls, undeclared_variable,
	build_component_ref, build_array_ref, build_external_ref,
	c_expr_sizeof_expr, c_expr_sizeof_type, parser_build_unary_op,
	build_conditional_expr, build_compound_expr, c_cast_expr,
	build_c_cast, build_asm_expr, c_end_compound_stmt, c_finish_stmt_expr,
	c_finish_return, c_finish_omp_parallel, c_finish_omp_task): New
	argument.
	* c-semantics.c (build_stmt): Same.
	(build_case_label): Same.
	* c-decl.c (c_finish_incomplete_decl): Pass location on down.
	(undeclared_variable): New argument.
	(make_label): Same.
	(lookup_label): Pass location on down.
	(define_label): Same.
	(finish_decl): Same.
	(build_compound_literal): Same.
	(finish_struct): Same.
	(finish_function): Do not set location here.
	(check_for_loop_decls): New argument.
	* tree.c (save_expr): Set location.
	(build_empty_stmt): New argument.
	* tree.h (build_empty_stmt): New argument to build_empty_stmt.
	(CAN_HAVE_LOCATION_P): Make sure we have a non empty node.
	* builtins.c (gimplify_va_arg_expr): Use locations.
	(expand_builtin_sync_operation): Same.
	* c-typeck.c (build_component_ref): New argument.
	(build_array_ref): Same.
	(build_external_ref): Same.
	(c_expr_sizeof_expr): Same.
	(c_expr_sizeof_type): Same.
	(parser_build_unary_op): Same.
	(build_conditional_expr): Same.
	(build_compound_expr): Pass location on down.
	(build_compound_expr): New argument.
	(build_c_cast): Same.
	(c_cast_expr): Same.
	(build_asm_expr): Same.
	(c_finish_return): Same.
	(c_process_expr_stmt): Pass location on down.
	(c_finish_stmt_expr): New argument.
	(push_clenaup): Same.
	(c_finish_omp_parallel): Same.
	(c_finish_omp_task): Same.
	* gimplify.c (gimplify_call_expr): Pass location on down.
	* c-omp.c (c_finish_omp_master): New argument.
	(c_finish_omp_critical): Same.
	(c_finish_omp_ordered): Same.
	(c_finish_omp_barrier): Same.
	(-c_finish_omp_taskwait): Same.
	(c_finish_omp_atomic): Same.
	(c_finish_omp_flush): Same.
	* tree-inline.c (copy_tree_body_r): Pass location on down.
	(inline_forbidden_p): Remove use of input_location.
	* c-gimplify.c (c_build_bind_expr): New argument.
	* c-common.c (c_common_truthvalue_conversion): Pass location on down.
	(c_sizeof_or_alignof_type): New argument.
	(c_alignof_expr): Same.
	(build_va_arg): Same.
	(c_add_case_label): Same.
	* c-common.h (c_sizeof_or_alignof_type, c_alignof_expr,
	c_sizeof, c_alignof, build_va_arg, build_stmt, build_case_label,
	c_build_bind_expr, objc_build_selector_expr, objc_build_throw_stmt,
	c_finish_omp_master, c_finish_omp_critical, c_finish_omp_ordered,
	c_finish_omp_barrier, c_finish_omp_atomic, c_finish_omp_flush,
	c_finish_omp_taskwait, c_finish_omp_for, c_split_parallel_clauses):
	New argument.
	* stub-objc.c (objc_build_selector_expr): Same.
	(objc_build_throw_stmt): Same.
	* c-parser.c (c_parser_declaration_or_fndef): Pass location on down.
	(c_parser_initelt): Same.
	(c_parser_compound_statement): Same.
	(c_parser_compound_statement_nostart): Same.
	(c_parser_label): Same.
	(c_parser_statement_after_labels): Same.
	(c_parser_if_body): Same.
	(c_parser_else_body): Same.
	(c_parser_if_statement): Same.
	(c_parser_switch_statement): Same.
	(c_parser_while_statement): Same.
	(c_parser_do_statement): Same.
	(c_parser_for_statement): Same.
	(c_parser_asm_statement): Same.
	(c_parser_conditional_expression): Same.
	(c_parser_binary_expression): Same.
	(c_parser_cast_expression): Same.
	(c_parser_unary_expression): Same.
	(c_parser_sizeof_expression): Same.
	(c_parser_alignof_expression): Same.
	(c_parser_postfix_expression): Same.
	(c_parser_expression): Same.
	(c_parser_objc_receiver): Same.
	(c_parser_omp_variable_list): Same.
	(c_parser_omp_structured_block): Same.
	(c_parser_omp_atomic): New argument.
	(c_parser_omp_barrier): Same.
	(c_parser_omp_critical): Same.
	(c_parser_omp_flush): Pass location on down.
	(c_parser_omp_for_loop): New argument.
	(c_parser_omp_for): Same.
	(c_parser_omp_master): Same.
	(c_parser_omp_ordered): Same.
	(c_parser_omp_sections_scope): Same.
	(c_parser_omp_sections): Same.
	(c_parser_omp_parallel): Same.
	(c_parser_omp_single): Same.
	(c_parser_omp_task): Same.
	(c_parser_omp_taskwait): Pass location on down.
	(c_parser_omp_construct): Same.
	(c_parser_omp_threadprivate): Same.
	* dwarf2asm.c, targhooks.c, optabs.c, tree.c, tree.h, target.h,
	builtins.c, omp-low.c, cgraphunit.c, tree-call-cdce.c,
	tree-ssa-alias.c, gimple-low.c, c-tree.h, expr.c, tree-parloops.c,
	c-decl.c, tree-eh.c, langhooks.c, function.c, stor-layout.c,
	c-typeck.c, gimplify.c, c-pragma.c, expmed.c, except.c, coverage.c,
	emit-rtl.c, cfgexpand.c, tree-mudflap.c, varasm.c, tree-nested.c,
	rtl.h, tree-inline.c, tree-profile.c, c-common.c, c-common.h,
	tree-switch-conversion.c, tree-cfg.c, ipa-struct-reorg.c, c-parser.c,
	config/i386/i386.c, stmt.c:
	Add location argument to the following function definitions and/or
	function calls: build_decl, objcp_start_struct, objcp_finish_struct,
	start_struct, finish_struct, PUSH_FIELD, create_artificial_label,
	cp_make_fname_decl, pushtag, implicitly_declare, c_make_fname_decl,
	build_compound_literal, parser_xref_tag, resolve_overloaded_builtin,
	do_case, c_finish_bc_stmt, build_compound_literal,
	build_function_call.
	* c-decl.c (build_compound_literal): Add location argument.
	Make all diagnostic calls use location.
	(start_struct): Same.
	(finish_struct): Same.
	(start_enum): Same.
	(build_enumerator): Same.
	(start_function): Same.
	(grokdeclarator): Make all diagnostic calls use location.
	(store_parm_decls_oldstyle): Same.
	* c-typeck.c (build_function_call): Add location argument.
	Make all diagnostic calls use location.
	(do_case): Same.
	(c_finish_bc_stmt): Same.
	* tree-nested.c (get_trampoline_type): Add argument.
	Pass location to build_decl.
	(lookup_tramp_for_decl): Pass location to get_trampoline_type.
	* rtl.h (RTL_LOCATION): New.
	* c-common.c (c_add_case_label): Add location argument.
	Make all diagnostic calls use location.
	* c-common.h: Add location argument to make_fname_decl, do_case,
	c_add_case_label, build_function_call, resolve_overloaded_builtin.
	* c-parser.c (c_parser_enum_specifier): Rename ident_loc to enum_loc.
	Set it appropriately for every case.  Pass enum_loc to start_enum
	call.  Pass value_loc first to build_enumerator.  Pass enum_loc to
	parser_xref_tag.
	(c_parser_struct_or_union_specifier): Save location.  Use it for
	start_struct, finish_struct, and parser_xref_tag.
gcc/testsuite/
	* gcc.dg/old-style-prom-3.c: Add column info.
	* gcc.dg/overflow-warn-1.c
	* gcc.dg/gomp/pr27415.c
	* gcc.dg/gomp/for-1.c: Same.
	* gcc.dg/enum-compat-1.c: Same.
	* gcc.dg/c99-tag-3.c: Same.
	* gcc.dg/Wredundant-decls-2.c: Same.
	* gcc.dg/func-ptr-conv-1.c: Same.
	* gcc.dg/asm-wide-1.c: Same.
	* gcc.dg/nofixed-point-2.c: Same.
	* gcc.dg/cpp/line3.c: Same.
	* gcc.dg/array-10.c: Same.
	* gcc.dg/c99-vla-jump-1.c: Same.
	* gcc.dg/pr20368-1.c: Same.
	* gcc.dg/Wshadow-3.c: Same.
	* gcc.dg/c90-const-expr-8.c: Same.
	* gcc.dg/label-decl-2.c: Same.
	* gcc.dg/dremf-type-compat-2.c: Same.
	* gcc.dg/c90-const-expr-5.c: Same.
	* gcc.dg/builtins-30.c: Same.
	* gcc.dg/Warray-bounds.c: Same.
	* gcc.dg/Wcxx-compat-2.c: Same.
	* gcc.dg/tree-ssa/col-1.c: Same.
	* gcc.dg/old-style-prom-2.c: Same.
	* gcc.dg/cast-function-1.c: Same.
	* gcc.dg/pr15698-1.c: Same.
	* gcc.dg/dremf-type-compat-3.c: Same.
	* gcc.dg/vla-8.c: Same.
	* gcc.dg/gomp/pr27415.c: Move firstprivate diagnostics to correct
	line.
	* gcc.dg/label-decl-2.c: Move label diagnostic to correct line.
	* gcc.dg/old-style-prom-3.c: Check for error on the correct line.
	* gcc.dg/enum-compat-1.c: Same.
	* gcc.dg/dremf-type-compat-2.c: Same.
	* gcc.dg/old-style-prom-2.c: Same.
	* gcc.dg/pr15698-1.c: Same.
	* gcc.dg/pr20368-1.c: Same.
	* gcc.dg/dremf-type-compat-3.c: Same.
	* gcc.dg/builtins-30.c: Same.  Test for columns.
gcc/objcp/
	* objcp-decl.h (c_end_compound_stmt): New argument.
	* objcp-decl.c (objcp_start_struct): Add argument.
	(objcp_finish_struct): Same.
gcc/cp/
	* typeck.c (cp_build_binary_op): Pass location to overflow_warning.
	(build_modify_expr): New arg.
	* semantics.c (finish_unary_op_expr): Pass location to
	overflow_warning.
	(handle_omp_for_class_iterator): Pass location to build_modify_expr.
	* typeck.c (cxx_sizeof_or_alignof_type): Pass location to
	c_sizeof_or_alignof_type.
	(build_array_ref): New argument.
	(build_compound_expr): Same.
	(build_const_cast): Same.
	(build_ptrmemfunc): Pass location to build_c_cast.
	* init.c (avoid_placement_new_aliasing): Pass location to
	build_stmt.
	(build_vec_delete_1): Pass location to cp_build_modify_expr,
	build_compound_expr.
	* class.c (build_vtbl_ref_1): Pass location to build_array_ref.
	* decl.c (poplevel): Pass location to c_build_bind_expr.
	(finish_case_label): Pass location to build_case_label.
	(finish_constructor_body): Same.
	(finish_destructor_body): Pass location to build_stmt.
	(cxx_maybe_build_cleanup): Same, but to build_compound_expr.
	* call.c (build_new_op): Pass location to build_array_ref.
	(build_x_va_arg): Pass location to build_va_arg.
	* except.c (expand_end_catch_block): Pass location to
	build_stmt.
	* cp-tree.h (build_array_ref): New argument.
	(build_compound_expr): Same.
	(build_c_cast): Same.
	* cp-gimplify.c (gimplify_if_stmt): Pass location on down.
	(gimplify_switch_stmt): Same.
	* typeck2.c (split_nonconstant_init_1): Same.
	* pt.c (tsubst_copy): Same.
	* semantics.c (add_decl_expr): Same.
	(do_poplevel): Same.
	(push_cleanup): Same.
	(finish_goto_stmt): Same.
	(finish_expr_stmt): Same.
	(begin_if_stmt): Same.
	(begin_while_stmt): Same.
	(begin_do_stmt): Same.
	(finish_return_stmt): Same.
	(begin_for_stmt): Same.
	(finish_break_stmt): Same.
	(finish_continue_stmt): Same.
	(begin_switch_stmt): Same.
	(begin_try_block): Same.
	(begin_handler): Same.
	(finish_asm_stmt): Same.
	(finish_label_stmt): Same.
	(finish_stmt_expr_expr): Same.
	(finalize_nrv_r): Same.
	(finish_omp_atomic): Same.
	* name-lookup.c (do_using_directive): Same.
	* decl2.c (grok_array_decl): Same.
	* parser.c (cp_parser_cast_expression): Same.
	(cp_parser_selection_statement): Same.
	(cp_parser_implicitly_scoped_statement): Same.
	(cp_parser_objc_selector_expression): Same.
	(cp_parser_objc_synchronized_statement): Same.
	(cp_parser_objc_throw_statement): Same.
	(cp_parser_omp_critical): Same.
	(cp_parser_omp_master): Same.
	* typeck.c (build_function_call): Add location argument.
	* init.c: Add location argument to all build_decl calls.
	* class.c: Same.
	* method.c: Same.
	* rtti.c: Same.
	* tree.c: Same.
	* pt.c: Same.
	* semantics.c: Same.
	* lex.c: Same.
	* decl2.c: Same.
	* cp-gimplify.c: Same.
	* decl.c: Same.
	(cp_make_fname_decl): Add location argument.  Pass location ot
	build_decl.
	(finish_case_label): Same.
	* cp-tree.h (finish_case_label): Add location argument.
	* parser.c (cp_parser_label_for_labeled_statement): Pass location to
	finish_case_label.
gcc/fortran/
	* trans-array.c (gfc_trans_allocate_array_storage): Pass
	location on down.
	(gfc_trans_array_constructor_value): Same.
	(gfc_trans_scalarized_loop_end): Same.
	(gfc_conv_ss_startstride): Same.
	(gfc_trans_g77_array): Same.
	(gfc_trans_dummy_array_bias): Same.
	(gfc_conv_array_parameter): Same.
	(structure_alloc_comps): Same.
	* trans-expr.c (gfc_conv_function_call): Same.
	(fill_with_spaces): Same.
	(gfc_trans_string_copy): Same.
	(gfc_trans_scalar_assign): Same.
	* trans-stmt.c (gfc_trans_goto): Same.
	(gfc_trans_if_1): Same.
	(gfc_trans_simple_do): Same.
	(gfc_trans_do): Same.
	(gfc_trans_do_while): Same.
	(gfc_trans_logical_select): Same.
	(gfc_trans_select): Same.
	(gfc_trans_forall_loop): Same.
	(gfc_trans_nested_forall_loop): Same.
	(generate_loop_for_temp_to_lhs): Same.
	(generate_loop_for_rhs_to_temp): Same.
	(gfc_trans_forall_1): Same.
	(gfc_trans_where_assign): Same.
	(gfc_trans_where_3): Same.
	(gfc_trans_allocate): Same.
	* trans.c (gfc_finish_block): Same.
	(gfc_trans_runtime_check): Same.
	(gfc_call_malloc): Same.
	(gfc_allocate_with_status): Same.
	(gfc_call_free): Same.
	(gfc_deallocate_with_status): Same.
	(gfc_call_realloc): Same.
	(gfc_trans_code): Same.
	* trans-decl.c (gfc_init_default_dt): Same.
	(gfc_generate_constructors): Same.
	* trans-io.c (gfc_trans_io_runtime_check): Same.
	* trans-intrinsic.c (gfc_conv_intrinsic_ctime): Same.
	(gfc_conv_intrinsic_fdate): Same.
	(gfc_conv_intrinsic_ttynam): Same.
	(gfc_conv_intrinsic_minmax): Same.
	(gfc_conv_intrinsic_minmax_char): Same.
	(gfc_conv_intrinsic_anyall): Same.
	(gfc_conv_intrinsic_count): Same.
	(gfc_conv_intrinsic_arith): Same.
	(gfc_conv_intrinsic_minmaxloc): Same.
	(gfc_conv_intrinsic_minmaxval): Same.
	(gfc_conv_intrinsic_rrspacing): Same.
	(gfc_conv_intrinsic_array_transfer): Same.
	(gfc_conv_intrinsic_trim): Same.
	(gfc_conv_intrinsic_repeat): Same.

From-SVN: r148442
2009-06-12 22:06:47 +00:00
Richard Henderson cd9c1ca866 cfgcleanup.c (try_crossjump_to_edge): Only skip past NOTE_INSN_BASIC_BLOCK.
* cfgcleanup.c (try_crossjump_to_edge): Only skip past
	NOTE_INSN_BASIC_BLOCK.
	* cfglayout.c (duplicate_insn_chain): Copy epilogue insn marks.
	Duplicate NOTE_INSN_EPILOGUE_BEG notes.
	* cfgrtl.c (can_delete_note_p): Allow NOTE_INSN_EPILOGUE_BEG
	to be deleted.
	* dwarf2out.c (struct cfa_loc): Change indirect field to bitfield,
	add in_use field.
	(add_cfi): Disable check redefining cfa away from drap.
	(lookup_cfa_1): Add remember argument; handle remember/restore.
	(lookup_cfa): Pass remember argument.
	(cfa_remember): New.
	(compute_barrier_args_size_1): Remove sibcall check.
	(dwarf2out_frame_debug_def_cfa): New.
	(dwarf2out_frame_debug_adjust_cfa): New.
	(dwarf2out_frame_debug_cfa_offset): New.
	(dwarf2out_frame_debug_cfa_register): New.
	(dwarf2out_frame_debug_cfa_restore): New.
	(dwarf2out_frame_debug): Handle REG_CFA_* notes.
	(dwarf2out_begin_epilogue): New.
	(dwarf2out_frame_debug_restore_state): New.
	(dw_cfi_oprnd1_desc): Handle DW_CFA_remember_state,
	DW_CFA_restore_state.
	(output_cfi_directive): Likewise.
	(convert_cfa_to_fb_loc_list): Likewise.
	(dw_cfi_oprnd1_desc): Handle DW_CFA_restore.
	* dwarf2out.h: Update.
	* emit-rtl.c (try_split): Don't split RTX_FRAME_RELATED_P.
	(copy_insn_1): Early out for null.
	* final.c (final_scan_insn): Call dwarf2out_begin_epilogue
	and dwarf2out_frame_debug_restore_state.
	* function.c (prologue, epilogue, sibcall_epilogue): Remove.
	(prologue_insn_hash, epilogue_insn_hash): New.
	(free_after_compilation): Adjust freeing accordingly.
	(record_insns): Create hash table if needed; push insns into
	hash instead of array.
	(maybe_copy_epilogue_insn): New.
	(contains): Search hash table instead of array.
	(sibcall_epilogue_contains): Remove.
	(thread_prologue_and_epilogue_insns): Split eh_return insns
	and mark them as epilogues.
	(reposition_prologue_and_epilogue_notes): Rewrite epilogue
	scanning in terms of basic blocks.
	* insn-notes.def (CFA_RESTORE_STATE): New.
	* jump.c (returnjump_p_1): Accept EH_RETURN.
	(eh_returnjump_p_1, eh_returnjump_p): New.
	* reg-notes.def (CFA_DEF_CFA, CFA_ADJUST_CFA, CFA_OFFSET,
	CFA_REGISTER, CFA_RESTORE): New.
	* rtl.def (EH_RETURN): New.
	* rtl.h (eh_returnjump_p, maybe_copy_epilogue_insn): Declare.

	* config/bfin/bfin.md (UNSPEC_VOLATILE_EH_RETURN): Remove.
	(eh_return_internal): Use eh_return rtx; split w/ epilogue.

	* config/i386/i386.c (gen_push): Update cfa state.
	(pro_epilogue_adjust_stack): Add set_cfa argument.  When true,
	add a CFA_ADJUST_CFA note.
	(ix86_dwarf_handle_frame_unspec): Remove.
	(ix86_expand_prologue): Update cfa state.
	(ix86_emit_restore_reg_using_pop): New.
	(ix86_emit_restore_regs_using_pop): New.
	(ix86_emit_leave): New.
	(ix86_emit_restore_regs_using_mov): Add CFA_RESTORE notes.
	(ix86_expand_epilogue): Add notes for unwinding the epilogue.
	* config/i386/i386.h (struct machine_cfa_state): New.
	(ix86_cfa_state): New.
	* config/i386/i386.md (UNSPEC_EH_RETURN): Remove.
	(eh_return_internal): Merge from eh_return_<mode>,
	use eh_return rtx, split w/ epilogue.

From-SVN: r147995
2009-05-29 17:33:46 -07:00