Commit Graph

1102 Commits

Author SHA1 Message Date
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
Steven Bosscher df35c271df gcse.c (ae_gen): Remove.
* gcse.c (ae_gen): Remove.
	(can_assign_to_reg_p): Rename to can_assign_to_reg_without_clobbers_p
	and make non-static function to make it available in store-motion.c.
	Update call sites with search-and-replace.
	(enumerate_ldsts, reg_set_info, reg_clear_last_set, store_ops_ok,
	extract_mentioned_regs, extract_mentioned_regs_helper,
	find_moveable_store, compute_store_table, load_kills_store, find_loads,
	store_killed_in_insn, store_killed_after, store_killed_before,
	build_store_vectors, insert_insn_start_basic_block, insert-store,
	remove_reachable_equiv_notes, replace_store_insn, delete_store,
	free_store_memory, one_store_motion_pass, gate_rtl_store_motion,
	execute_rtl_store_motion, pass_rtl_store_motion): Move to...
	* store-motion.c: ...new file.  Also copy data structures from gcse.c
	and clean up to remove parts not used by store motion.
	* rtl.h (can_assign_to_reg_without_clobbers_p): Add prototype.
	* Makefile.in (store-motion.o): New rule. Add to OBJS-common.

From-SVN: r147001
2009-04-30 10:51:08 +00:00
Michael Matz 4e3825dba9 Expand from SSA.
gcc/
        Expand from SSA.
	* builtins.c (fold_builtin_next_arg): Handle SSA names.
	* tree-ssa-copyrename.c (rename_ssa_copies): Use ssa_name() directly.
	* tree-ssa-coalesce.c (create_outofssa_var_map): Mark only useful
	SSA names. 
	(compare_pairs): Swap cost comparison.
	(coalesce_ssa_name): Don't use change_partition_var.
	* tree-nrv.c (struct nrv_data): Add modified member.
	(finalize_nrv_r): Set it.
	(tree_nrv): Use it to update statements.
	(pass_nrv): Require PROP_ssa.
	* tree-mudflap.c (mf_decl_cache_locals,
	mf_build_check_statement_for): Use make_rename_temp.
	(pass_mudflap_2): Require PROP_ssa, run ssa update at finish.
	* alias.c (find_base_decl): Handle SSA names.
	* emit-rtl (set_reg_attrs_for_parm): Make non-static.
	(component_ref_for_mem_expr): Don't leak SSA names into RTL.
	* rtl.h (set_reg_attrs_for_parm): Declare.
	* tree-optimize.c (pass_cleanup_cfg_post_optimizing): Rename
	to "optimized", remove unused locals at finish.
	(execute_free_datastructures): Make global, call
	delete_tree_cfg_annotations.
	(execute_free_cfg_annotations): Don't call
	delete_tree_cfg_annotations.

	* ssaexpand.h: New file.
	* expr.c (toplevel): Include ssaexpand.h.
	(expand_assignment): Handle SSA names the same as register
	variables.
	(expand_expr_real_1): Expand SSA names.
	* cfgexpand.c (toplevel): Include ssaexpand.h.
	(SA): New global variable.
	(gimple_cond_pred_to_tree): Fold TERed comparisons into predicates.
	(SSAVAR): New macro.
	(set_rtl): New helper function.
	(add_stack_var): Deal with SSA names, use set_rtl.
	(expand_one_stack_var_at): Likewise.
	(expand_one_stack_var): Deal with SSA names.
	(stack_var_size_cmp): Use code (SSA_NAME / DECL) as tie breaker
	before unique numbers.
	(expand_stack_vars): Use set_rtl.
	(expand_one_var): Accept SSA names, add asserts for them, feed them
	to above subroutines.
	(expand_used_vars): Expand all partitions (without default defs),
	then only the local decls (ignoring those expanded already).
	(expand_gimple_cond): Remove edges when jumpif() expands an
	unconditional jump.
	(expand_gimple_basic_block): Don't clear EDGE_EXECUTABLE here,
	or remove abnormal edges.  Ignore insns setting the LHS of a TERed
	SSA name.
	(gimple_expand_cfg): Call into rewrite_out_of_ssa, initialize
	members of SA; deal with PARM_DECL partitions here; expand
	all PHI nodes, free tree datastructures and SA.  Commit instructions
	on edges, clear EDGE_EXECUTABLE and remove abnormal edges here.
	(pass_expand): Require and destroy PROP_ssa, verify SSA form, flow
	info and statements at start, collect garbage at finish.
	* tree-ssa-live.h (struct _var_map): Remove partition_to_var member.
	(VAR_ANN_PARTITION) Remove.
	(change_partition_var): Don't declare.
	(partition_to_var): Always return SSA names.
	(var_to_partition): Only accept SSA names.
	(register_ssa_partition): Only check argument.
	* tree-ssa-live.c (init_var_map): Don't allocate partition_to_var
	member.
	(delete_var_map): Don't free it.
	(var_union): Only accept SSA names, simplify.
	(partition_view_init): Mark only useful SSA names as used.
	(partition_view_fini): Only deal with SSA names.
	(change_partition_var): Remove.
	(dump_var_map): Use ssa_name instead of partition_to_var member.
	* tree-ssa.c (delete_tree_ssa): Don't remove PHI nodes on RTL
	basic blocks.
	* tree-outof-ssa.c (toplevel): Include ssaexpand.h and expr.h.
	(struct _elim_graph): New member const_dests; nodes member vector of
	ints.
	(set_location_for_edge): New static helper.
	(create_temp): Remove.
	(insert_partition_copy_on_edge, insert_part_to_rtx_on_edge,
	insert_value_copy_on_edge, insert_rtx_to_part_on_edge): New
	functions.
	(new_elim_graph): Allocate const_dests member.
	(clean_elim_graph): Truncate const_dests member.
	(delete_elim_graph): Free const_dests member.
	(elim_graph_size): Adapt to new type of nodes member.
	(elim_graph_add_node): Likewise.
	(eliminate_name): Likewise.
	(eliminate_build): Don't take basic block argument, deal only with
	partition numbers, not variables.
	(get_temp_reg): New static helper.
	(elim_create): Use it, deal with RTL temporaries instead of trees.
	(eliminate_phi): Adjust all calls to new signature.
	(assign_vars, replace_use_variable, replace_def_variable): Remove.
	(rewrite_trees): Only do checking.
	(edge_leader, stmt_list, leader_has_match, leader_match): Remove.
	(same_stmt_list_p, identical_copies_p, identical_stmt_lists_p,
	init_analyze_edges_for_bb, fini_analyze_edges_for_bb,
	contains_tree_r, MAX_STMTS_IN_LATCH,
	process_single_block_loop_latch, analyze_edges_for_bb,
	perform_edge_inserts): Remove.
	(expand_phi_nodes): New global function.
	(remove_ssa_form): Take ssaexpand parameter.  Don't call removed
	functions, initialize new parameter, remember partitions having a
	default def.
	(finish_out_of_ssa): New global function.
	(rewrite_out_of_ssa): Make global.  Adjust call to remove_ssa_form,
	don't reset in_ssa_p here, don't disable TER when mudflap.
	(pass_del_ssa): Remove.
	* tree-flow.h (struct var_ann_d): Remove out_of_ssa_tag and
	partition members.
	(execute_free_datastructures): Declare.
	* Makefile.in (SSAEXPAND_H): New variable.
	(tree-outof-ssa.o, expr.o, cfgexpand.o): Depend on SSAEXPAND_H.
	* basic-block.h (commit_one_edge_insertion): Declare.
	* passes.c (init_optimization_passes): Move pass_nrv and
	pass_mudflap2 before pass_cleanup_cfg_post_optimizing, remove
	pass_del_ssa, pass_free_datastructures, pass_free_cfg_annotations.
	* cfgrtl.c (commit_one_edge_insertion): Make global, don't declare.
	(redirect_branch_edge): Deal with super block when expanding, split
	out jump patching itself into ...
	(patch_jump_insn): ... here, new static helper.

testsuite/

	Expand from SSA.
	* gcc.dg/tree-ssa/20030728-1.c: Use -rtl-expand-details dump and
	change regexps.
	* gcc.target/i386/pr37248-1.c: Modified.
	* gcc.target/i386/pr37248-3.c: Modified.
	* gcc.target/i386/pr37248-2.c: Modified.
	* gnat.dg/aliasing1.adb: Modified.
	* gnat.dg/pack9.adb: Modified.
	* gnat.dg/aliasing2.adb: Modified.
	* gcc.dg/strict-overflow-2.c: Modified.
	* gcc.dg/autopar/reduc-1char.c: Modified.
	* gcc.dg/autopar/reduc-2char.c: Modified.
	* gcc.dg/autopar/reduc-1.c: Modified.
	* gcc.dg/autopar/reduc-2.c: Modified.
	* gcc.dg/autopar/reduc-3.c: Modified.
	* gcc.dg/autopar/reduc-6.c: Modified.
	* gcc.dg/autopar/reduc-7.c: Modified.
	* gcc.dg/autopar/reduc-8.c: Modified.
	* gcc.dg/autopar/reduc-9.c: Modified.
	* gcc.dg/autopar/reduc-1short.c: Modified.
	* gcc.dg/autopar/reduc-2short.c: Modified.
	* gcc.dg/autopar/parallelization-1.c: Modified.
	* gcc.dg/strict-overflow-4.c: Modified.
	* gcc.dg/strict-overflow-6.c: Modified.
	* gcc.dg/gomp/combined-1.c: Modified.
	* gcc.dg/no-strict-overflow-1.c: Modified.
	* gcc.dg/no-strict-overflow-3.c: Modified.
	* gcc.dg/no-strict-overflow-5.c: Modified.
	* gcc.dg/tree-ssa/reassoc-13.c: Modified.
	* gcc.dg/tree-ssa/pr18134.c: Modified.
	* gcc.dg/tree-ssa/20030824-1.c: Modified.
	* gcc.dg/tree-ssa/vector-2.c: Modified.
	* gcc.dg/tree-ssa/forwprop-9.c: Modified.
	* gcc.dg/tree-ssa/loop-21.c: Modified.
	* gcc.dg/tree-ssa/20030824-2.c: Modified.
	* gcc.dg/tree-ssa/vector-3.c: Modified.
	* gcc.dg/tree-ssa/asm-3.c: Modified.
	* gcc.dg/tree-ssa/pr23294.c: Modified.
	* gcc.dg/tree-ssa/loop-22.c: Modified.
	* gcc.dg/tree-ssa/loop-15.c: Modified.
	* gcc.dg/tree-ssa/prefetch-4.c: Modified.
	* gcc.dg/tree-ssa/pr22051-1.c: Modified.
	* gcc.dg/tree-ssa/pr20139.c: Modified.
	* gcc.dg/tree-ssa/scev-cast.c: Modified.
	* gcc.dg/tree-ssa/pr22051-2.c: Modified.
	* gcc.dg/tree-ssa/reassoc-1.c: Modified.
	* gcc.dg/tree-ssa/loop-5.c: Modified.
	* gcc.dg/tree-ssa/pr19431.c: Modified.
	* gcc.dg/tree-ssa/pr32044.c: Modified.
	* gcc.dg/tree-ssa/prefetch-7.c: Modified.
	* gcc.dg/tree-ssa/loop-19.c: Modified.
	* gcc.dg/tree-ssa/loop-28.c: Modified.
	* gcc.dg/tree-ssa/ssa-pre-15.c: Modified.
	* gcc.dg/tree-ssa/divide-1.c: Modified.
	* gcc.dg/tree-ssa/inline-1.c: Modified.
	* gcc.dg/tree-ssa/divide-3.c: Modified.
	* gcc.dg/tree-ssa/pr30978.c: Modified.
	* gcc.dg/tree-ssa/alias-6.c: Modified.
	* gcc.dg/tree-ssa/divide-4.c: Modified.
	* gcc.dg/tree-ssa/alias-11.c: Modified.
	* gcc.dg/no-strict-overflow-7.c: Modified.
	* gcc.dg/strict-overflow-1.c: Modified.
	* gcc.dg/pr15784-4.c: Modified.
	* gcc.dg/pr34263.c: Modified.
	* gcc.dg/strict-overflow-3.c: Modified.
	* gcc.dg/tree-prof/stringop-1.c: Modified.
	* gcc.dg/tree-prof/val-prof-1.c: Modified.
	* gcc.dg/tree-prof/val-prof-2.c: Modified.
	* gcc.dg/tree-prof/val-prof-3.c: Modified.
	* gcc.dg/tree-prof/val-prof-4.c: Modified.
	* gcc.dg/no-strict-overflow-2.c: Modified.
	* gcc.dg/no-strict-overflow-4.c: Modified.
	* gcc.dg/no-strict-overflow-6.c: Modified.
	* g++.dg/tree-ssa/pr27090.C: Modified.
	* g++.dg/tree-ssa/tmmti-2.C: Modified.
	* g++.dg/tree-ssa/ptrmemfield.C: Modified.
	* g++.dg/tree-ssa/pr19807.C: Modified.
	* g++.dg/opt/pr30965.C: Modified.
	* g++.dg/init/new17.C: Modified.
	* gfortran.dg/whole_file_6.f90: Modified.
	* gfortran.dg/whole_file_5.f90: Modified.
	* gfortran.dg/reassoc_1.f90: Modified.
	* gfortran.dg/reassoc_3.f90: Modified.

From-SVN: r146817
2009-04-26 19:35:04 +00:00
Ian Lance Taylor 32e8bb8ebf combine.c (record_value_for_reg): Change 0 to VOIDmode, twice.
gcc/:
	* combine.c (record_value_for_reg): Change 0 to VOIDmode, twice.
	(record_dead_and_set_regs): Likewise.
	* df.h (struct df_mw_hardreg): Change flags field to int.
	(struct df_base_ref): Likewise.
	(struct df): Change changeable_flags field to int.
	* df-scan.c (df_defs_record): Change clobber_flags to int.
	* dwarf2.h (enum dwarf_tag): Make lo_user and hi_user values enum
	constants rather than #define macros.
	(enum dwarf_attribute, enum dwarf_location_atom): Likewise.
	(enum dwarf_type, enum dwarf_endianity_encoding): Likewise.
	(enum dwarf_calling_convention): Likewise.
	(enum dwarf_line_number_x_ops): Likewise.
	(enum dwarf_call_frame_info): Likewise.
	(enum dwarf_source_language): Likewise.
	* dwarf2out.c (int_loc_descriptor): Add cast to enum type.
	(add_calling_convention_attribute): Likewise.
	* fold-const.c (fold_undefer_overflow_warnings): Add cast to enum
	type.
	(combine_comparisons): Change compcode to int.  Add cast to enum
	type.
	* genrecog.c (maybe_both_true_2): Change c to int.
	(write_switch): Likewise.  Add cast to enum type.
	* gimplify.c (gimplify_omp_for): Handle return values from
	gimplify_expr using MIN rather than bitwise or.
	(gimplify_expr): Add cast to enum type.
	* ipa-prop.c (update_jump_functions_after_inlining): Change
	IPA_BOTTOM to IPA_JF_UNKNOWN.
	* ira.c (setup_class_subset_and_memory_move_costs): Change mode to
	int.  Add casts to enum type.
	(setup_cover_and_important_classes): Change cl to int.  Add casts
	to enum type.
	(setup_class_translate): Change cl and mode to int.
	(ira_init_once): Change mode to int.
	(free_register_move_costs): Likewise.
	(setup_prohibited_mode_move_regs): Add casts to enum type.
	* langhooks.c (add_builtin_function_common): Rework assertion that
	value fits bitfield.
	* mcf.c (add_fixup_edge): Change type parameter to edge_type.
	* omega.c (omega_do_elimination): Avoid math on enum types.
	* optabs.c (expand_vec_shift_expr): Remove casts to int.
	* opts.c (set_debug_level): Change 2 to enum constant.  Use new
	int local to handle integral_argment value.
	* regmove.c (try_auto_increment): Change PUT_MODE to
	PUT_REG_NOTE_KIND.
	* reload.c (push_secondary_reload): Add casts to enum type.
	(secondary_reload_class, find_valid_class): Likewise.
	* reload1.c (emit_input_reload_insns): Likewise.
	* rtl.h (NOTE_VAR_LOCATION_STATUS): Likewise.
	* sel-sched.c (init_hard_regs_data): Change cur_mode to int.
	* sel-sched-ir.c (hash_with_unspec_callback): Change 0 to enum
	constant.
	* tree.c (build_common_builtin_nodes): Add casts to enum type.
	* tree-complex.c (complex_lattice_t): Typedef to int rather than
	enum type.
	(expand_complex_libcall): Add casts to enum type.
	* tree-into-ssa.c (get_ssa_name_ann): Change 0 to enum constant.
	* tree-vect-loop.c (vect_model_reduction_cost): Compare reduc_code
	with ERROR_MARK, not NUM_TREE_CODES.
	(vect_create_epilog_for_reduction): Likewise.
	(vectorizable_reduction): Don't initialize epiloc_reduc_code.
	When not using it, set it to ERROR_MARK rather than
	NUM_TREE_CODES.
	* tree-vect-patterns.c (vect_pattern_recog_1): Change vec_mode to
	enum machine_mode.
	* tree-vect-stmts.c (new_stmt_vec_info): Change 0 to
	vect_unused_in_loop.  Change 0 to loop_vect.
	* tree-vectorizer.c (vect_set_verbosity_level): Add casts to enum
	type.
	* var-tracking.c (get_init_value): Change return type to enum
	var_init_status.
	* vec.h (DEF_VEC_FUNC_P) [iterate]: Cast 0 to type T.
	* config/arm/arm.c (fp_model_for_fpu): Change to array to enum
	arm_fp_model.
	(arm_override_options): Add casts to enum type.
	(arm_emit_tls_decoration): Likewise.
	* config/i386/i386.c (ix86_function_specific_restore): Add casts
	to enum type.
	* config/i386/i386-c.c (ix86_pragma_target_parse): Likewise.
	* config/ia64/ia64.c (ia64_expand_compare): Change magic to int.
	* config/rs6000/rs6000.c (rs6000_override_options): Add casts to
	enum type.
	* config/s390/s390.c (code_for_builtin_64): Change to array of
	enum insn_code.
	(code_for_builtin_31): Likewise.
	(s390_expand_builtin): Change code_for_builtin to enum insn_code
	const *.
	* config/sparc/sparc.c (sparc_override_options): Change value
	field in struct code_model to enum cmodel.  In initializer change
	0 to NULL and add cast to enum type.

	* c-typeck.c (build_modify_expr): Add lhs_origtype parameter.
	Change all callers.  Issue a -Wc++-compat warning using
	lhs_origtype if necessary.
	(convert_for_assignment): Issue -Wc++-compat warnings about
	invalid conversions to enum type on assignment.
	* c-common.h (build_modify_expr): Update declaration.

gcc/cp/:
	* call.c (build_temp): Change 0 to enum constant.
	* cp-tree.h (cp_lvalue_kind): Typedef to int rather than enum
	type.
	* cp-gimplify.c (cp_gimplify_expr): Add cast to enum type.
	* decl2.c (constrain_visibility): Likewise.
	* parser.c (cp_lexer_get_preprocessor_token): Likewise.
	(cp_parser_flags): Typedef to int rather than enum type.
	(cp_parser_expression_stack_entry): Change prec field to enum
	cp_parser_prec.

	* typeck.c (build_modify_expr): Add lhs_origtype parameter.
	Change all callers.

gcc/fortran/:
	* gfortran.h (enum gfc_symbol_type): New named enum type, broken
	out of struct gfc_symbol.
	(struct gfc_symbol): Use enum gfc_symbol_type.
	(enum gfc_array_ref_dimen_type): New named enum type, broken out
	of struct gfc_array_ref).
	(struct gfc_array_ref): Use enum gfc_array_ref_dimen_type.
	(mod_pointee_as): Update declaration.
	* decl.c (add_global_entry): Change type to enum gfc_symbol_type.
	(gfc_mod_pointee_as): Change return type to "match".
	* module.c (mio_array_ref): Add cast to enum type.
	(mio_symbol): Likewise.
	* resolve.c (resolve_global_procedure): Change type to enum
	gfc_symbol_type.
	* trans-io.c (gfc_build_st_parameter): Change type to unsigned
	int.

gcc/java/:
	* jcf-parse.c (handle_constant): Add cast to enum type.

gcc/objc/:
	* objc-act.c (get_super_receiver): Update calls to
	build_modify_expr to pass new argument.

gcc/testsuite/:
	* gcc.dg/Wcxx-compat-4.c: New testcase.

From-SVN: r146735
2009-04-24 15:31:38 +00:00
Jakub Jelinek 6216f94e37 re PR rtl-optimization/39794 (Miscompile with -O2 -funroll-loops)
PR rtl-optimization/39794
	* alias.c (canon_true_dependence): Add x_addr argument.
	* rtl.h (canon_true_dependence): Adjust prototype.
	* cse.c (check_dependence): Adjust canon_true_dependence callers.
	* cselib.c (cselib_invalidate_mem): Likewise.
	* gcse.c (compute_transp): Likewise.
	* dse.c (scan_reads_nospill): Likewise.
	(record_store, check_mem_read_rtx): Likewise.  For non-const-or-frame
	addresses pass base->val_rtx as mem_addr, for const-or-frame addresses
	canon_base_addr of the group, plus optional offset.
	(struct group_info): Rename canon_base_mem to
	canon_base_addr.
	(get_group_info): Set canon_base_addr to canon_rtx of base, not
	canon_rtx of base_mem.

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

From-SVN: r146669
2009-04-24 08:58:02 +02:00
Taras Glek d1b382088a hashtab.h: Update GTY annotations to new syntax
2009-04-21  Taras Glek <tglek@mozilla.com>

	* include/hashtab.h: Update GTY annotations to new syntax
	* include/splay-tree.h: Likewise


gcc/ChangeLog

2009-04-21  Taras Glek <tglek@mozilla.com>

	* alias.c: Update GTY annotations to new syntax
	* basic-block.h: Likewise
	* bitmap.h: Likewise
	* c-common.h: Likewise
	* c-decl.c: Likewise
	* c-parser.c: Likewise
	* c-pragma.c: Likewise
	* c-tree.h: Likewise
	* cfgloop.h: Likewise
	* cgraph.h: Likewise
	* config/alpha/alpha.c: Likewise
	* config/arm/arm.h: Likewise
	* config/avr/avr.h: Likewise
	* config/bfin/bfin.c: Likewise
	* config/cris/cris.c: Likewise
	* config/darwin.c: Likewise
	* config/frv/frv.c: Likewise
	* config/i386/i386.c: Likewise
	* config/i386/i386.h: Likewise
	* config/i386/winnt.c: Likewise
	* config/ia64/ia64.h: Likewise
	* config/iq2000/iq2000.c: Likewise
	* config/mips/mips.c: Likewise
	* config/mmix/mmix.h: Likewise
	* config/pa/pa.c: Likewise
	* config/pa/pa.h: Likewise
	* config/rs6000/rs6000.c: Likewise
	* config/s390/s390.c: Likewise
	* config/sparc/sparc.c: Likewise
	* config/xtensa/xtensa.c: Likewise
	* cselib.h: Likewise
	* dbxout.c: Likewise
	* dwarf2out.c: Likewise
	* except.c: Likewise
	* except.h: Likewise
	* fixed-value.h: Likewise
	* function.c: Likewise
	* function.h: Likewise
	* gimple.h: Likewise
	* integrate.c: Likewise
	* optabs.c: Likewise
	* output.h: Likewise
	* real.h: Likewise
	* rtl.h: Likewise
	* stringpool.c: Likewise
	* tree-data-ref.c: Likewise
	* tree-flow.h: Likewise
	* tree-scalar-evolution.c: Likewise
	* tree-ssa-address.c: Likewise
	* tree-ssa-alias.h: Likewise
	* tree-ssa-operands.h: Likewise
	* tree.c: Likewise
	* tree.h: Likewise
	* varasm.c: Likewise
	* varray.h: Likewise
	* vec.h: Likewise
	* coretypes.h: Do not define GTY macro if it is already defined
	* doc/gty.texi: Update GTY documentation to new syntax
	* gengtype-lex.l: Enforce attribute-like syntax for GTY annotations on structs
	* gengtype-parse.c: Likewise


gcc/ada/ChangeLog

2009-04-21  Taras Glek <tglek@mozilla.com>

	* gcc-interface/ada-tree.h: Update GTY annotations to new syntax
	* gcc-interface/trans.c: Likewise
	* gcc-interface/utils.c: Likewise


gcc/cp/ChangeLog

2009-04-21  Taras Glek <tglek@mozilla.com>

	* cp-tree.h: Update GTY annotations to new syntax
	* decl.c: Likewise
	* mangle.c: Likewise
	* name-lookup.c: Likewise
	* name-lookup.h: Likewise
	* parser.c: Likewise
	* pt.c: Likewise
	* rtti.c: Likewise
	* semantics.c: Likewise
	* typeck2.c: Likewise


gcc/fortran/ChangeLog

2009-04-21  Taras Glek <tglek@mozilla.com>

	* f95-lang.c: Update GTY annotations to new syntax
	* trans-intrinsic.c: Likewise
	* trans-io.c: Likewise
	* trans.h: Likewise


gcc/java/ChangeLog

2009-04-21  Taras Glek <tglek@mozilla.com>

	* builtins.c: Update GTY annotations to new syntax
	* decl.c: Likewise
	* java-tree.h: Likewise
	* jcf.h: Likewise
	* lang.c: Likewise


gcc/objc/ChangeLog

2009-04-21  Taras Glek <tglek@mozilla.com>

	* objc-act.c: Update GTY annotations to new syntax
	* objc-act.h: Likewise


libcpp/ChangeLog

2009-04-21  Taras Glek <tglek@mozilla.com>

	* include/cpp-id-data.h: Update GTY annotations to new syntax
	* include/cpplib.h: Likewise
	* include/line-map.h: Likewise
	* include/symtab.h: Likewise

From-SVN: r146607
2009-04-22 14:29:36 -04:00
Kazu Hirata 579e694c11 reginfo.c (cannot_change_mode_set_regs): Remove.
* reginfo.c (cannot_change_mode_set_regs): Remove.
	* rtl.h: Remove the prototype for cannot_change_mode_set_regs.

From-SVN: r146310
2009-04-18 11:45:08 +00:00
Kazu Hirata f57597d9d0 cfgrtl.c (delete_insn_chain_and_edges): Remove.
* cfgrtl.c (delete_insn_chain_and_edges): Remove.
	* rtl.h: Remove the prototype for delete_insn_chain_and_edges.

From-SVN: r146215
2009-04-16 18:51:51 +00:00
Kazu Hirata 43dd320186 emit-rtl.c (set_mem_attrs_from_reg): Remove.
* emit-rtl.c (set_mem_attrs_from_reg): Remove.
	* rtl.h: Remove the prototype for set_mem_attrs_from_reg.

From-SVN: r146212
2009-04-16 18:46:32 +00:00
Ian Lance Taylor efc0b2bd80 rtlanal.c (alloc_reg_note): New function, broken out of add_reg_note.
* rtlanal.c (alloc_reg_note): New function, broken out of
	add_reg_note.
	(add_reg_note): Call alloc_reg_note.
	* rtl.h (alloc_reg_note): Declare.
	* combine.c (try_combine): Use alloc_reg_note.
	(recog_for_combine, move_deaths): Likewise.
	(distribute_notes): Use alloc_reg_note and add_reg_note.
	* haifa-sched.c (sched_create_recovery_edges): Use add_reg_note.
	* combine-stack-adj.c (adjust_frame_related_expr): Likewise.
	* reload1.c (eliminate_regs_1): Use alloc_reg_note.

From-SVN: r146201
2009-04-16 16:08:04 +00:00
H.J. Lu c619e9823e jump.c (rtx_renumbered_equal_p): Use subreg_get_info.
2009-03-27  H.J. Lu  <hongjiu.lu@intel.com>

	* jump.c (rtx_renumbered_equal_p): Use subreg_get_info.
	(true_regnum): Likewise.

	* rtlanal.c (subreg_info): Moved to ...
	* rtl.h (subreg_info): Here.  New.
	(subreg_get_info): New.

	* rtlanal.c (subreg_get_info): Make it extern.

From-SVN: r145134
2009-03-27 15:25:36 -07:00
Jakub Jelinek 8f5929e11f dse.c (struct group_info): Reorder fields for 64-bit hosts.
* dse.c (struct group_info): Reorder fields for 64-bit hosts.
	* matrix-reorg.c (struct matrix_info): Likewise.
	* tree-ssa-loop-ivopts.c (struct ivopts_data): Likewise.
	* rtl.h (struct mem_attrs): Likewise.
	* df.h (struct df): Likewise.
	* tree-data-ref.h (struct data_dependence_relation): Likewise.
	* ira-int.h (struct ira_allocno): Likewise.
	* df-scan.c (struct df_collection_rec): Likewise.
	* ira.c (struct equivalence): Likewise.
	* function.c (struct temp_slot): Likewise.
	* cfgloop.h (struct loop): Likewise.

	* parser.c (struct cp_token): Reorder fields for 64-bit hosts.
	(eof_token): Adjust.

	* include/cpplib.h (struct cpp_dir): Reorder fields for 64-bit hosts.

From-SVN: r144938
2009-03-18 18:04:26 +01:00
Jakub Jelinek 66647d441f Update Copyright years for files modified in 2008 and/or 2009.
From-SVN: r144324
2009-02-20 16:20:38 +01:00
H.J. Lu 328e13b7d2 caller-save.c: Replace regclass.c with reginfo.c in comments.
2009-02-12  H.J. Lu  <hongjiu.lu@intel.com>

	* caller-save.c: Replace regclass.c with reginfo.c in comments.
	* recog.c: Likewise.
	* rtl.h: Likewise.

From-SVN: r144135
2009-02-12 10:32:16 -08:00
Paolo Bonzini 48e8382e95 re PR rtl-optimization/37889 (SEGV, conditional execution proactively executed the false arm.)
2009-02-04  Paolo Bonzini  <bonzini@gnu.org>
	    Hans-Peter Nilsson  <hp@axis.com>

	PR rtl-optimization/37889
	* rtlanal.c (rtx_addr_can_trap_p_1): Add offset and size arguments.
	Move offset handling from PLUS to before the switch.  Use new
	arguments when considering SYMBOL_REFs too.
	(rtx_addr_can_trap_p): Pass dummy offset and size.
	(enum may_trap_p_flags): Remove.
	(may_trap_p_1): Pass size from MEM_SIZE.

	PR rtl-optimization/38921
	* loop-invariant.c (find_invariant_insn): Use may_trap_or_fault_p.
	* rtl.h (may_trap_after_code_motion_p): Delete prototype.
	* rtlanal.c (may_trap_after_code_motion_p): Delete.
	(may_trap_p, may_trap_or_fault_p): Pass 0/1 as flags.


Co-Authored-By: Hans-Peter Nilsson <hp@axis.com>

From-SVN: r143939
2009-02-04 20:54:36 +00:00
Vladimir Makarov 2af2dbdc68 tm.texi (TARGET_IRA_COVER_CLASSES): Modify description.
2008-01-29  Vladimir Makarov  <vmakarov@redhat.com>

	* doc/tm.texi (TARGET_IRA_COVER_CLASSES): Modify description.
	* doc/passes.texi: Remove entries about regclass, local-alloc, and
	global.  Modify entries about regmove and IRA.

	* ra-conflict.c: Remove the file.

	* reload.c (push_reload, find_dummy_reload): Remove flag_ira.

	* tree-pass.h (pass_local_alloc, pass_global_alloc): Remove.
	(pass_regclass_init): Rename to pass_reginfo_init.

	* cfgloopanal.c (estimate_reg_pressure_cost): Remove flag_ira.

	* toplev.h (flag_ira): Remove.

	* caller-save.c (setup_save_areas): Remove flag_ira.

	* ira-color.c (ira_reuse_stack_slot, ira_mark_new_stack_slot):
	Ditto.

	* global.c: Remove the file.

	* opts.c: (decode_options): Remove flag_ira.

	* hard-reg-set.h (losing_caller_save_reg_set): Remove.

	* regmove.c: Modify file description.
	(find_use_as_address, try_auto_increment): Define them only if
	AUTO_INC_DEC is defined.
	(replacement_quality, replace_in_call_usage, fixup_match_1,
	stable_and_no_regs_but_for_p): Remove.
	(reg_set_in_bb): Make it static.
	(regmove_optimize): Remove flag_ira and code which worked for
	!flag_ira.

	* local-alloc.c: Remove the file.

	* common.opt (fira): Remove.

	* ira.c: Include except.h.
	(eliminable_regset): Move from global.c.
	(mark_elimination): Ditto.  Remove flag_ira.
	(reg_renumber, struct equivalence, reg_equiv, equiv_mem,
	equiv_mem_modified, validate_equiv_mem_from_store,
	validate_equiv_mem, equiv_init_varies_p, equiv_init_movable_p,
	contains_replace_regs, memref_referenced_p, memref_used_between_p,
	no_equiv, recorded_label_ref): Move from local-alloc.c.
	(update_equiv_regs): Ditto.  Make it static.
	(print_insn_chain, print_insn_chains): Move it from global.c.
	pseudo_for_reload_consideration_p): Ditto.  Remove flag_ira.
	(build_insn_chain): Ditto.  Make it static.
	(ra_init_live_subregs): Move from ra-conflict.c.  Make it static.
	Rename to init_live_subregs.
	(gate_ira): Remove flag_ira.

	* regclass.c: Rename reginfo.c.  Change file description.
	(FORBIDDEN_INC_DEC_CLASSES): Remove.
	(reg_class_superclasses, forbidden_inc_dec_class, in_inc_dec):
	Remove.
	(init_reg_sets_1): Remove code for evaluation of
	reg_class_superclasses and losing_caller_save_reg_set.
	(init_regs): Remove init_reg_autoinc.
	(struct costs, costs, init_cost, ok_for_index_p_nonstrict,
	ok_for_base_p_nonstrict): Remove.
	(regclass_init): Rename to reginfo_init.  Don't initialize
	init_cost.
	(pass_regclass_init): Rename to pass_reginfo_init.  Modify
	corresponding entries.
	(dump_regclass, record_operand_costs, scan_one_insn,
	init_reg_autoinc, regclass, record_reg_classes, copy_cost,
	record_address_regs, auto_inc_dec_reg_p): Remove.
	(gt-regclass.h): Rename to gt-reginfo.h.

	* rtl.h (dump_global_regs, retry_global_alloc,
	build_insn_chain, dump_local_alloc, update_equiv_regs):
	Remove.

	* Makefile.in (RA_H): Remove.
	(OBJS-common): Remove global.o, local-alloc.o, and ra-conflict.o.
	Rename regclass.o to reginfo.o.
	(regclass.o): Rename to reginfo.o.  Rename gt-regclass.h to
	gt-reginfo.h.
	(global.o, local-alloc.o, ra-conflict.o): Remove entries.
	(GTFILES): Rename regclass.c to	reginfo.c.

	* passes.c (init_optimization_passes): Remove pass_local_alloc and
	pass_global_alloc.  Rename pass_regclass_init to
	pass_reginfo_init.

	* reload1.c (compute_use_by_pseudos, reload, count_pseudo,
	count_spilled_pseudo, find_reg, alter_reg, delete_output_reload):
	Remove flag_ira.
	(finish_spills): Ditto.  Remove code for !flga_ira.

From-SVN: r143757
2009-01-29 14:51:46 +00:00
Vladimir Makarov f68211cd04 re PR c/38869 (valgrind find problem with -O -mtune=generic)
2009-01-19  Vladimir Makarov  <vmakarov@redhat.com>

	PR c/38869
	* rtl.h (reinit_regs): New prototype.
	* regclass.c: Include ira.h.
	(reinit_regs): New.
	* Makefile.in (regclass.o): Add ira.h.
	* config/i386/i386.c (ix86_maybe_switch_abi): Use reinit_regs.

From-SVN: r143498
2009-01-19 17:17:14 +00:00
Andrew Pinski c921bad877 invoke.texi (-mgen-cell-microcode): Document.
2008-10-13  Andrew Pinski  <andrew_pinski@playstation.sony.com>
            Kaushal Kantawala <Kaushal_Kantawala@playstation.sony.com>
            Trevor Smigiel  <Trevor_Smigiel@playstation.sony.com>
            Grace Cao  <grace_cao@playstation.sony.com>

        * doc/invoke.texi (-mgen-cell-microcode): Document.
        (-mwarn-cell-microcode): Document.
        * cfglayout.c (locator_location): Export.
        * rtl.h (locator_location): Define prototype.
        * config/rs6000/predicates.md (cc_reg_not_micro_cr0_operand): New predicate.
        * rs6000/rs6000-protos.h (rs6000_final_prescan_insn): Define prototype.
        * config/rs6000/rs6000.opt (mgen-cell-microcode): New option.
        (mwarn-cell-microcode): New option.
        * rs6000/rs6000.c (rs6000_cell_dont_microcode): Delete unused variable.
        (rs6000_override_options): Set rs6000_gen_cell_microcode if tuning for
        cell and not already set.
        Turn off string instructions if not generating cell microcode.
        (rs6000_final_prescan_insn): New function that warns about microcoded
        instructions.
        * config/rs6000/rs6000.h (FINAL_PRESCAN_INSN): Define.
        * config/rs6000/rs6000.md
        Replace cc_reg_not_cr0_operand with cc_reg_not_micro_cr0_operand if
        the instruction would have been microcoded on the Cell.
        Set cell_micro to always on unnamed patterns for the string instructions.
        (cell_micro): Update definition, remove load/store conditional microcoded.
        (sign_extend:DI): Define new pattern for non microcoded version.
        (sign_extend:SI): Likewise.
        (compare (div:P)): Set cell_micro to not.
        (andsi3): Define as an expand.
        (andsi3_mc): New pattern.
        (andsi3_nomc): New pattern.
        (andsi3_internal0_nomc): New pattern.
        (andsi3_internal2): Rename to ...
        (andsi3_internal2_mc): this and enable iff generating microcode.
        (andsi3_internal3): Rename to ...
        (andsi3_internal3_mc): this and enable iff generating microcode.
        (andsi3_internal4): Enable iif generating microcode.
        (andsi3_internal5): Rename to ..
        (andsi3_internal5_mc): this and enable iff generating microcode.
        (andsi3_internal5_nomc): New pattern.
        (extzvdi_internal1): Enable iff generating microcode.
        (extzvdi_internal2): Likewise.
        (rotlsi3_internal7): Set cell_micro to always if non immediate form.
        (anddi3): Change to expand.
        (anddi3_mc): Rename from anddi3.
        (anddi3_no_mc): New pattern.
        (anddi3_internal2): Rename to ..
        (anddi3_internal2_mc): this and enable iff generating microcode.
        (anddi3_internal2_nomc): New pattern.
        (anddi3_internal3): Rename to ..
        (anddi3_internal3_mc): this and enable iff generating microcode.
        (anddi3_internal3_nomc): New pattern.
        (movti_string): Set cell_micro to always if TARGET_STRING.
        (stmsi8): Set cell_micro to always.
        (stmsi7): Likewise.
        (stmsi6): Likewise.
        (stmsi5): Likewise.
        (stmsi4): Likewise.
        (stmsi3): Likewise.
        (stmsi8_power): Likewise.
        (stmsi7_power): Likewise.
        (stmsi6_power): Likewise.
        (stmsi5_power): Likewise.
        (stmsi4_power): Likewise.
        (stmsi3_power): Likewise.
        (movsi_update2): Enable iff generating microcode.
        (movhi_update3): Likewise.
        (lmw): Set cell_micro to always.



Co-Authored-By: Grace Cao <grace_cao@playstation.sony.com>
Co-Authored-By: Kaushal Kantawala <Kaushal_Kantawala@playstation.sony.com>
Co-Authored-By: Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>

From-SVN: r141094
2008-10-13 12:57:31 -07:00
Jakub Jelinek 1692ae7eda rtl.h (locator_eq): New decl.
* rtl.h (locator_eq): New decl.
	* cfglayout.c (locator_scope): New function.
	(insn_scope): Use it.
	(locator_eq): New function.
	(fixup_reorder_chain): Search for last insn in src bb
	that has locator set or first insn in dest bb.  Use
	locator_eq instead of == to compare locators.
	* cfgrtl.c (cfg_layout_merge_blocks): Likewise.
	* cfgcleanup.c (try_forward_edges): Use locator_eq instead of
	== to compare locators.

From-SVN: r141009
2008-10-09 22:04:10 +02:00
Jan Hubicka 825b2fe7a8 function.c (free_after_compilation): Call insn_locators_free.
* function.c (free_after_compilation): Call insn_locators_free.
	* cfglayout.c (insn_locators_free): New function.
	* rtl.h (insn_locators_free): Declare.

From-SVN: r140279
2008-09-11 12:31:40 +00:00
Ian Lance Taylor e0c68ce9d2 rtl.h (LABEL_REF_NONLOCAL_P): Don't check for REG_LABEL_OPERAND or REG_LABEL_TARGET.
./:	* rtl.h (LABEL_REF_NONLOCAL_P): Don't check for REG_LABEL_OPERAND
	or REG_LABEL_TARGET.
	* calls.c (emit_library_call_value_1): Use MEM_P rather than
	comparing MODE with MEM.
	* gimple.c (gimple_build_predict): Cast END_PREDICTORS before
	comparing with GF_PREDICT_TAKEN.
	(gimple_get_lhs): Change code to enum gimple_code.
	(gimple_set_lhs): Likewise.
	* ifcvt.c (noce_process_if_block): Correct GET_MODE to GET_CODE.
	* omp-low.c (find_omp_clause): Change kind parameter to enum
	omp_clause_code.
	* tree-flow.h (find_omp_clause): Update declaration.
	* regrename.c (clear_dead_regs): Change kind parameter to enum
	reg_note.
	* reload1.c (eliminate_regs_1): Use REG_NOTE_KIND rather than
	GET_MODE.
	* see.c (see_get_extension_data): Change return type to enum
	entry_type.  Change UNKNOWN to NOT_RELEVANT, SIGN_EXTEND to
	SIGNED_EXTENDED_DEF, ZERO_EXTEND to ZERO_EXTENDED_DEF.
	(see_gen_normalized_extension): Change extension_code parameter to
	enum entry_type.
	(see_seek_pre_extension_expr): Change extension_code to enum
	entry_type.
	(see_merge_one_def_extension): Likewise.
	(see_handle_relevant_defs): Likewise.
	(see_handle_relevant_uses): Likewise.
	(see_analyze_one_def): Likewise.
	* tree-cfg.c (need_fake_edge_p): Compare gimple code with
	GIMPLE_ASM rather than ASM_EXPR.
	* tree-ssa-alias.c (is_escape_site): Compare gimple code with
	GIMPLE_RETURN rather than RETURN_EXPR.
	* tree-ssa-ccp.c (likely_value): Change code to enum gimple_code.
	(evaluate_stmt): Likewise.
	* tree-vect-analyze.c (vect_analyze_operations): Change relevance
	to enum vect_relevant.
	(vect_mark_stmts_to_be_vectorized): Change assertion to not
	compare gimple codes with tree codes.
cp/:
	* parser.c (check_no_duplicate_clause): Change code parameter to
	enum omp_clause_code.
fortran/:
	* symbol.c (generate_isocbinding_symbol): Compare
	gfc_notification_std with ERROR rather than FAILURE.
	* resolve.c (check_assumed_size_reference): Compare array type
	with AR_FULL rather than DIMEN_ELEMENT.
	(resolve_actual_arglist): Compare with EXPR_VARIABLE rather than
	FL_VARIABLE.

From-SVN: r139991
2008-09-04 17:32:38 +00:00
Andrey Belevantsev e855c69d16 sel-sched.h, [...]: New files.
2008-08-31  Andrey Belevantsev  <abel@ispras.ru>
        Dmitry Melnik  <dm@ispras.ru>
        Dmitry Zhurikhin  <zhur@ispras.ru>
        Alexander Monakov  <amonakov@ispras.ru>
        Maxim Kuvyrkov  <maxim@codesourcery.com>

	* sel-sched.h, sel-sched-dump.h, sel-sched-ir.h, sel-sched.c,
	sel-sched-dump.c, sel-sched-ir.c: New files.
	* Makefile.in (OBJS-common): Add selective scheduling object
	files.
	(sel-sched.o, sel-sched-dump.o, sel-sched-ir.o): New entries.
	(SEL_SCHED_IR_H, SEL_SCHED_DUMP_H): New entries.
	(sched-vis.o): Add dependency on $(INSN_ATTR_H).
	* cfghooks.h (get_cfg_hooks, set_cfg_hooks): New prototypes.
	* cfghooks.c (get_cfg_hooks, set_cfg_hooks): New functions.
	(make_forwarder_block): Update loop latch if we have redirected
	the loop latch edge.
	* cfgloop.c (get_loop_body_in_custom_order): New function.
	* cfgloop.h (LOOPS_HAVE_FALLTHRU_PREHEADERS): New enum field.
	(CP_FALLTHRU_PREHEADERS): Likewise.
	(get_loop_body_in_custom_order): Declare.
	* cfgloopmanip.c (has_preds_from_loop): New.
	(create_preheader): Honor CP_FALLTHRU_PREHEADERS.
	Assert that the preheader edge will be fall thru when it is set.
	* common.opt (fsel-sched-bookkeeping, fsel-sched-pipelining,
	fsel-sched-pipelining-outer-loops, fsel-sched-renaming,
	fsel-sched-substitution, fselective-scheduling): New flags.
    	* cse.c (hash_rtx_cb): New.
	(hash_rtx): Use it.
	* dbgcnt.def (sel_sched_cnt, sel_sched_region_cnt,
	sel_sched_insn_cnt): New counters. 
	* final.c (compute_alignments): Export.  Free dominance info after loop_optimizer_finalize.
	* genattr.c (main): Output maximal_insn_latency prototype.
	* genautomata.c (output_default_latencies): New. Factor its code from ...
	(output_internal_insn_latency_func): ... here.
	(output_internal_maximal_insn_latency_func): New.
	(output_maximal_insn_latency_func): New.
	* hard-reg-set.h (UHOST_BITS_PER_WIDE_INT): Define unconditionally.
	(struct hard_reg_set_iterator): New.
	(hard_reg_set_iter_init, hard_reg_set_iter_set,
	hard_reg_set_iter_next): New functions.
	(EXECUTE_IF_SET_IN_HARD_REG_SET): New macro.
	* lists.c (remove_free_INSN_LIST_node,
	remove_free_EXPR_LIST_node): New functions.
	* loop-init.c (loop_optimizer_init): When LOOPS_HAVE_FALLTHRU_PREHEADERS,
	set CP_FALLTHRU_PREHEADERS when calling create_preheaders.
	(loop_optimizer_finalize): Do not verify flow info after reload.
	* recog.c (validate_replace_rtx_1): New parameter simplify.
	Default it to true.  Update all uses.  Factor out simplifying
	code to ...
	(simplify_while_replacing): ... this new function.
	(validate_replace_rtx_part,
	validate_replace_rtx_part_nosimplify): New.
	* recog.h (validate_replace_rtx_part,
	validate_replace_rtx_part_nosimplify): Declare.
	* rtl.c (rtx_equal_p_cb): New.
	(rtx_equal_p): Use it.
	* rtl.h (rtx_equal_p_cb, hash_rtx_cb): Declare.
	(remove_free_INSN_LIST_NODE, remove_free_EXPR_LIST_node,
	debug_bb_n_slim, debug_bb_slim,    print_rtl_slim): Likewise.
	* vecprim.h: Add a vector type for unsigned int. 
	* haifa-sched.c: Include vecprim.h and cfgloop.h.
	(issue_rate, sched_verbose_param, note_list, dfa_state_size,
	ready_try, cycle_issued_insns, spec_info): Make global.
	(readyp): Initialize.
	(dfa_lookahead): New global variable.
	(old_max_uid, old_last_basic_block): Remove.
	(h_i_d): Make it a vector.
	(INSN_TICK, INTER_TICK, QUEUE_INDEX, INSN_COST): Make them work
	through HID macro.
	(after_recovery, adding_bb_to_current_region_p):
	New variables to handle correct insertion of the recovery code.
	(struct ready_list): Move declaration to sched-int.h.
	(rgn_n_insns): Removed.
	(rtx_vec_t): Move to sched-int.h.
	(find_insn_reg_weight): Remove.
	(find_insn_reg_weight1): Rename to find_insn_reg_weight.
	(haifa_init_h_i_d, haifa_finish_h_i_d):
	New functions to initialize / finalize haifa instruction data.
	(extend_h_i_d, init_h_i_d): Rewrite.
	(unlink_other_notes): Move logic to add_to_note_list.  Handle
	selective scheduler.
	(ready_lastpos, ready_element, ready_sort, reemit_notes,
	find_fallthru_edge): Make global, remove static prototypes.
	(max_issue): Make global.  Add privileged_n and state parameters.  Use
	them.  
	(extend_global, extend_all): Removed.
	(init_before_recovery): Add new param.  Fix the handling of the case
	when we insert a recovery code before the EXIT which has a predecessor
	with a fallthrough edge to it.
	(create_recovery_block): Make global.  Rename to
	sched_create_recovery_block.  Update.
	(change_pattern): Rename to sched_change_pattern.  Make global.
	(speculate_insn): Rename to sched_speculate_insn.  Make global.
	Split haifa-specific functionality into ...
	(haifa_change_pattern): New static function.
	(sched_extend_bb): New static function.
	(sched_init_bbs): New function.
	(current_sched_info): Change type to struct haifa_sched_info.
	(insn_cost): Adjust for selective scheduling.
	(dep_cost_1): New function.  Move logic from ...
	(dep_cost): ... here.
	(dep_cost): Use dep_cost_1.
	(contributes_to_priority_p): Use sched_deps_info instead of
	current_sched_info.
	(priority): Adjust to work with selective scheduling.  Process the
	corner case when all dependencies don't contribute to priority.
	(rank_for_schedule): Use ds_weak instead of dep_weak.
	(advance_state): New function.  Move logic from ...
	(advance_one_cycle): ... here.
	(add_to_note_list, concat_note_lists): New functions.
	(rm_other_notes): Make static.  Adjust for selective scheduling.
	(remove_notes, restore_other_notes): New functions.
	(move_insn): Add two arguments.  Update assert.  Don't call
	reemit_notes.
	(choose_ready): Remove lookahead variable, use dfa_lookahead.
	Remove more_issue, max_points.  Move the code to initialize
	max_lookahead_tries to max_issue.
	(schedule_block): Remove rgn_n_insns1 parameter.  Don't allocate
	ready.  Adjust use of move_insn.  Call restore_other_notes.
	(luid): Remove.
	(sched_init, sched_finish): Move Haifa-specific initialization/
	finalization to ...
	(haifa_sched_init, haifa_sched_finish): ... respectively.
	New functions.
	(setup_sched_dump): New function.
	(haifa_init_only_bb): New static function.
	(haifa_speculate_insn): New static function.
	(try_ready): Use haifa_* instead of speculate_insn and
	change_pattern.
	(extend_ready, extend_all): Remove.
	(sched_extend_ready_list, sched_finish_ready_list): New functions.
	(create_check_block_twin, add_to_speculative_block): Use
	haifa_insns_init instead of extend_global.  Update to use new
	initialization functions.  Change parameter.  Factor out code from
	create_check_block_twin to ...
	(sched_create_recovery_edges) ... this new function.
	(add_block): Remove.
	(sched_scan_info): New.
	(extend_bb): Use sched_scan_info.
	(init_bb, extend_insn, init_insn, init_insns_in_bb, sched_scan): New
	static functions for walking through scheduling region.
	(sched_luids): New vector variable to replace uid_to_luid.
	(luids_extend_insn): New function.
	(sched_max_luid): New variable.
	(luids_init_insn): New function.
	(sched_init_luids, sched_finish_luids): New functions.
	(insn_luid): New debug function.
	(sched_extend_target): New function.
	(haifa_init_insn): New static function.
	(sched_init_only_bb): New hook.
	(sched_split_block): New hook.
	(sched_split_block_1): New function.
	(sched_create_empty_bb): New hook.
	(sched_create_empty_bb_1): New function.	
	(common_sched_info, ready): New global variables.
	(current_sched_info_var): Remove.
	(move_block_after_check): Use common_sched_info.		
	(haifa_luid_for_non_insn): New static function.	
	(init_before_recovery): Use haifa_init_only_bb instead of
	add_block.
	(increase_insn_priority): New.
	* modulo-sched.c: (issue_rate): Remove static declaration.
	(sms_sched_info): Change type to haifa_sched_info.
	(sms_sched_deps_info, sms_common_sched_info): New variables.
	(setup_sched_infos): New.
	(sms_schedule): Initialize them.  Call haifa_sched_init/finish.
	Do not call regstat_free_calls_crossed.
	(sms_print_insn): Use const_rtx.
	* params.def (PARAM_MAX_PIPELINE_REGION_BLOCKS,
	PARAM_MAX_PIPELINE_REGION_INSNS, PARAM_SELSCHED_MAX_LOOKAHEAD,
	PARAM_SELSCHED_MAX_SCHED_TIMES, PARAM_SELSCHED_INSNS_TO_RENAME,
	PARAM_SCHED_MEM_TRUE_DEP_COST): New.
	* sched-deps.c (sched_deps_info): New.  Update all relevant uses of
	current_sched_info to use it.
	(enum reg_pending_barrier_mode): Move to sched-int.h.
	(h_d_i_d): New variable. Initialize to NULL.
	({true, output, anti, spec, forward}_dependency_cache): Initialize
	to NULL.
	(estimate_dep_weak): Remove static declaration.
	(sched_has_condition_p): New function.  Adjust users of
	sched_get_condition to use it instead.
	(conditions_mutex_p): Add arguments indicating which conditions are
	reversed.  Use them.
	(sched_get_condition_with_rev): Rename from sched_get_condition.  Add
	argument to indicate whether returned condition is reversed.  Do not
	generate new rtx when condition should be reversed; indicate it by
	setting new argument instead.
	(add_dependence_list_and_free): Add deps parameter.
	Update all users.  Do not free dependence list when
	deps context is readonly.
	(add_insn_mem_dependence, flush_pending_lists): Adjust for readonly
	contexts.
	(remove_from_dependence_list, remove_from_both_dependence_lists): New.
	(remove_from_deps): New. Use the above functions.	
	(cur_insn, can_start_lhs_rhs_p): New static variables.
	(add_or_update_back_dep_1): Initialize present_dep_type.
	(haifa_start_insn, haifa_finish_insn, haifa_note_reg_set,
	haifa_note_reg_clobber, haifa_note_reg_use, haifa_note_mem_dep,
	haifa_note_dep): New functions implementing dependence hooks for
	the Haifa scheduler.
	(note_reg_use, note_reg_set, note_reg_clobber, note_mem_dep,
	note_dep): New functions.
	(ds_to_dt, extend_deps_reg_info, maybe_extend_reg_info_p): New
	functions.
	(init_deps): Initialize last_reg_pending_barrier and deps->readonly.
	(free_deps): Initialize deps->reg_last.
	(sched_analyze_reg, sched_analyze_1, sched_analyze_2,
	sched_analyze_insn): Update to use dependency hooks infrastructure
	and readonly contexts.
	(deps_analyze_insn): New function.  Move part of logic from ...
	(sched_analyze): ... here.  Also move some logic to ...
	(deps_start_bb): ... here.  New function.
	(add_forw_dep, delete_forw_dep): Guard use of INSN_DEP_COUNT with
	sel_sched_p.
	(sched_deps_init): New function.  Move code from ...
	(init_dependency_caches): ... here.  Remove.
	(init_deps_data_vector): New.
	(sched_deps_finish): New function.  Move code from ...
	(free_dependency_caches): ... here.  Remove.
	(init_deps_global, finish_deps_global): Adjust for use with
	selective scheduling.
	(get_dep_weak): Move logic to ...
	(get_dep_weak_1): New function.
	(ds_merge): Move logic to ...
	(ds_merge_1): New static function.
	(ds_full_merge, ds_max_merge, ds_get_speculation_types): New functions.
	(ds_get_max_dep_weak): New function.
	* sched-ebb.c (sched_n_insns): Rename to sched_rgn_n_insns.
	(n_insns): Rename to rgn_n_insns.
	(debug_ebb_dependencies): New function.
	(init_ready_list): Use it.
	(begin_schedule_ready): Use sched_init_only_bb.
	(ebb_print_insn): Indicate when an insn starts a new cycle.
	(contributes_to_priority, compute_jump_reg_dependencies,
	add_remove_insn, fix_recovery_cfg): Add ebb_ prefix to function names.
	(add_block1): Remove to ebb_add_block.
	(ebb_sched_deps_info, ebb_common_sched_info): New variables.
	(schedule_ebb): Initialize them.  Use remove_notes instead of
	rm_other_notes.  Use haifa_local_init/finish.
	(schedule_ebbs): Use haifa_sched_init/finish.
	* sched-int.h: Include vecprim.h, remove rtl.h.
	(struct ready_list): Delete declaration.
	(sched_verbose_param, enum sched_pass_id_t,
	bb_vec_t, insn_vec_t, rtx_vec_t): New.
	(struct sched_scan_info_def): New structure.
	(sched_scan_info, sched_scan, sched_init_bbs,
	sched_init_luids, sched_finish_luids, sched_extend_target,
	haifa_init_h_i_d, haifa_finish_h_i_d): Declare.
	(struct common_sched_info_def): New.
	(common_sched_info, haifa_common_sched_info,
	sched_emulate_haifa_p): Declare.
	(sel_sched_p): New.
	(sched_luids): Declare.
	(INSN_LUID, LUID_BY_UID, SET_INSN_LUID): Declare.
	(sched_max_luid, insn_luid): Declare.
	(note_list, remove_notes, restore_other_notes, bb_note): Declare.
	(sched_insns_init, sched_insns_finish, xrecalloc, reemit_notes,
	print_insn, print_pattern, print_value, haifa_classify_insn,
	sel_find_rgns, sel_mark_hard_insn, dfa_state_size, advance_state,
	setup_sched_dump, sched_init, sched_finish,
	sel_insn_is_speculation_check): Export.
	(struct ready_list): Move from haifa-sched.c.
	(ready_try, ready, max_issue): Export.
	(ebb_compute_jump_reg_dependencies, find_fallthru_edge,
	sched_init_only_bb, sched_split_block, sched_split_block_1,
	sched_create_empty_bb, sched_create_empty_bb_1,
	sched_create_recovery_block, sched_create_recovery_edges): Export.
	(enum reg_pending_barrier_mode): Export.
	(struct deps): New fields `last_reg_pending_barrier' and `readonly'.
	(deps_t): New.
	(struct sched_info): Rename to haifa_sched_info.  Use const_rtx for
	print_insn field.  Move add_block and fix_recovery_cfg to
	common_sched_info_def.  Move compute_jump_reg_dependencies, use_cselib  ...
	(struct sched_deps_info_def): ... this new structure.
	(sched_deps_info): Declare.
	(struct spec_info_def): Remove weakness_cutoff, add
	data_weakness_cutoff and control_weakness_cutoff.
	(spec_info): Declare.
	(struct _haifa_deps_insn_data): Split from haifa_insn_data.  Add
	dep_count field.
	(struct haifa_insn_data): Rename to struct _haifa_insn_data.
	(haifa_insn_data_def, haifa_insn_data_t): New typedefs.
	(current_sched_info): Change type to struct haifa_sched_info.
	(haifa_deps_insn_data_def, haifa_deps_insn_data_t): New typedefs.
	(h_d_i_d): New variable.
	(HDID): New accessor macro.
	(h_i_d): Change type to VEC (haifa_insn_data_def, heap) *.
	(HID): New accessor macro.  Rewrite h_i_d accessor macros through HID
	and HDID.
	(IS_SPECULATION_CHECK_P): Update for selective scheduler.
	(enum SCHED_FLAGS): Update for selective scheduler.
	(enum SPEC_SCHED_FLAGS): New flag SEL_SCHED_SPEC_DONT_CHECK_CONTROL.
	(init_dependency_caches, free_dependency_caches): Delete declarations.
	(deps_analyze_insn, remove_from_deps, get_dep_weak_1,
	estimate_dep_weak, ds_full_merge, ds_max_merge, ds_weak,
	ds_get_speculation_types, ds_get_max_dep_weak, sched_deps_init,
	sched_deps_finish, haifa_note_reg_set, haifa_note_reg_use,
	haifa_note_reg_clobber, maybe_extend_reg_info_p, deps_start_bb,
	ds_to_dt): Export.
	(rm_other_notes): Delete declaration.
	(schedule_block): Remove one argument.
	(cycle_issued_insns, issue_rate, dfa_lookahead, ready_sort,
	ready_element, ready_lastpos, sched_extend_ready_list,
	sched_finish_ready_list, sched_change_pattern, sched_speculate_insn,
	concat_note_lists): Export.
	(struct region): Move from sched-rgn.h.
	(nr_regions, rgn_table, rgn_bb_table, block_to_bb, containing_rgn,
	RGN_NR_BLOCKS, RGN_BLOCKS, RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB,
	BLOCK_TO_BB, CONTAINING_RGN): Export.
	(ebb_head, BB_TO_BLOCK, EBB_FIRST_BB, EBB_LAST_BB, INSN_BB): Likewise.
	(current_nr_blocks, current_blocks, target_bb): Likewise.
	(dep_cost_1, sched_is_disabled_for_current_region_p, sched_rgn_init,
	sched_rgn_finish, rgn_setup_region, sched_rgn_compute_dependencies,
	sched_rgn_local_init, extend_regions,
	rgn_make_new_region_out_of_new_block, compute_priorities,
	debug_rgn_dependencies, free_rgn_deps, contributes_to_priority,
	extend_rgns, deps_join rgn_setup_common_sched_info,
	rgn_setup_sched_infos, debug_regions, debug_region, dump_region_dot,
	dump_region_dot_file, haifa_sched_init, haifa_sched_finish): Export.
	(get_rgn_sched_max_insns_priority, sel_add_to_insn_priority, 
	increase_insn_priority): Likewise.
	* sched-rgn.c: Include sel-sched.h.
	(ref_counts): New static variable.  Use it ...
	(INSN_REF_COUNT): ... here.  Rewrite and move closer to uses.
	(FED_BY_SPEC_LOAD, IS_LOAD_INSN): Rewrite to use HID accessor macro.
	(sched_is_disabled_for_current_region_p): Delete static declaration.
	(struct region): Move to sched-int.h.
	(nr_regions, rgn_table, rgn_bb_table, block_to_bb, containing_rgn,
	ebb_head): Define and initialize.
	(RGN_NR_BLOCKS, RGN_BLOCKS, RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB,
	BLOCK_TO_BB, CONTAINING_RGN, debug_regions, extend_regions,
	BB_TO_BLOCK, EBB_FIRST_BB, EBB_LAST_BB): Move to
	sched-int.h.
	(find_single_block_region): Add new argument to indicate that EBB
	regions should be constructed.
	(debug_live): Delete declaration.
	(current_nr_blocks, current_blocks, target_bb): Remove static qualifiers.
	(compute_dom_prob_ps, check_live, update_live, set_spec_fed): Delete
	declaration.
	(init_regions): Delete declaration.
	(debug_region, bb_in_region_p, dump_region_dot_file, dump_region_dot,
	rgn_estimate_number_of_insns): New.
	(too_large): Use estimate_number_of_insns.
	(haifa_find_rgns): New. Move the code from ...
	(find_rgns): ... here.  Call either sel_find_rgns or haifa_find_rgns.
	(free_trg_info): New.
	(compute_trg_info): Allocate candidate tables here instead of ...
	(init_ready_list): ... here.
	(rgn_print_insn): Use const_rtx.
	(contributes_to_priority, extend_regions): Delete static declaration.
	(add_remove_insn, fix_recovery_cfg): Add rgn_ to function names.
	(add_block1): Rename to rgn_add_block.
	(debug_rgn_dependencies): Delete static qualifier.
	(new_ready): Use sched_deps_info.  Simplify.
	(rgn_common_sched_info, rgn_const_sched_deps_info,
	rgn_const_sel_sched_deps_info, rgn_sched_deps_info, rgn_sched_info): New.
	(region_sched_info): Rename to rgn_const_sched_info.
	(deps_join): New, extracted from ...
	(propagate_deps): ... here.
	(compute_block_dependences, debug_dependencies): Update for selective
	scheduling.
	(free_rgn_deps, compute_priorities): New functions.
	(sched_rgn_init, sched_rgn_finish, rgn_setup_region,
	sched_rgn_compute_dependencies): New functions.
	(schedule_region): Use them.
	(sched_rgn_local_init, sched_rgn_local_free, sched_rgn_local_finish,
	rgn_setup_common_sched_info, rgn_setup_sched_infos):
	New functions.
	(schedule_insns): Call new functions that were split out.
	(rgn_make_new_region_out_of_new_block): New.
	(get_rgn_sched_max_insns_priority): New.
	(rest_of_handle_sched, rest_of_handle_sched2): Call selective
	scheduling when appropriate.
	* sched-vis.c: Include insn-attr.h.
	(print_value, print_pattern): Make global.
	(print_rtl_slim, debug_bb_slim, debug_bb_n_slim): New functions.
	* target-def.h (TARGET_SCHED_ADJUST_COST_2,
	TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT,
	TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT,
	TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_CHECKED_DS,
	TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_SKIP_RTX_P): New target
	hooks.  Initialize them to 0.
	(TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK.
	* target.h (struct gcc_target): Add them.  Rename gen_check field to
	gen_spec_check.
	* flags.h (sel_sched_switch_set): Declare.
	* opts.c (sel_sched_switch_set): New variable.
	(decode_options): Unset flag_sel_sched_pipelining_outer_loops if
	pipelining is disabled from command line.
	(common_handle_option): Record whether selective scheduling is
	requested from command line.
	* doc/invoke.texi: Document new flags and parameters.
	* doc/tm.texi: Document new target hooks.
	* config/ia64/ia64.c (TARGET_SCHED_GEN_SPEC_CHECK): Define to ia64_gen_check.
	(dfa_state_size): Do not declare locally.
	* config/ia64/ia64.opt (msched-ar-data-spec): Default to 0.
	* config/rs6000/rs6000.c (rs6000_init_sched_context,
	rs6000_alloc_sched_context, rs6000_set_sched_context,
	rs6000_free_sched_context): New functions.
	(struct _rs6000_sched_context): New.
	(rs6000_sched_reorder2): Do not modify INSN_PRIORITY for selective
	scheduling.
	(rs6000_sched_finish): Do not run for selective scheduling. 

Co-Authored-By: Alexander Monakov <amonakov@ispras.ru>
Co-Authored-By: Dmitry Melnik <dm@ispras.ru>
Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru>
Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com>

From-SVN: r139854
2008-09-01 12:57:00 +04:00
Jan Hubicka f40751dd34 fwprop.c (should_replace_address): Add speed attribute.
* fwprop.c (should_replace_address): Add speed attribute.
	(PR_OPTIMIZE_FOR_SPEED): New flag.
	(propagate_rtx_1): Use it.
	(propagate_rtx): Set it.
	(try_fwprop_subst): Update call of rtx_costs.
	(forward_propagate_and_simplify): LIkewise.
	* hooks.c (hook_int_rtx_bool_0): New
	(hook_bool_rtx_int_int_intp_false): Replace by ...
	(hook_bool_rtx_int_int_intp_bool_false): .. thisone.
	* hooks.h (hook_int_rtx_bool_0): New
	(hook_bool_rtx_int_int_intp_false): Replace by ...
	(hook_bool_rtx_int_int_intp_bool_false): .. thisone.
	* optabs.c (avoid_expensive_constant): UPdate call of rtx_cost.
	(prepare_cmp_insn): UPdate call of rtx_cost.
	* postreload.c (reload_cse_simplify_set): Update call of rtx_cost.
	(reload_cse_simplify_operands): Update call of rtx_cost.
	(reload_cse_move2add): call of rtx_cost.
	* target.h (struct gcc_target): Update rtx_costs and address_costs.
	* rtlanal.c (rtx_cost): Add speed argument.
	(address_cost): Add speed argument
	(default_address_cost): Likewise.
	(insn_rtx_cost): Likewise.
	* cfgloopanal.c (seq_cost): Add speed argument.
	(target_reg_cost, target_spill_cost): Turn to array.
	(init_set_costs): Update for speed.
	(estimate_reg_pressure_cost): Add speed argument.
	* auto-inc-dec.c (attempt_change): Update call of rtx_cost.
	* dojump.c (prefer_and_bit_test): UPdate call of rtx_cost.
	* tree-ssa-loop-ivopts.c (struct ivopts_data): New field speed.
	(seq_cost): Add speed argument.
	(computation_cost): Add speed arugment.
	(add_cost, multiply_by_const, get_address_cost): add speed argument.
	(force_expr_to_var_cost): Update for profile info.
	(force_var_cost): Likewise.
	(split_address_cost): Likewise.
	(ptr_difference_cost): Likewise.
	(difference_cost): Likewise.
	(get_computation_cost_at): Likewise.
	(determine_iv_cost): Likewise.
	(ivopts_global_cost_for_size): Likewise.
	(rewrite_use_address): Likewise.
	(tree_ssa_iv_optimize_loop): Initialize speed field.
	* cse.c (optimize_this_for_speed_p): New static var.
	(notreg_cost): Update call of rtx_cost.
	(cse_extended_basic_block): set optimize_this_for_speed_p.
	* ifcvt.c (cheap_bb_rtx_cost_p): Update call of rtx_cost.
	(noce_try_cmove_arith): Likewise.
	(noce_try_sign_mask): LIkewise.
	* expr.c (compress_float_constant): Update rtx_cost calls.
	* tree-ssa-address.c (most_expensive_mult_to_index): Add speed argument.
	(addr_to_parts): Likewise.
	(create_mem_ref): Likewise.
	* dse.c (find_shift_sequence): Add speed argument.
	(replace_read): Update call.
	* calls.c (precompute_register_parameters): Update call of rtx_cost.
	* expmed.c (sdiv_pow2_cheap, smod_pow2_cheap, zero_cost, add_cost,
	* neg_cost, shift_cost, shiftadd_cost,
	shiftsub_cost, mul_cost, sdiv_cost, udiv_cost ,mul_widen_cost,
	mul_highpart_cost): Increase dimension.
	(init_expmed): Initialize for both size and speed.
	(expand_shift): Use profile.
	(synth_mult): Use profile.
	(choose_mult_variant): Use profile.
	(expand_mult): Use profile.
	(expand_mult_highpart_optab): Use profile.
	(expand_mult_highpart): Use profile.
	(expand_smod_pow2): Use profile.
	(expand_divmod): Use profile.
	* simplify-rtx.c (simplify_binary_operation_1): Update call of rtx_cost.
	* loop-invariant.c (create_new_invariant): Use profile.
	(gain_for_invariant): Add speed parameter.
	(best_gain_for_invariant): Likewise.
	(find_invariants_to_move): Likewise.
	(move_single_loop_invariants): Set it.
	* target-def.h (TARGET_RTX_COSTS): Use hook.
	* rtl.h (rtx_cost, address_cost, insn_rtx_cost): Update prototpe.
	(optimize_insn_for_size_p, optimize_insn_for_speed_p): Declare.
	* output.h (default_address_cost): Update prototype.
	* combine.c (optimize_this_for_speed_p): New static var.
	(combine_validate_cost): Update call of rtx_cost.
	(combine_instructions): Set optimize_this_for_speed_p.
	(expand_compound_operation): Update call of rtx_cost.
	(make_extraction):Update call of rtx_cost.
	(force_to_mode):Update call of rtx_cost.
	(distribute_and_simplify_rtx):Update call of rtx_cost.
	* cfgloop.h (target_reg_cost, target_spill_cost): Turn to array.
	(estimate_reg_pressure_cost): Update prototype.
	* tree-flow.h (multiply_by_cost, create_mem_ref): Update prototype.
	* basic-block.h (optimize_insn_for_size_p, optimize_insn_for_speed_p):
	Remove.
	* config/alpha/alpha.c (alpha_rtx_costs): Update.
	(alpha_rtx_costs): Update.
	* config/frv/frv.c (frv_rtx_costs): Update.
	* config/s390/s390.c (s390_rtx_costs): Update.
	* config/m32c/m32c.c (m32c_memory_move_cost): Update.
	(m32c_rtx_costs): Update.
	* config/spu/spu.c (TARGET_ADDRESS_COST): Upate.
	(spu_rtx_costs): Update.
	* config/sparc/sparc.c (sparc_rtx_costs): Update.
	* config/m32r/m32r.c (m32r_rtx_costs): Update.
	* config/i386/i386.c (:ix86_address_cost): Update.
	(ix86_rtx_costs): Update.
	* config/sh/sh.c (sh_rtx_costs, sh_address_cost): Update.
	* config/pdp11/pdp11.c (pdp11_rtx_costs): Update.
	* config/avr/avr.c (avr_rtx_costs, avr_address_cost): Update.
	* config/crx/crx.c (crx_address_cost): Update.
	* config/xtensa/xtensa.c (xtensa_rtx_costs): Update.
	* config/stormy16/stormy16.c
	(xstormy16_address_cost, xstormy16_rtx_costs): Update.
	* config/m68hc11/m68hc11.c
	(m68hc11_address_cost, m68hc11_rtx_costs): Update.
	* config/cris/cris.c (cris_rtx_costs, cris_address_cost): Update.
	* config/iq2000/iq2000.c (iq2000_rtx_costs, iq2000_address_cost): Update.
	* config/mn10300/mn10300.c (mn10300_address_cost, mn10300_rtx_costs): Update
	* config/ia64/ia64.c (ia64_rtx_costs): Update.
	* config/m68k/m68k.c (m68k_rtx_costs): Update.
	* config/rs6000/rs6000.c (rs6000_rtx_costs): Update.
	* config/arc/arc.c (arc_rtx_costs, arc_address_cost): Update.
	* config/mcore/mcore.c (TARGET_ADDRESS_COST): Update.
	(mcore_rtx_costs): update.
	* config/score/score3.c (score3_rtx_costs): Update.
	* config/score/score7.c (score7_rtx_costs): Update.
	* config/score/score3.h (score3_rtx_costs):Update.
	* config/score/score7.h (score7_rtx_costs): Update.
	* config/score/score.c (score_rtx_costs): Update.
	* config/arm/arm.c (arm_address_cost): Update.
	(arm_rtx_costs_1): Update.
	(arm_rtx_costs_1): Update.
	(arm_size_rtx_costs): Update.
	(arm_size_rtx_costs): Update.
	(arm_size_rtx_costs): Update.
	(arm_xscale_rtx_costs): Update.
	(arm_thumb_address_cost): Update.
	* config/pa/pa.c (hppa_address_cost): Update.
	* config/mips/mips.c (mips_rtx_costs): Update.
	* config/vax/vax.c (vax_address_cost): Update.
	* config/h8300/h8300.c (h8300_shift_costs): Update.
	(h8300_rtx_costs): Update.
	* config/v850/v850.c (TARGET_ADDRESS_COST): Update.
	(v850_rtx_costs): Update.
	* config/mmix/mmix.c (mmix_rtx_costs, mmix_rtx_costs): Update.
	* config/bfin/bfin.c
	(bfin_address_cost): Update.
	(bfin_rtx_costs): Update.
	* stmt.c (lshift_cheap_p): Update.

From-SVN: r139821
2008-08-31 09:44:25 +00:00
Richard Sandiford eef302d277 rtl.h (simplify_subreg_regno): Declare.
gcc/
	* rtl.h (simplify_subreg_regno): Declare.
	* rtlanal.c (simplify_subreg_regno): New function, split out from...
	* simplify-rtx.c (simplify_subreg): ...here.
	* reload.c (find_reloads): Use simplify_subreg_regno instead of
	subreg_offset_representable_p.

From-SVN: r139736
2008-08-28 20:02:54 +00:00
Vladimir Makarov 058e97ecf3 [multiple changes]
2008-08-26  Vladimir Makarov  <vmakarov@redhat.com>

	* ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c,
	ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files.

	* doc/passes.texi: Describe IRA.

	* doc/tm.texi (IRA_COVER_CLASSES,
	IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros.

	* doc/invoke.texi (ira-max-loops-num): Describe the new parameter.
	(-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills,
	-fira-propagate-cost, -fno-ira-share-save-slots,
	-fno-ira-share-spill-slots, -fira-verbose): Describe new options.

	* flags.h (ira_algorithm): New enumeration.
	(flag_ira_algorithm, flag_ira_verbose): New external variable
	declarations.

	* postreload.c (gate_handle_postreload): Don't do post reload
	optimizations unless the reload is completed.

	* reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for
	IRA.

	* tree-pass.h (pass_ira): New external variable declaration.

	* reload.h: Add 2008 to the Copyright.
    
	* cfgloopanal.c: Include params.h.
	(estimate_reg_pressure_cost): Decrease cost for IRA optimization
	mode.
    
	* params.h (IRA_MAX_LOOPS_NUM): New macro.

	* toplev.c (ira.h): New include.
	(flag_ira_algorithm, flag_ira_verbose): New external variables.
	(backend_init_target): Call ira_init.
	(backend_init): Call ira_init_once.
	(finalize): Call finish_ira_once.

	* toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills,
	flag_ira_share_save_slots, flag_ira_share_spill_slots): New
	external variables.

	* regs.h (contains_reg_of_mode, move_cost, may_move_in_cost,
	may_move_out_cost): New external variable declarations.
	(move_table): New typedef.
    
	* caller-save.c: Include headers output.h and ira.h.
	(no_caller_save_reg_set): New global variable.
	(save_slots_num, save_slots): New variables.
	(reg_save_code, reg_restore_code, add_stored_regs): Add
	prototypes.
	(init_caller_save): Set up no_caller_save_reg_set.
	(init_save_areas): Reset save_slots_num.
	(saved_hard_reg): New structure.
	(hard_reg_map, saved_regs_num, all_saved_regs): New variables.
	(initiate_saved_hard_regs, new_saved_hard_reg,
	finish_saved_hard_regs, saved_hard_reg_compare_func): New
	functions.
	(setup_save_areas): Add code for sharing stack slots.
	(all_blocks): New variable.
	(save_call_clobbered_regs): Process pseudo-register too.
	(mark_set_regs): Process pseudo-register too.
	(insert_one_insn): Put the insn after bb note in a empty basic
	block.  Add insn check.
    
	* global.c (eliminable_regset): Make it external.
	(mark_elimination): Use DF_LR_IN for IRA.
	(pseudo_for_reload_consideration_p): New.
	(build_insn_chain): Make it external.  Don't ignore spilled
	pseudos for IRA.  Use pseudo_for_reload_consideration_p.
	(gate_handle_global_alloc): New function.
	(pass_global_alloc): Add the gate function.

	* opts.c (decode_options): Set up flag_ira.  Print the warning for
	-fira.
	(common_handle_option): Process -fira-algorithm and -fira-verbose.

	* timevar.def (TV_IRA, TV_RELOAD): New passes.

	* regmove.c (regmove_optimize): Don't do replacement of output for
	IRA.

	* hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses):
	New external variable declarations.

	* local-alloc.c (update_equiv_regs): Make it external.  Return
	true if jump label rebuilding should be done.  Rescan new_insn for
	notes.
	(gate_handle_local_alloc): New function.
	(pass_local_alloc): Add the gate function.

	* alias.c (value_addr_p, stack_addr_p): New functions.
	(nonoverlapping_memrefs_p): Use them for IRA.

	* common.opt (fira, fira-algorithm, fira-coalesce,
	fira-move-spills, fira-share-save-slots, fira-share-spill-slots,
	fira-verbose): New options.

	* regclass.c (reg_class_subclasses, contains_reg_of_mode,
	move_cost, may_move_in_cost, may_move_out_cost): Make the
	variables external.
	(move_table): Remove typedef.
	(init_move_cost): Make it external.
	(allocate_reg_info, resize_reg_info, setup_reg_classes): New
	functions.

	* rtl.h (init_move_cost, allocate_reg_info, resize_reg_info,
	setup_reg_classes): New function prototypes.
	(eliminable_regset): New external variable declaration.
	(build_insn_chain, update_equiv_regs): New function prototypes.
    
	* Makefile.in (IRA_INT_H): New definition.
	(OBJS-common): Add ira.o, ira-build.o, ira-costs.o,
	ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o.
	(reload1.o, toplev.o): Add dependence on ira.h.
	(cfgloopanal.o): Add PARAMS_H.
	(caller-save.o): Add dependence on output.h and ira.h.
	(ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o,
	ira-emit.o, ira-lives.o): New entries.

	* passes.c (pass_ira): New pass.

	* params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter.

	* reload1.c (ira.h): Include the header.
	(changed_allocation_pseudos): New bitmap.
	(init_reload): Initiate the bitmap.
	(compute_use_by_pseudos): Permits spilled registers in FROM.
	(temp_pseudo_reg_arr): New variable.
	(reload): Allocate and free temp_pseudo_reg_arr.  Sort pseudos for
	IRA.  Call alter_reg with the additional parameter.  Don't clear
	spilled_pseudos for IRA.  Restore original insn chain for IRA.
	Clear changed_allocation_pseudos at the end of reload.
	(calculate_needs_all_insns): Call IRA's mark_memory_move_deletion.
	(hard_regno_to_pseudo_regno): New variable.
	(count_pseudo): Check spilled pseudos.  Set up
	hard_regno_to_pseudo_regno.
	(count_spilled_pseudo): Check spilled pseudos. Update
	hard_regno_to_pseudo_regno.
	(find_reg): Use better_spill_reload_regno_p.  Check
	hard_regno_to_pseudo_regno.
	(alter_reg): Set up spilled_pseudos.  Add a new parameter.  Add
	code for IRA.
	(eliminate_regs_1): Use additional parameter for alter_reg.
	(finish_spills): Set up pseudo_previous_regs only for spilled
	pseudos.  Call reassign_pseudos once for all spilled pseudos, pass
	more arguments.  Don't clear live_throughout and dead_or_set for
	spilled pseudos.  Use additional parameter for alter_reg.  Call
	mark_allocation_change.  Set up changed_allocation_pseudos.
	Remove sanity check.
	(emit_input_reload_insns, delete_output_reload): Use additional
	parameter for alter_reg.  Call mark_allocation_change.
	(substitute, gen_reload_chain_without_interm_reg_p): New
	functions.
	(reloads_conflict): Use gen_reload_chain_without_interm_reg_p.
    
	* testsuite/gcc.dg/20080410-1.c: New file.
	
	* config/s390/s390.h (IRA_COVER_CLASSES,
	IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define.

	* config/sparc/sparc.h (IRA_COVER_CLASSES): New macro.

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

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

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

	* config/arm/arm.h (IRA_COVER_CLASSES): Ditto.
    
	* config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto.
    
	2008-08-24  Jeff Law  <law@redhat.com>
	* ira.c (setup_reg_class_intersect_union): Prefer smallest class
	when ignoring unavailable registers.

	2008-08-24  Jeff Law  <law@redhat.com>
	* ira-color.c (coalesced_pseudo_reg_slot_compare): Check
	FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD.
	* ira.c (setup_eliminable_regset): Check stack_realign_needed.
	* config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro.

	2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com>
	* ira-build.c (allocno_range_compare_func): Stabilize sort.

	2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com>
	* config/avr/avr.h (IRA_COVER_CLASSES): New macro.
	* reload1.c (find_reg): Process registers in register allocation order.

	2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk>
	* toplev.c (backend_init_target): Move ira_init call from
	here...
	(lang_dependent_init_target): ...to here.

	2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk>
	* ira.c (setup_class_subset_and_memory_move_costs): Don't
	calculate memory move costs for NO_REGS.

	2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org>
	* ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if
	STACK_REGS is defined.

	2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com>
	* config/spu/spu.h (IRA_COVER_CLASSES): New macro.

	2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com>
	* config/bfin/bfin.h (IRA_COVER_CLASSES): New macro.

	2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org>
	* config/sh/sh.h (IRA_COVER_CLASSES): Define.
	* config/sh/sh.md (movsicc_true+3): Check if emit returns a
	barrier.

From-SVN: r139590
2008-08-26 12:39:58 +00:00
H.J. Lu 2e3f842fe6 [multiple changes]
2008-07-30  Joey Ye  <joey.ye@intel.com>
	    H.J. Lu  <hongjiu.lu@intel.com>

	* builtins.c (expand_builtin_setjmp_receiver): Replace
	virtual_incoming_args_rtx with crtl->args.internal_arg_pointer.
	(expand_builtin_apply_args_1): Likewise.
	(expand_builtin_longjmp): Need DRAP for stack alignment.
	(expand_builtin_apply): Likewise.

	* caller-save.c (setup_save_areas): Call assign_stack_local_1
	instead of assign_stack_local to allow alignment reduction.

	* calls.c (emit_call_1): Need DRAP for stack alignment if
	return pops.
	(expand_call): Replace virtual_incoming_args_rtx with
	crtl->args.internal_arg_pointer.
	* stmt.c (expand_nl_goto_receiver): Likewise.

	* cfgexpand.c (get_decl_align_unit): Estimate stack variable
	alignment and store to stack_alignment_estimated and
	max_used_stack_slot_alignment.
	(expand_one_var): Likewise.
	(expand_stack_alignment): New function.
	(tree_expand_cfg): Initialize max_used_stack_slot_alignment
	and stack_alignment_estimated fields in rtl_data.  Call
	expand_stack_alignment at end.

	* defaults.h (INCOMING_STACK_BOUNDARY): New.
	(MAX_STACK_ALIGNMENT): Likewise.
	(MAX_SUPPORTED_STACK_ALIGNMENT): Likewise.
	(SUPPORTS_STACK_ALIGNMENT): Likewise.

	* emit-rtl.c (gen_reg_rtx): Estimate stack alignment for
	stack alignment when generating virtual registers.

	* function.c (assign_stack_local): Renamed to ...
	(assign_stack_local_1): This.  Add a parameter to indicate
	if it is OK to reduce alignment.
	(assign_stack_local): Use it.
	(instantiate_new_reg): Instantiate virtual incoming args rtx
	to vDRAP if stack realignment and DRAP is needed.
	(assign_parms): Collect parameter/return type alignment and
	contribute to stack_alignment_estimated.
	(locate_and_pad_parm): Likewise.
	(get_arg_pointer_save_area): Replace virtual_incoming_args_rtx
	with crtl->args.internal_arg_pointer.

	* function.h (rtl_data): Add new field drap_reg,
	max_used_stack_slot_alignment, stack_alignment_estimated,
	stack_realign_needed, need_drap, stack_realign_processed and
	stack_realign_finalized.
	(stack_realign_fp): New macro.
	(stack_realign_drap): Likewise.

	* global.c (compute_regsets): Frame pointer is needed when
	stack is realigned.  Can eliminate frame pointer when stack is
	realigned and dynamic realigned argument pointer isn't used.

	* reload1.c (update_eliminables):  Frame pointer is needed
	when stack is realigned.
	(init_elim_table): Can eliminate frame pointer when stack is
	realigned and dynamic realigned argument pointer isn't used.

	* rtl.h (assign_stack_local_1): Declare new funtion.

	* target-def.h (TARGET_UPDATE_STACK_BOUNDARY): New.
	(TARGET_GET_DRAP_RTX): Likewise.
	(TARGET_CALLS): Add TARGET_UPDATE_STACK_BOUNDARY and
	TARGET_GET_DRAP_RTX.

	* target.h (gcc_target): Add update_stack_boundary and
	get_drap_rtx.

	* tree-vectorizer.c (vect_can_force_dr_alignment_p): Replace
	STACK_BOUNDARY with MAX_STACK_ALIGNMENT.

2008-07-30  Xuepeng Guo  <xuepeng.guo@intel.com>
	    H.J. Lu  <hongjiu.lu@intel.com>

	* dwarf2out.c (dw_fde_struct): Add stack_realignment, drap_reg,
	vdrap_reg, stack_realign and drap_reg_saved.
	(add_cfi): Don't allow redefining CFA when DRAP is used.
	(reg_save): Handle stack alignment.
	(dwarf2out_frame_debug_expr): Add rules 16-20 to handle stack
	alignment.  Don't generate DWARF information for (set fp sp)
	when DRAP is used.
	(dwarf2out_begin_prologue): Initialize drap_reg and vdrap_reg
	to INVALID_REGNUM.
	(int_loc_descriptor): Move prototype forward.  Also define if
	DWARF2_UNWIND_INFO is true.
	(output_cfa_loc): Handle DW_CFA_expression.
	(build_cfa_aligned_loc): New.
	(based_loc_descr): Update assert for stack realign.  For local
	variables, use sp+offset when stack is aligned without drap and
	fp+offset when stack is aligned with drap.  For arguments, use
	cfa+offset when drap is used to align stack.

2008-07-30  Joey Ye  <joey.ye@intel.com>
	    H.J. Lu  <hongjiu.lu@intel.com>

	* config/i386/i386.c (ix86_force_align_arg_pointer_string):
	Break long line.
	(ix86_gen_andsp): New.
	(ix86_user_incoming_stack_boundary): Likewise.
	(ix86_default_incoming_stack_boundary): Likewise.
	(ix86_incoming_stack_boundary): Likewise.
	(ix86_can_eliminate): Likewise.
	(find_drap_reg): Likewise.
	(ix86_update_stack_boundary): Likewise.
	(ix86_get_drap_rtx): Likewise.
	(ix86_finalize_stack_realign_flags): Likewise.
	(TARGET_UPDATE_STACK_BOUNDARY): Likewise.
	(TARGET_GET_DRAP_RTX): Likewise.
	(override_options): Overide option value for new options.
	(ix86_function_ok_for_sibcall): Remove check for
	force_align_arg_pointer.
	(ix86_handle_cconv_attribute): Likewise.
	(ix86_function_regparm): Likewise.
	(setup_incoming_varargs_64): Don't set stack_alignment_needed
	here.
	(ix86_va_start): Replace virtual_incoming_args_rtx with
	crtl->args.internal_arg_pointer.
	(ix86_select_alt_pic_regnum): Check DRAP register.
	(ix86_save_reg): Replace force_align_arg_pointer with drap_reg.
	(ix86_compute_frame_layout): Compute frame layout wrt stack
	realignment.
	(ix86_internal_arg_pointer): Just return
	virtual_incoming_args_rtx.
	(ix86_expand_prologue): Decide if stack realignment is needed
	and generate prologue code accordingly.
	(ix86_expand_epilogue): Generate epilogue code wrt stack
	realignment is really needed or not.
	
	* config/i386/i386.h (MAIN_STACK_BOUNDARY): New.
	(ABI_STACK_BOUNDARY): Likewise.
	(PREFERRED_STACK_BOUNDARY_DEFAULT): Likewise.
	(STACK_REALIGN_DEFAULT): Likewise.
	(INCOMING_STACK_BOUNDARY): Likewise.
	(MAX_STACK_ALIGNMENT): Likewise.
	(ix86_incoming_stack_boundary): Likewise.
	(FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN): Removed.
	(REAL_PIC_OFFSET_TABLE_REGNUM): Updated to use BX_REG.
	(CAN_ELIMINATE): Defined with ix86_can_eliminate.
	(machine_function): Remove force_align_arg_pointer.

	* config/i386/i386.md (BX_REG): New.
	(R13_REG): Likewise.

	* config/i386/i386.opt (mforce_drap): New.
	(mincoming-stack-boundary): Likewise.
	(mstackrealign): Add Init(-1).

	* config/i386/i386-protos.h (ix86_can_eliminate): New

2008-07-30  H.J. Lu  <hongjiu.lu@intel.com>

	* doc/extend.texi: Update force_align_arg_pointer.

	* doc/invoke.texi: Document -mincoming-stack-boundary.  Update
	-mstackrealign.

	* doc/tm.texi (MAX_STACK_ALIGNMENT): Add macro.
	(INCOMING_STACK_BOUNDARY): Likewise.
	(TARGET_UPDATE_STACK_BOUNDARY): New target hook.
	(TARGET_GET_DRAP_RTX): Likewise.

From-SVN: r138335
2008-07-30 12:20:43 -07:00
Ian Lance Taylor 65c5f2a63f rtlanal.c (add_reg_note): New function.
* rtlanal.c (add_reg_note): New function.
	* rtl.h (add_reg_note): Declare.
	* auto-inc-dec.c (attempt_change): Use add_reg_note.
	* bb-reorder.c (add_reg_crossing_jump_notes): Likewise.
	* builtins.c (expand_builtin_longjmp): Likewise.
	(expand_builtin_nonlocal_goto): Likewise.
	* calls.c (emit_call_1, expand_call): Likewise.
	* cfgexpand.c (add_reg_br_prob_note): Likewise.
	* cfglayout.c (fixup_reorder_chain): Likewise.
	* cfgrtl.c (force_nonfallthru_and_redirect): Likewise.
	(commit_one_edge_insertion): Likewise.
	* combine.c (move_deaths, distribute_notes): Likewise.
	* df-problems.c (df_set_note): Likewise.
	* emit-rtl.c (link_cc0_insns, try_split): Likewise.
	(set_unique_reg_note): Likewise.
	(emit_copy_of_insn_after): Likewise.
	* expr.c (expand_expr_real): Likewise.
	* gcse.c (add_label_notes): Likewise.
	* haifa-sched.c (create_check_block_twin): Likewise.
	* jump.c (mark_jump_label_1): Likewise.
	* loop-doloop.c (add_test, doloop_modify): Likewise.
	* loop-unswitch.c (compare_and_jump_seq): Likewise.
	* lower-subreg.c (move_eh_region_note): Likewise.
	* optabs.c (emit_libcall_block): Likewise.
	* predict.c (predict_insn): Likewise.
	(combine_predictions_for_insn): Likewise.
	* recog.c (peephole2_optimize): Likewise.
	* regmove.c (try_auto_increment): Likewise.
	* reg-stack.c (emit_pop_insn, move_for_stack_reg): Likewise.
	* reload.c (find_reloads): Likewise.
	* reload1.c (fixup_eh_region_note): Likewise.
	(reload_as_needed, add_auto_inc_notes, copy_eh_notes): Likewise.
	* reorg.c (delete_prior_computation): Likewise.
	(delete_computation, dbr_schedule): Likewise.
	* config/pa/pa.c (legitimize_pic_address): Likewise.
	* config/sh/sh.c (sh_reorg): Likewise.

From-SVN: r137374
2008-07-02 18:01:18 +00:00
Richard Sandiford c41c1387d3 rtl.h (emit_clobber, [...]): Declare.
gcc/
	* rtl.h (emit_clobber, gen_clobber, emit_use, gen_use): Declare.
	* emit-rtl.c (emit_clobber, gen_clobber, emit_use, gen_use): New
	functions.  Do not emit uses and clobbers of CONCATs; individually
	use and clobber their operands.
	* builtins.c (expand_builtin_setjmp_receiver): Use emit_clobber,
	gen_clobber, emit_use and gen_use.
	(expand_builtin_longjmp, expand_builtin_nonlocal_goto): Likewise.
	(expand_builtin_return): Likewise.
	* cfgbuild.c (count_basic_blocks): Likewise.
	* cfgrtl.c (rtl_flow_call_edges_add): Likewise.
	* explow.c (emit_stack_restore): Likewise.
	* expmed.c (extract_bit_field_1): Likewise.
	* expr.c (convert_move, emit_move_complex_parts): Likewise.
	(emit_move_multi_word, store_constructor): Likewise.
	* function.c (do_clobber_return_reg, do_use_return_reg): Likewise.
	(thread_prologue_and_epilogue_insns): Likewise.
	* lower-subreg.c (resolve_simple_move): Likewise.
	* optabs.c (widen_operand, expand_binop): Likewise.
	(expand_doubleword_bswap, emit_no_conflict_block): Likewise.
	* reload.c (find_reloads): Likewise.
	* reload1.c (eliminate_regs_in_insn): Likewise.
	* stmt.c (expand_nl_goto_receiver): Likewise.
	* config/alpha/alpha.md (builtin_longjmp): Likewise.
	* config/arc/arc.md (*movdi_insn, *movdf_insn): Likewise.
	* config/arm/arm.c (arm_load_pic_register): Likewise.
	(thumb1_expand_epilogue, thumb_set_return_address): Likewise.
	* config/arm/arm.md (untyped_return): Likewise.
	* config/arm/linux-elf.h (PROFILE_HOOK): Likewise.
	* config/avr/avr.c (expand_prologue): Likewise.
	* config/bfin/bfin.c (do_unlink): Likewise.
	* config/bfin/bfin.md (<optab>di3, adddi3, subdi3): Likewise.
	* config/cris/cris.c (cris_expand_prologue): Likewise.
	* config/darwin.c (machopic_indirect_data_reference): Likewise.
	(machopic_legitimize_pic_address): Likewise.
	* config/frv/frv.c (frv_frame_access, frv_expand_epilogue): Likewise.
	(frv_ifcvt_modify_insn, frv_expand_mdpackh_builtin): Likewise.
	* config/i386/i386.c (ix86_expand_vector_move_misalign): Likewise.
	(ix86_expand_convert_uns_didf_sse): Likewise.
	(ix86_expand_vector_init_general): Likewise.
	* config/ia64/ia64.md (eh_epilogue): Likewise.
	* config/iq2000/iq2000.c (iq2000_expand_epilogue): Likewise.
	* config/m32c/m32c.c (m32c_emit_eh_epilogue): Likewise.
	* config/m32r/m32r.c (m32r_reload_lr): Likewise.
	(config/iq2000/iq2000.c): Likewise.
	* config/mips/mips.md (fixuns_truncdfsi2): Likewise.
	(fixuns_truncdfdi2, fixuns_truncsfsi2, fixuns_truncsfdi2): Likewise.
	(builtin_longjmp): Likewise.
	* config/mn10300/mn10300.md (call, call_value): Likewise.
	* config/pa/pa.md (nonlocal_goto, nonlocal_longjmp): Likewise.
	* config/pdp11/pdp11.md (abshi2): Likewise.
	* config/rs6000/rs6000.c (rs6000_emit_move): Likewise.
	* config/s390/s390.c (s390_emit_prologue): Likewise.
	* config/s390/s390.md (movmem_long, setmem_long): Likewise.
	(cmpmem_long, extendsidi2, zero_extendsidi2, udivmoddi4): Likewise.
	(builtin_setjmp_receiver, restore_stack_nonlocal): Likewise.
	* config/sh/sh.c (prepare_move_operands): Likewise.
	(output_stack_adjust, sh_expand_epilogue): Likewise.
	(sh_set_return_address, sh_expand_t_scc): Likewise.
	* config/sparc/sparc.c (load_pic_register): Likewise.
	* config/sparc/sparc.md (untyped_return, nonlocal_goto): Likewise.
	* config/spu/spu.c (spu_expand_epilogue): Likewise.
	* config/v850/v850.c (expand_epilogue): Likewise.

From-SVN: r136251
2008-06-01 09:47:28 +00:00
Kenneth Zadeck 84b8030f0e optabs.c (prepare_cmp_insn): Changed LCT_PURE_MAKE_BLOCK to LCT_PURE and LCT_CONST_MAKE_BLOCK to LCT_CONST...
2008-05-14  Kenneth Zadeck <zadeck@naturalbridge.com>

	* optabs.c (prepare_cmp_insn): Changed LCT_PURE_MAKE_BLOCK to
	LCT_PURE and LCT_CONST_MAKE_BLOCK to LCT_CONST in calls to
	emit_library_call_value. 
	* builtins.c (expand_builtin_powi, expand_builtin_memcmp): Ditto.
	* tree.h (ECF_LIBCALL_BLOCK): Removed.
	* calls.c (initialize_argument_information, precompute_arguments, 
	expand_call, emit_library_call_value_1): Remove ECF_LIBCALL_BLOCK.
	(precompute_arguments): Removed flags parameter.
	* rtl.h (LCT_CONST_MAKE_BLOCK, LCT_PURE_MAKE_BLOCK): Removed.

From-SVN: r135299
2008-05-14 17:05:13 +00:00
Kenneth Zadeck becfd6e57b [multiple changes]
2008-05-07 Kenneth Zadeck <zadeck@naturalbridge.com>

        PATCH rtl/7335
        PATCH rtl/33826
        * see.c (see_copy_insn): Copy new pure const attributes for new
        call.
        * c-decl.c (merge_decls): Ditto.
        * postreload.c (record_opr_changes): Change CONST_OR_PURE_CALL_P
        to RTL_CONST_OR_PURE_CALL_P.
        * tree.c (define_local_buitin): Rename DECL_IS_PURE to
        DECL_PURE_P.  Initialized DECL_LOOPING_CONST_PURE.
        (process_call_operands): Set tree_side_effects properly.
        * tree.h (TREE_READONLY_DECL_P): Removed.
        (DECL_IS_PURE): Renamed to DECL_PURE_P.
        (DECL_LOOPING_OR_CONST_P): New macro.
        (struct tree_function_decl): Added looping_const_or_pure_p.
        (ECF_*) Renumbered.
        (ECF_LOOPING_OR_CONST_P): New macro,
        * rtlanal.c (pure_const_p): Removed.
        * builtins.c (expand_builtin): Rename DECL_IS_PURE to DECL_PURE_P.
        * reorg.c (delete_prior_computation) Changed CONST_OR_PURE_CALL_P
        to RTL_CONST_CALL_P.
        * ipa-pure-const.c (pure_const_state_e): Added looping field.
        (check_decl, check_tree, check_call, scan_function): Initialize
        looping.
        (analyze_function): Rename DECL_IS_PURE to DECL_PURE_P.
        (static_execute): Set looping true for recursive functions.
        Undo setting state to IPA_NEITHER for recursive functions.
        * cse.c (cse_insn): 
        * ifcvt.c (noce_can_store_speculate_p): Changed
        CONST_OR_PURE_CALL_P and pure_call_p to RTL_CONST_CALL_P or 
        RTL_CONST_OR_PURE_CALL_P.
        * dse.c (scan_insn): Ditto.
        * local-alloc.c (validate_equiv_mem, memref_used_between_p): Ditto.
        * gcse.c (oprs_not_seen_p) Changed CONST_OR_PURE_CALL_P to
        RTL_CONST_OR_PURE_CALL_P.
        (store_killed_in_insn): Changed CONST_OR_PURE_CALL_P and
        pure_call_p to RTL_CONST_CALL_P.
        * gimplify.c (gimplify_call_expr): Clear side effects for
        non-looping pure and constant calls.
        * calls.c (emit_call_1): Set rtl flags from ecf flags.
        (flags_from_decl_or_type): Set ecf flags from decl flags.
        (initialize_argument_information): Turn off
        ECF_LOOPING_CONST_OR_PURE when turning off ECF_CONST.
        Change const to pure if callee_copies is true rather than just
        turning off const.
        (expand_call): Turn off ECF_LOOPING_PURE_CONST_CALL and remove old
        way of marking pure calls.
        (emit_library_call_value_1): Turn off ECF_LOOPING_PURE_CONST_CALL.
        Remove hack that was supposed to fix pr7335 and remove old
        way of marking pure calls.
        * emit-rtl.c (emit_copy_of_insn_after): Copy RTL_CONST_CALL_P,
        RTL_PURE_CALL_P, RTL_LOOPING_CONST_OR_PURE_CALL_P.
        * cselib.c (cselib_process_insn): Changed CONST_OR_PURE_CALL_P to
        RTL_CONST_OR_PURE_CALL_P.
        * tree-ssa-pre.c (can_value_number_call): Fixed spacing.
        * loop-invariant.c (find_exits, find_invariant_bb): Changed
        CONST_OR_PURE_CALL_P to RTL_CONST_OR_PURE_CALL_P.
        * sched-deps.c (schedule_analyze): Ditto.
        * rtl.h (struct rtx_def): Use call field, unchanging field, and
        return_val field of calls to represent pure and const function
        info.
        (CONST_OR_PURE_CALL_P): Deleted macro.
        (RTL_CONST_CALL_P, RTL_PURE_CALL_P,
        RTL_LOOPING_CONST_OR_PURE_CALL_P, RTL_CONST_OR_PURE_P): New macros.
        * tree-inline.c (copy_body_r): Changed TREE_READONLY_DECL_P to
        TREE_READONLY.
        * tree-optimize.c (execute_fixup_cfg): Added test for
        ECF_LOOPING_CONST_OR_PURE.
        * c-common.c (handle_pure_attribute): Changed DECL_IS_PURE to
        DECL_PURE_P.
        * tree-cfg.c (update_call_expr_flags): Do not clear tree side
        effects for looping pure or const calls.
        (verify_gimple_expr): Added verification code. 
        * config/alpha/alpha.c (alpha_legitimize_address,
        alpha_emit_xfloating_libcall): Changed CONST_OR_PURE_CALL_P to
        RTL_CONST_CALL_P.
        * config/s390/s390.c (s390_emit_tls_call_insn): Ditto.
        * config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Ditto.
        * config/mips/mips.c (mips_call_tls_get_addr): Ditto.
        * cfgrtl.c (need_fake_edge_p): Changed CONST_OR_PURE_CALL_P to
        RTL_CONST_OR_PURE_CALL_P.
        * dce.c (deletable_insn_p): Allow non looping, non sibling, pure
        and const calls to be deleted.

java:
2008-05-07  Kenneth Zadeck <zadeck@naturalbridge.com>

	* decl.c (java_init_decl_processing): Change DECL_IS_PURE to
	DECL_PURE_P.

cp:
2008-05-07 Kenneth Zadeck <zadeck@naturalbridge.com>

	 * decl.c (duplicate_decls): Merge in DECL_PURE_P, TREE_READONLY,
	 DECL_LOOPING_CONST_OR_PURE_P attributes.
	 * rtti.c (build_dynamic_cast_1): Rename DECL_IS_PURE to
	 DECL_PURE_P.

gfortran:
2008-05-07 Kenneth Zadeck <zadeck@naturalbridge.com>

	 * trans-decl.c (gfc_get_extern_function_decl, build_function_decl):
	 Rename DECL_IS_PURE to DECL_PURE_P.

From-SVN: r135053
2008-05-07 20:48:07 +00:00
Peter Bergner 46b71b0354 PR middle-end/PR28690
PR middle-end/PR28690
	* rtlanal.c: Update copyright years.
	(commutative_operand_precedence): Give SYMBOL_REF's the same precedence
	as REG_POINTER and MEM_POINTER operands.
	* emit-rtl.c (gen_reg_rtx_and_attrs): New function.
	(set_reg_attrs_from_value): Call mark_reg_pointer as appropriate.
	* rtl.h (gen_reg_rtx_and_attrs): Add prototype for new function.
	* gcse.c: Update copyright years.
	(pre_delete): Call gen_reg_rtx_and_attrs.
	(hoist_code): Likewise.
	(build_store_vectors): Likewise.
	(delete_store): Likewise.
	* loop-invariant.c (move_invariant_reg): Likewise.
	Update copyright years.

From-SVN: r133985
2008-04-07 12:36:59 -05:00
Tom Tromey 2d593c86cf system.h (USE_MAPPED_LOCATION): Poison.
gcc
	* system.h (USE_MAPPED_LOCATION): Poison.
	* Makefile.in (GTFILES): Put CPP_ID_DATA_H first.
	* tree-cfg.c (make_cond_expr_edges): Remove old location code.
	(make_goto_expr_edges): Likewise.
	(remove_bb): Likewise.
	(execute_warn_function_return): Likewise.
	* basic-block.h (struct edge_def) <goto_locus>: Change type to
	location_t.
	* c-common.c (fname_decl): Remove old location code.
	* tree-vect-transform.c (vect_finish_stmt_generation): Remove old
	location code.
	* rtl.h (ASM_OPERANDS_SOURCE_LOCATION): Remove old-location
	variant.
	(ASM_INPUT_SOURCE_LOCATION): Likewise.
	(gen_rtx_ASM_INPUT): Likewise.
	(gen_rtx_ASM_INPUT_loc): Likewise.
	(get_rtx_asm_OPERANDS): Remove.
	* cfglayout.c (insn_locators_alloc): Remove old location code.
	(set_curr_insn_source_location): Likewise.
	(curr_insn_locator): Likewise.
	* print-tree.c (print_node): Remove old location code.
	* tree-mudflap.c (mf_varname_tree): Remove old location code.
	(mf_file_function_line_tree): Remove test of USE_MAPPED_LOCATION.
	* cfgexpand.c (expand_gimple_cond_expr): Don't use
	location_from_locus.
	(construct_exit_block): Remove old location code.
	* emit-rtl.c (force_next_line_note): Remove old location code.
	* profile.c (branch_prob): Remove old location code.
	* tree-vectorizer.h (LOC, UNKNOWN_LOC, EXPR_LOC, LOC_FILE,
	LOC_LINE): Remove old-location variants.
	* langhooks.c (lhd_print_error_function): Remove old location
	code.
	* configure, config.in: Rebuilt.
	* configure.ac (--enable-mapped-location): Remove.
	* c-decl.c (c_init_decl_processing): Remove old location code.
	(finish_function): Likewise.
	* recog.c (decode_asm_operands): Remove old location code.
	* c-pch.c (c_common_read_pch): Remove old location code.
	* rtl.def (ASM_INPUT, ASM_OPERANDS): Remove old location
	variants.
	* gimple-low.c (lower_function_body): Remove old location code.
	* toplev.c (unknown_location): Remove.
	(push_srcloc): Remove old-location variant.
	(process_options): Remove old location code.
	(lang_dependent_init): Likewise.
	* input.h (UNKNOWN_LOCATION): Move definition.
	(location_t): Undeprecate.
	(source_locus): Remove.
	(location_from_locus): Remove.
	(struct location_s): Remove.
	Remove all old-location code.
	(input_line, input_filename): Remove.
	* final.c (final_scan_insn): Remove old location code.
	* diagnostic.c (diagnostic_build_prefix): Remove
	USE_MAPPED_LOCATION test.
	* tree.h (gimple_stmt) <locus>: Now a location_t.
	(tree_exp) <locus>: Likewise.
	(DECL_IS_BUILTIN): Remove old-location variant.
	(annotate_with_file_line, annotate_with_locus): Likewise.
	(expr_locus, set_expr_locus): Update.
	* tree.c (build1_stat): Remove old location code.
	(last_annotated_node): Remove.
	(annotate_with_file_line): Remove old-location variant.
	(annotate_with_locus): Likewise.
	(expr_location): Remove old location code.
	(set_expr_location): Likewise.
	(expr_has_location): Likewise.
	(expr_locus): Likewise.
	(set_expr_locus): Likewise.
	(expr_filename): Don't use location_from_locus.
	(expr_lineno): Likewise.
	* rtl-error.c (location_for_asm): Remove old location code.
	* c-lex.c (cb_line_change): Remove old location code.
	(fe_file_change): Likewise.
	(cb_def_pragma): Likewise.
	(c_lex_with_flags): Likewise.
	* gengtype.c (do_typedef): Don't special-case location types.
	(define_location_structures): Remove.
	(main): Don't call define_location_structures.
	* tree-pretty-print.c (dump_implicit_edges): Remove old location
	code.
gcc/ada
	* misc.c (internal_error_function): Remove test of
	USE_MAPPED_LOCATION.
	* trans.c (gigi): Remove test of USE_MAPPED_LOCATION.
	(Sloc_to_locus): Remove old location code.
gcc/cp
	* parser.c (eof_token): Remove old location code.
	(check_empty_body): Remove test of USE_MAPPED_LOCATION.
	* decl2.c (generate_ctor_or_dtor_function): Remove old location
	code.
	(cp_write_global_declarations): Likewise.
	* lex.c (cxx_init): Remove old location code.
	(handle_pragma_implementation): Remove test of
	USE_MAPPED_LOCATION.
	* pt.c (tsubst): Remove old location code.
	* error.c (cp_print_error_function): Remove test of
	USE_MAPPED_LOCATION.
	* decl.c (pop_label): Remove old location code.
	(finish_function): Likewise.
gcc/fortran
	* trans-io.c (set_error_locus): Remove old location code.
	* trans-decl.c (gfc_set_decl_location): Remove old location code.
	* f95-lang.c (gfc_init): Remove test of USE_MAPPED_LOCATION.
	* scanner.c (gfc_gobble_whitespace): Remove old location code.
	(get_file): Likewise.
	(preprocessor_line): Likewise.
	(load_file): Likewise.
	(gfc_new_file): Likewise.
	* trans.c (gfc_trans_runtime_check): Remove old location code.
	(gfc_get_backend_locus): Likewise.
	(gfc_set_backend_locus): Likewise.
	* data.c (gfc_assign_data_value): Remove old location code.
	* error.c (show_locus): Remove old location code.
	* gfortran.h (gfc_linebuf): Remove old location code.
	(gfc_linebuf_linenum): Remove old-location variant.
gcc/java
	* lang.c (java_post_options): Remove conditional.
	* expr.c (expand_byte_code): Remove old location code.
	* jcf-parse.c (set_source_filename): Remove old location code.
	(give_name_to_class): Likewise.
	(jcf_parse): Likewise.
	(duplicate_class_warning): Likewise.
	(parse_class_file): Likewise.
	(java_parse_file): Likewise.
	* decl.c (finish_method): Remove old location code.
	* class.c (push_class): Remove old location code.
gcc/objc
	* objc-act.c (objc_init): Remove old location code.
gcc/treelang
	* tree1.c (treelang_init): Remove old location code.
	(treelang_parse_file): Likewise.
	* lex.l (LINEMAP_POSITION_FOR_COLUMN): Remove.
	(update_lineno_charno): Remove old location code.

From-SVN: r132679
2008-02-26 16:05:24 +00:00
Richard Sandiford 38ae765115 rtl.def (SUBREG): Update comments.
gcc/
	* rtl.def (SUBREG): Update comments.
	* rtl.h (reg_attrs): Be explicit about the type of offset used.
	(set_reg_attrs_from_mem): Rename to...
	(set_reg_attrs_from_value): ...this.
	(adjust_reg_mode, byte_lowpart_offset): Declare.
	* emit-rtl.c (byte_lowpart_offset): New function.
	(update_reg_offset): Remove special offset handling for big-endian
	targets.
	(gen_rtx_REG_offset, gen_reg_rtx_offset): Explicitly say that the
	offset parameter is added to REG_OFFSET.
	(adjust_reg_mode): New function.
	(set_reg_attrs_for_mem): Rename to...
	(set_reg_attrs_for_value): ...this and generalize to all values.
	If the register is a lowpart of the value, adjust the offset
	accordingly.
	(set_reg_attrs_for_parm): Update after the above renaming.
	(set_reg_attrs_for_decl_rtl): New function, split out from
	set_decl_incoming_rtl.  Set the offset of plain REGs to the
	offset of the REG's mode from the decl's.  Assert that all
	subregs are lowparts and handle their inner registers in the
	same way as plain REGs.
	(set_decl_rtl, set_incoming_decl_rtl): Use reg_attrs_for_decl_rtl.
	(subreg_lowpart_offset): Explicitly say that the returned offset
	is a SUBREG_BYTE.
	* combine.c (do_SUBST_MODE, try_combine, undo_all): Use adjust_reg_mode
	instead of PUT_MODE.
	* final.c (alter_subreg): Fix/update argument to gen_rtx_REG_offset.
	* config/ia64/ia64.c (ia64_expand_load_address): Likewise.
	* regclass.c (reg_scan_mark_refs): Use set_reg_attrs_from_value.
	* reload.c (find_reloads_subreg_address): Call set_mem_offset
	when offseting a MEM.
	* var-tracking.c (offset_valid_for_tracked_p): Delete.
	(mode_for_reg_attrs): Replace with...
	(track_loc_p): ...this new function.  Return the mode and offset
	to the caller, checking that the latter is valid.  If the rtx is
	a paradoxical lowpart of the decl, use the decl's mode instead.
	Do the same when storing to a register that contains the entire decl.
	(var_lowpart): Use byte_lowpart_offset rather than
	subreg_lowpart_offset when adjusting the offset attribute.
	(count_uses, add_uses, add_stores): Use track_reg_p instead of
	REG_EXPR, MEM_EXPR, REG_OFFSET, INT_MEM_OFFSET, track_expr_p,
	offset_valid_for_tracked_p and mode_for_reg_attrs.  Generate
	lowparts for MEMs as well as REGs.
	(vt_add_function_parameters): When obtaining the information from
	the decl_rtl, adjust the offset to match incoming.  Use track_loc_p
	and var_lowpart.

From-SVN: r131055
2007-12-19 09:54:24 +00:00
Eric Botcazou 8c6c36a3c9 re PR rtl-optimization/33822 (-g -O -mstrict-align causes an ICE in set_variable_part,)
PR rtl-optimization/33822
	* rtl.h (REG_OFFSET): Fix comment.
	* var-tracking.c (INT_MEM_OFFSET): New macro.
	(var_mem_set): Use it.
	(var_mem_delete_and_set): Likewise.
	(var_mem_delete): Likewise.
	(same_variable_part_p): Likewise.
	(vt_get_decl_and_offset): Likewise.
	(offset_valid_for_tracked_p): New predicate.
	(count_uses): Do not track locations with invalid offsets.
	(add_uses): Likewise.
	(add_stores): Likewise.

From-SVN: r129970
2007-11-07 20:48:08 +00:00
Eric Botcazou 9ed7b22165 re PR rtl-optimization/33644 (ICE in local_cprop_pass with -ftrapv for crafty)
PR rtl-optimization/33644
	* cfgcleanup.c: Do not include dce.h.
	* cfgrtl.c (delete_insn_chain_and_edges): Resurrect.
	* combine.c (distribute_notes): Delete REG_LIBCALL_ID case.
	* dce.c (something_changed): Delete.
	(libcall_dead_p): New predicate.
	(delete_unmarked_insns): Use it to delete dead libcalls.
	Deal with REG_LIBCALL and REG_RETVAL notes.
	(prescan_libcall_for_dce): New function.
	(prescan_insns_for_dce): Use it to deal with libcalls.
	(mark_reg_dependencies): Do nothing special for libcalls.
	(dce_process_block): Likewise.
	(fast_dce): Delete unused local variable.
	(run_fast_dce): Do not return a value.
	* dce.h (struct df): Delete.
	(run_fast_dce): Adjust prototype.
	* optabs.c (libcall_id): Delete.
	(maybe_encapsulate_block): Do not emit REG_LIBCALL_ID notes.
	(emit_no_conflict_block): Do not look for REG_LIBCALL_ID notes.
	* reload1.c (reload): Delete REG_LIBCALL_ID case.
	* rtl.h (delete_insn_chain_and_edges): Resurrect prototype.
	* see.c (see_update_relevancy): Look for REG_LIBCALL and REG_RETVAL
	notes instead of REG_LIBCALL_ID notes.
	* reg-notes.def (LIBCALL_ID): Delete.
	* Makefile.in (see.o): Add dce.h dependency.
	(cfgcleanup.o): Remove dce.h dependency.

From-SVN: r129556
2007-10-22 19:28:23 +00:00
Maxim Kuvyrkov a750daa285 sched-ebb.c: Surround code with '#ifdef INSN_SCHEDULING'.
* sched-ebb.c: Surround code with '#ifdef INSN_SCHEDULING'.
	* ddg.c: Ditto.
	* sched-deps.c: Ditto.  Remove nested #ifdef's INSN_SCHEDULING.
	* sched-int.h: Surround declarations with '#ifdef INSN_SCHEDULING'.
	(print_insn): Move declaration to ...
	* rtl.h (print_insn): ... here.

From-SVN: r129417
2007-10-17 19:50:55 +00:00
Paolo Bonzini 215b063c9d target.h (unspec_may_trap_p): New target hook.
2007-10-16  Paolo Bonzini  <bonzini@gnu.org>
	    Maxim Kuvyrkov  <maxim@codesourcery.com>

	* target.h (unspec_may_trap_p): New target hook.
	* target-def.h (TARGET_UNSPEC_MAY_TRAP_P): New macro.
	* targhooks.c (default_unspec_may_trap_p): Default implementation of
	the hook.
	* targhooks.h (default_unspec_may_trap_p): Declare it.
	* doc/tm.texi (TARGET_UNSPEC_MAY_TRAP_P): Document new hook.
	* rtlanal.c (may_trap_p_1): Use new hook.  Make global.
	* rtl.h (may_trap_p_1): Declare.
	
	* config/ia64/ia64.c (ia64_unspec_may_trap_p): New function to
	override default hook implementation.
	(TARGET_UNSPEC_MAY_TRAP_P): Override default implementation of the
	hook.
	
	* gcc.target/ia64/20040709-2.c: New test.

Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com>

From-SVN: r129378
2007-10-16 09:13:47 +00:00
Kenneth Zadeck ba49cb7bff ra-conflict.c: New file.
2007-09-02  Kenneth Zadeck <zadeck@naturalbridge.com>

	* ra-conflict.c: New file.
	* ra.h: New file.
	* reload.c (push_reload, find_dummy_reload): Change DF_RA_LIVE
	usage to DF_LIVE usage.
	* rtlanal.c (subreg_nregs_with_regno): New function.  
	* df-scan.c (df_def_record_1, df_uses_record): Add code to set
	DF_REF_EXTRACT, DF_REF_STRICT_LOWER_PART, and DF_REF_SUBREG flags.
	(df_has_eh_preds): Removed.
	(df_bb_refs_collect, df_bb_refs_collect, df_bb_refs_collect,
	df_exit_block_uses_collect): Changed call from df_has_eh_preds to
	bb_has_eh_pred.
	* global.c (allocno, max_allocno, conflicts, allocno_row_words,
	reg_allocno, EXECUTE_IF_SET_IN_ALLOCNO_SET): Moved to ra.h
	(SET_ALLOCNO_LIVE, CLEAR_ALLOCNO_LIVE): Moved to ra-conflicts.c.
	(regs_set, record_one_conflict, record_conflicts, mark_reg_store,
	mark_reg_clobber, mark_reg_conflicts, mark_reg_death): Deleted.
	(global_alloc): Turn off rescanning insns after call to
	global_conflicts and added call to set_preferences.
	(global_conflicts): Moved to ra-alloc.c.
	(set_preferences_1, set_preferences): New function.
	(mirror_conflicts): Changed types for various variables.
	(mark_elimination): Change DF_RA_LIVE
	usage to DF_LIVE usage.
	(build_insn_chain): Rewritten from scratch and made local.
	(print_insn_chain, print_insn_chains): New functions.
	(dump_conflicts): Do not print conflicts for fixed_regs.
	(rest_of_handle_global_alloc): Turn off insn rescanning.
	* hard-reg-set.h: Fixed comment.
	* local-alloc.c (update_equiv_regs): Change DF_RA_LIVE
	usage to DF_LIVE usage and delete refs to TOP sets.
	(block_alloc): Mark regs as live if they are in the artificial
	defs at top of block.
	(find_stack_regs): New function.
	(rest_of_handle_local_alloc): Changed urec problem to live
	problem and do not turn off df rescanning.
	* df.h (DF_UREC, DF_UREC_BB_INFO, DF_LIVE_TOP, DF_RA_LIVE_IN,
	DF_RA_LIVE_TOP, DF_RA_LIVE_OUT, df_urec_bb_info, df_urec,
	df_urec_add_problem, df_urec_get_bb_info, df_has_eh_preds): Removed.
	(DF_CHAIN, DF_NOTE, DF_CHAIN): Renumbered.
	(DF_REF_EXTRACT, DF_REF_STRICT_LOWER_PART, DF_REF_SUBREG): New
	fields in df_ref_flags.  The rest have been renumbered.  
	* init-regs.c (initialize_uninitialized_regs): Enhanced debugging
	at -O1.
	* rtl.h (subreg_nregs_with_regno): New function.
	* df-problems.c: (df_get_live_out, df_get_live_in,
	df_get_live_top): Removed reference to DF_RA_LIVE.
	(df_lr_reset, df_lr_transfer_function, df_live_free_bb_info,
	df_live_alloc, df_live_reset, df_live_local_finalize,
	df_live_free): Make top set only if different from in set.
	(df_lr_top_dump, df_live_top_dump): Only print top set if
	different from in set.
	(df_lr_bb_local_compute): Removed unnecessary check.
	(df_urec_problem_data, df_urec_set_bb_info, df_urec_free_bb_info, 
	df_urec_alloc, df_urec_mark_reg_change, earlyclobber_regclass, 
	df_urec_check_earlyclobber, df_urec_mark_reg_use_for_earlyclobber,
	df_urec_mark_reg_use_for_earlyclobber_1, df_urec_bb_local_compute,
	df_urec_local_compute, df_urec_init, df_urec_local_finalize, 
	df_urec_confluence_n, df_urec_transfer_function, df_urec_free, 
	df_urec_top_dump, df_urec_bottom_dump, problem_UREC,
	df_urec_add_problem): Removed.
	(df_simulate_fixup_sets): Changed call from df_has_eh_preds to
	bb_has_eh_pred. 
	* Makefile.in (ra-conflict.o, ra.h): New dependencies.
	* basic_block.h (bb_has_abnormal_pred): New function.
	* reload1.c (compute_use_by_pseudos): Change DF_RA_LIVE
	usage to DF_LIVE usage.

From-SVN: r128957
2007-10-02 13:10:07 +00:00
Kaveh R. Ghazi aa317c97cf alias.c (memory_modified_1): Deconstify.
* alias.c (memory_modified_1): Deconstify.
	(memory_modified_in_insn_p): Don't use const_note_stores.
	* rtl.h (const_note_stores): Delete.
	* rtlanal.c (const_note_stores): Likewise.

From-SVN: r128596
2007-09-19 02:58:24 +00:00
Robert Kidd 232abc3ff8 bb-reorder.c (rest_of_handler_reorder_blocks): Removed call to RTL level tracer pass.
2007-09-10 Robert Kidd <rkidd@crhc.uiuc.edu>

	* bb-reorder.c (rest_of_handler_reorder_blocks): Removed call to
	RTL level tracer pass.
	* passes.c (init_optimization_passes): Move pass_tracer from
	after pass_rtl_ifcvt to after pass_dce.
	* tracer.c: Update copyright.
	(layout_superblocks): Remove function.
	(mark_bb_seen): New.
	(bb_seen_p): New.
	(count_insns): Change to estimate instructions in a Tree-SSA
	statement.
	(find_trace): Use bb_seen_p.
	(tail_duplicate): Use bb_seen_p.  Call add_phi_args_after_copy
	after duplicate_block.
	(tracer): Change prototype to match that of a pass execute
	callback.
	(gate_tracer): Rename from gate_handle_tracer.
	(rest_of_handle_tracer): Remove function.
	* rtl.h: Remove prototype for tracer.
	* testsuite/gcc.dg/tree-prof/tracer-1.c: New.

From-SVN: r128341
2007-09-10 12:49:46 +00:00
Hans-Peter Nilsson cf7c4aa6af Divide REG_LABEL notes into REG_LABEL_OPERAND and REG_LABEL_TARGET.
* doc/rtl.texi (Insns): Specify when a label_ref makes a jump_insn.
	Similar for what label_refs can go in the JUMP_TARGET field.  Split
	REG_LABEL documentation into REG_LABEL_TARGET and REG_LABEL_OPERAND.
	* reload.c (find_reloads): Generate REG_LABEL_OPERAND, not
	REG_LABEL when replacing an operand with a LABEL_REF for a
	non-jump insn.
	(subst_reloads): When replacing a LABEL_REG with a register,
	instead of generating a REG_LABEL note, assert that there already
	is one or that the label is a known target for the insn.
	* rtlanal.c (computed_jump_p): Instead of looking for a REG_LABEL
	note, check the JUMP_LABEL field.  Remove "else" after return.
	* reorg.c (emit_delay_sequence): Replace case for REG_LABEL with
	cases for REG_LABEL_OPERAND and REG_LABEL_TARGET.
	(fill_slots_from_thread): Handle both REG_LABEL_OPERAND and
	REG_LABEL_TARGET notes, including the JUMP_TARGET field on JUMP_P
	insns.  Iterate over all notes; don't assume there's only one.
	* cse.c (recorded_label_ref): Adjust comment to refer to
	REG_LABEL_OPERAND.
	(cse_extended_basic_block): Do LABEL_REF check for all INSN_P
	insns, not just NONJUMP_INSN_P.
	(check_for_label_ref): For JUMP_P insns, check that the LABEL_REF
	isn't a jump target.
	* jump.c (rebuild_jump_labels): Adjust head comment.
	(init_label_info): Ditto.  Remove REG_LABEL_OPERAND notes only;
	don't reset REG_LABEL_TARGET notes, including the JUMP_LABEL field.
	(mark_all_labels): For JUMP_P insns without a target, check if the
	the target is noted on the previous nonjump insn.
	(mark_jump_label_1): New function, guts from mark_jump_label.
	<case IF_THEN_ELSE>: Handle first operand as a non-target when
	marking jump target labels.
	<case LABEL_REF>: Adjust for whether to generate a
	REG_LABEL_TARGET or a REG_LABEL_OPERAND note.
	For 'E' format rtl, iterate in descending element order.
	(delete_related_insns): Handle both REG_LABEL_TARGET and
	REG_LABEL_OPERAND notes.  For JUMP_P insns with labels with zero
	reference count, delete and fallthrough.  Move finding-next-
	non-deleted insn last in the function.  Look at all INSN_P insns
	for REG_LABEL_OPERAND notes.
	(redirect_jump_2): Assert that OLABEL equals the old JUMP_LABEL of
	JUMP.
	* print-rtl.c (print_rtx): For JUMP_P insns and a non-NULL
	JUMP_LABEL, output the INSN_UID of it.
	* gcse.c: Adjust comments as appropriate to say REG_LABEL_OPERAND
	and/or REG_LABEL_TARGET.
	(add_label_notes): Only add REG_LABEL_OPERAND notes.  Put in line
	with jump.c copy by only adding notes for labels actually
	referenced in the insn.
	* emit-rtl.c (try_split): Don't assume only NONJUMP_INSN_P need
	usage count increment; handle all INSN_P trial insns.
	(emit_copy_of_insn_after): Change to not copy REG_LABEL_OPERAND
	notes.
	* rtl.h (struct rtx_def) <volatil>: Adjust to mention
	REG_LABEL_TARGET and REG_LABEL_OPERAND.
	(LABEL_REF_NONLOCAL_P): Allow REG_LABEL_TARGET and
	REG_LABEL_OPERAND.
	* combine.c (distribute_notes): Adjust for REG_LABEL_TARGET on
	JUMP_P insns and REG_LABEL_OPERAND everywhere.
	* sched-rgn.c (is_cfg_nonregular): Check for REG_LABEL_OPERANDS
	on all INSN_P insns.
	* reg-notes.def (LABEL_TARGET, LABEL_OPERAND): Split from LABEL.
	* cfgrtl.c (delete_insn): Adjust to handle REG_LABEL_TARGET and
	REG_LABEL_OPERAND notes.
	* reload1.c (calculate_needs_all_insns): Adjust comments.
	(set_label_offsets): Adjust to look for REG_LABEL_OPERAND notes.
	* config/alpha/alpha.md (split for load of an address into a
	four-insn sequence on Unicos/Mk): Adjust to use
	REG_LABEL_OPERAND.
	* config/sh/sh.md (sh_reorg, final_prescan_insn): Ditto.

From-SVN: r128287
2007-09-09 04:41:58 +00:00
Kaveh R. Ghazi 755478019a c-common.c (const_strip_array_types): Delete.
* c-common.c (const_strip_array_types): Delete.
	* c-common.h (const_strip_array_types): Likewise.
	* emit-rtl.c (const_next_insn, const_previous_insn,
	const_next_nonnote_insn, const_prev_nonnote_insn,
	const_next_real_insn, const_prev_real_insn,
	const_next_active_insn, const_prev_active_insn, const_next_label,
	const_prev_label): Delete.
	* gimple-low.c (block_may_fallthru): Use expr_last.
	* jump.c (reversed_comparison_code_parts): Use prev_nonnote_insn.
	* rtl.h (const_previous_insn, const_next_insn,
	const_prev_nonnote_insn, const_next_nonnote_insn,
	const_prev_real_insn, const_next_real_insn,
	const_prev_active_insn, const_next_active_insn, const_prev_label,
	const_next_label): Delete.
	* rtlanal.c (keep_with_call_p): Use next_nonnote_insn.
	* system.h (CONST_CAST): Update comment.
	* tree-cfg.c (tree_can_merge_blocks_p): Use last_stmt.
	(const_first_stmt, const_last_stmt): Delete.
	(tree_block_ends_with_condjump_p): Use last_stmt.
	* tree-flow.h (const_first_stmt, const_last_stmt): Delete.
	* tree-iterator.c (const_expr_first, const_expr_last,
	const_expr_only): Delete.
	* tree.c (const_lookup_attribute): Likewise.
	(attribute_list_contained): Use lookup_attribute.
	* tree.h (const_lookup_attribute, const_expr_first,
	const_expr_last, const_expr_only): Delete.
	
cp:
	* tree.c (pod_type_p, zero_init_p): Use strip_array_types.
	* typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
	Likewise.

From-SVN: r128014
2007-09-01 17:18:03 +00:00
Sandra Loosemore fef511b5a6 re PR middle-end/33211 (FAIL: gcc.target/spu/fixed-range.c scan-assembler lqd.*21)
2007-08-30  Sandra Loosemore  <sandra@codesourcery.com>

	PR middle-end/33211

	gcc/
	* regclass.c (initial_fixed_regs): Revert previous change and make
	it const again.
	(initial_call_used_regs): Likewise.
	(initial_call_really_used_regs): Delete, reverting previous addition.
	(initial_reg_names): Likewise.
	(init_reg_sets): Revert previous change.
	(saved_fixed_regs): New.
	(saved_call_used_regs): New.
	(saved_call_really_used_regs): New.
	(saved_reg_names): New.
	(save_register_info): New.
	(restore_register_info): New.
	(init_reg_sets_1): Replace reset of register info with call to
	restore_register_info.
	* rtl.h (save_register_info): Declare.
	* toplev.c (backend_init): Call save_register_info.

From-SVN: r127951
2007-08-30 23:25:02 -04:00
Sandra Loosemore b5deb7b691 Separate target-specific initialization from general back-end initialization.
2007-08-27  Sandra Loosemore  <sandra@codesourcery.com>
	    David Ung  <davidu@mips.com>
            Nigel Stephens <nigel@mips.com>

	gcc/
	Separate target-specific initialization from general
	back-end initialization.

	* toplev.c (init_alignments): New, split out from...
	(process_options): ...here.
	(backend_init_target):  New, split out from...
	(backend_init): ...here.
	(lang_dependent_init_target):  New, split out from...
	(lang_dependent_init): ...here.
	(target_reinit): New.
	* toplev.h (target_reinit): Declare.
	* expr.c (init_expr_target): Renamed from init_expr_once, since it
	now can be called more than once.  Update comments.
	* expr.h (init_expr_target): Likewise.
	* alias.c (init_alias_target): Renamed from init_alias_once, since it
	now can be called more than once.  Explicitly zero
	static_reg_base_value.
	* emit-rtl.c (init_emit_regs): New, split out from...
	(init_emit_once): Here.
	* regclass.c (initial_fixed_regs, initial_call_used_regs): Make
	non-const, so that changes from command-line arguments can overwrite
	values provided by the static initializers.
	(initial_call_really_used_regs): New, used similarly to the above.
	(initial_reg_names): Likewise.
	(last_mode_for_init_move_cost): Promoted function-local static to
	file-scope static to make it accessible outside init_move_cost.
	(init_reg_sets): Do not initialize fixed_regs and call_used_regs yet.
	Do not initialize inv_reg_alloc_order yet, either.  Do initialize
	reg_names since it is needed for parsing command-line options.
	(init_move_cost): Use last_mode_for_init_move_cost instead of
	function-local static.
	(init_reg_sets_1): Initialize fixed_regs, call_used_regs, and
	call_really_used_regs now.  Reinitialize reg_names.  Also
	initialize inv_reg_alloc_order.  Zero reg_class_subunion and
	reg_class_superunion.  Clear losing_caller_save_reg_set.
	Preserve global registers if called more than once.  Reset
	move cost, may_move_in_cost, may_move_out_cost, and
	last_mode_for_init_move_cost.
	(init_reg_modes_target): Renamed from init_reg_modes_once, since it
	can now be invoked more than once.  Update comments.
	(init_regs): Update comments.
	(fix_register): Update initial_fixed_regs, initial_call_used_regs,
	and initial_call_really_used_regs, instead of the non-initial 
        variables.  This allows us to save the command-line register settings
	after target reinitialization.
	(init_reg_autoinc): Zero forbidden_inc_dec_classes.
	* rtl.h (init_emit_regs): Declare.
	(init_reg_modes_target, init_alias_target): Renamed as described
	above.
	* reload1.c (init_reload): Update comments.
	* optabs.c (init_optabs): Likewise.
	* cfgloopanal.c (init_set_costs): Explicitly zero target_avail_regs.
	


Co-Authored-By: David Ung <davidu@mips.com>
Co-Authored-By: Nigel Stephens <nigel@mips.com>

From-SVN: r127832
2007-08-27 09:34:14 -04:00
Chao-ying Fu 14b4a70aa9 rtl.h (XCNMPFV): Preserve const-ness of parameters through use of __typeof().
* rtl.h (XCNMPFV): Preserve const-ness of parameters through use of
	__typeof().

From-SVN: r127825
2007-08-27 04:38:03 +00:00
Kaveh R. Ghazi 9678086db1 alias.c (memory_modified_1, [...]): Constify.
* alias.c (memory_modified_1, memory_modified_in_insn_p):
	Constify.
	* basic-block.h (tree_predicted_by_p, rtl_predicted_by_p):
	Likewise.
	* bb-reorder.c (copy_bb_p): Likewise.
	* cfghooks.c (can_remove_branch_p, can_merge_blocks_p,
	predicted_by_p, can_duplicate_block_p, block_ends_with_call_p,
	block_ends_with_condjump_p): Likewise.
	* cfghooks.h (can_remove_branch_p, can_merge_blocks_p,
	predicted_by_p, can_duplicate_block_p, block_ends_with_call_p,
	block_ends_with_condjump_p): Likewise.
	* cfglayout.c (cfg_layout_can_duplicate_bb_p): Likewise.
	* cfgrtl.c (can_delete_note_p, can_delete_label_p,
	rtl_can_merge_blocks, cfg_layout_can_merge_blocks_p,
	rtl_block_ends_with_call_p, rtl_block_ends_with_condjump_p,
	need_fake_edge_p, rtl_can_remove_branch_p): Likewise.
	* dbxout.c (dbx_debug_hooks, xcoff_debug_hooks): Use
	debug_true_const_tree instad of debug_true_tree.
	* debug.c (do_nothing_debug_hooks): Likewise.
	* debug.h (ignore_block, debug_true_const_tree): Constify.
	* dwarf2out.c (stack_adjust_offset, clobbers_queued_reg_save,
	dwarf2out_ignore_block, is_pseudo_reg, is_tagged_type,
	decl_ultimate_origin, block_ultimate_origin, lookup_decl_loc,
	same_dw_val_p, add_ranges, is_subrange_type, type_is_enum,
	dbx_reg_number, is_based_loc, field_type,
	simple_type_align_in_bits, simple_decl_align_in_bits,
	simple_type_size_in_bits, field_byte_offset, insert_float,
	type_tag, member_declared_type, is_redundant_typedef,
	secname_for_decl, is_inlined_entry_point): Likewise.
	* emit-rtl.c (const_next_insn, const_previous_insn,
	const_next_nonnote_insn, const_prev_nonnote_insn,
	const_next_real_insn, const_prev_real_insn,
	const_next_active_insn, const_prev_active_insn, const_next_label,
	const_prev_label): Likewise.
	* except.h (lookup_stmt_eh_region_fn, lookup_stmt_eh_region):
	Likewise.
	* haifa-sched.c (may_trap_exp, haifa_classify_insn,
	find_set_reg_weight, no_real_insns_p, find_set_reg_weight,
	sched_insn_is_legitimate_for_speculation_p): Likewise.
	* jump.c (reversed_comparison_code_parts,
	reversed_comparison_code, reversed_comparison, condjump_label):
	Likewise.
	* predict.c (rtl_predicted_by_p, tree_predicted_by_p): Likewise.
	* reg-stack.c (stack_regs_mentioned_p, stack_regs_mentioned):
	Likewise.
	* rtl.h (const_previous_insn, const_next_insn,
	const_prev_nonnote_insn, const_next_nonnote_insn,
	const_prev_real_insn, const_next_real_insn,
	const_prev_active_insn, const_next_active_insn, const_prev_label,
	const_next_label, modified_between_p, modified_in_p,
	const_note_storeskeep_with_call_p, condjump_label,
	reversed_comparison, reversed_comparison_code,
	reversed_comparison_code_parts, memory_modified_in_insn_p,
	stack_regs_mentioned): Likewise.
	* rtlanal.c (modified_between_p, modified_in_p, const_note_stores,
	keep_with_call_p): Likewise.
	* sched-deps.c (deps_may_trap_p, sched_get_condition,
	conditions_mutex_p, sched_insns_conditions_mutex_psd_next_list,
	sd_lists_size, sd_lists_empty_p): Likewise.
	* sched-int.h (sched_insns_conditions_mutex_p,
	haifa_classify_insn, no_real_insns_p,
	sched_insn_is_legitimate_for_speculation_p, sd_next_list,
	sd_lists_size, sd_lists_empty_p): Likewise.
	* sdbout.c (sdb_debug_hooks): Likewise.
	* tree-cfg.c (tree_can_merge_blocks_p, is_ctrl_altering_stmt,
	stmt_ends_bb_p, tree_can_remove_branch_p, tree_can_duplicate_bb_p,
	-tree_block_ends_with_call_p, tree_block_ends_with_condjump_p):
	Likewise.
	* tree-eh.c (lookup_stmt_eh_region_fn, lookup_stmt_eh_region,
	tree_can_throw_internal): Likewise.
	* tree-flow-inline.h (phi_nodes): Likewise.
	* tree-flow.h (phi_nodesstmt_ends_bb_p, is_ctrl_altering_stmt,
	tree_can_throw_internal, lookup_stmt_eh_region): Likewise.
	* tree-gimple.c (const_get_call_expr_in): Likewise.
	* tree-gimple.h (const_get_call_expr_in): Likewise.
	* tree.c (const_lookup_attribute, attribute_list_equal,
	attribute_list_contained): Likewise.
	* tree.h (attribute_list_equal, attribute_list_contained,
	const_lookup_attribute): Likewise.
	* vmsdbgout.c (vmsdbgout_ignore_block): Likewise.

From-SVN: r127824
2007-08-27 03:45:06 +00:00
Kaveh R. Ghazi 58f9752a2a c-common.c (vector_types_convertible_p, [...]): Constify.
* c-common.c (vector_types_convertible_p,
	decl_with_nonnull_addr_p, c_promoting_integer_type_p,
	self_promoting_args_p): Constify.
	* c-common.h (has_c_linkage, decl_with_nonnull_addr_p,
	c_promoting_integer_type_p, self_promoting_args_p,
	anon_aggr_type_p, vector_types_convertible_p): Likewise.
	* c-decl.c (anon_aggr_type_p): Likewise.
	* * c-dump.c (dump_stmt): Likewise.
	* c-objc-common.c (has_c_linkage): Likewise.
	* c-tree.h (same_translation_unit_p): Likewise.
	* c-typeck.c (null_pointer_constant_p,
	tagged_types_tu_compatible_p, function_types_compatible_p,
	type_lists_compatible_p, lvalue_or_else, lvalue_p,
	comptypes_internal, struct tagged_tu_seen_cache,
	same_translation_unit_p, alloc_tagged_tu_seen_cache,
	c_size_in_bytes): Likewise.
	* ggc-common.c (compare_ptr_data, hash_descriptor, eq_descriptor,
	hash_ptr, eq_ptr): Likewise.
	* langhooks-def.h (lhd_decl_ok_for_sibcall,
	LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE): Likewise.
	* langhooks.c (lhd_decl_ok_for_sibcall): Likewise.
	* langhooks.h (ok_for_sibcall, omp_privatize_by_reference):
	Likewise.
	* optabs.c (optab_for_tree_code): Likewise.
	* optabs.h (optab_for_tree_code): Likewise.
	* rtl.h (simplify_rtx): Likewise.
	* simplify-rtx.c (simplify_rtx): Likewise.
	* tree-dump.c (queue, queue_and_dump_index, queue_and_dump_type,
	dump_flag, dump_node): Likewise.
	* tree-dump.h (struct dump_info, dump_stmt, queue_and_dump_index,
	queue_and_dump_type, dump_flag): Likewise.
	* tree-flow.h (vect_can_force_dr_alignment_p): Likewise.
	* tree-pass.h (dump_node): Likewise.
	* tree-vectorizer.c (vect_can_force_dr_alignment_p,
	supportable_narrowing_operation): Likewise.
	* tree-vectorizer.h (vect_can_force_dr_alignment_p,
	supportable_narrowing_operation): Likewise.
	* tree-vrp.c (needs_overflow_infinity, supports_overflow_infinity,
	is_negative_overflow_infinity, is_positive_overflow_infinity,
	is_overflow_infinity, vrp_val_is_max, vrp_val_is_min,
	nonnull_arg_p, get_value_range, vrp_operand_equal_p,
	update_value_range, add_equivalence, ssa_name_nonnegative_p,
	ssa_name_nonzero_p, fp_predicate): Likewise.
	* tree.c (auto_var_in_fn_p, empty_body_p): Likewise.
	* tree.h (empty_body_p, auto_var_in_fn_p, ssa_name_nonzero_p,
	ssa_name_nonnegative_p): Likewise.

cp:
	* call.c (sufficient_parms_p): Constify.
	* class.c (same_signature_p): Likewise.
	* cp-gimplify.c (is_invisiref_parm,
	cxx_omp_privatize_by_reference): Likewise.
	* cp-objcp-common.c (has_c_linkage): Likewise.
	* cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK,
	sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p,
	grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for,
	num_artificial_parms_for, comp_template_parms,
	template_parameter_pack_p, any_dependent_template_arguments_p,
	any_type_dependent_arguments_p, any_value_dependent_elements_p,
	repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p,
	zero_init_p, member_p, cp_lvalue_kind,
	builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
	varargs_function_p, is_dummy_object, special_function_kind,
	string_conv_p, type_unknown_p, comp_except_specs, compparms,
	comp_cv_qualification, is_bitfield_expr_with_lowered_type,
	unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly,
	cp_has_mutable_p, at_least_as_qualified_p,
	invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise.
	* decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise.
	* except.c (nothrow_libfn_p): Likewise.
	* method.c (skip_artificial_parms_for, num_artificial_parms_for):
	Likewise.
	* pt.c (comp_template_parms, template_parameter_pack_p,
	any_type_dependent_arguments_p, any_value_dependent_elements_p,
	any_dependent_template_arguments_p): Likewise.
	* repo.c (repo_export_class_p): Likewise.
	* semantics.c (anon_aggr_type_p): Likewise.
	* tree.c (lvalue_p_1, real_lvalue_p, lvalue_p,
	builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
	varargs_function_p, member_p, is_dummy_object, pod_type_p,
	zero_init_p, special_function_p): Likewise.
	* typeck.c (comp_array_types, type_unknown_p, comp_except_specs,
	comp_array_types, at_least_as_qualified_p, comp_cv_qualification,
	compparms, invalid_nonstatic_memfn_p,
	is_bitfield_expr_with_lowered_type, unlowered_expr_type,
	string_conv_p, ptr_reasonably_similar, cp_type_readonly,
	cp_has_mutable_p, lvalue_or_else): Likewise.

fortran:
	* trans-openmp.c (gfc_omp_privatize_by_reference): Constify.
	* trans.h (gfc_omp_privatize_by_reference): Likewise.

java:
	* lang.c (java_decl_ok_for_sibcall): Likewise.

From-SVN: r127799
2007-08-25 15:10:40 +00:00
Kaveh R. Ghazi 3101faab46 alpha.c (alpha_mangle_type, [...]): Constify.
* config/alpha/alpha.c (alpha_mangle_type, decl_has_samegp,
	alpha_in_small_data_p, alpha_split_complex_arg,
	alpha_stdarg_optimize_hook, TARGET_ASM_CAN_OUTPUT_MI_THUNK):
	Constify.
	* config/arm/arm-protos.h (arm_mangle_type): Likewise.
	* config/arm/arm.c (arm_comp_type_attributes, arm_mangle_type):
	Likewise.
	* config/bfin/bfin.c (funkind, bfin_comp_type_attributes,
	TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise.
	* config/darwin-protos.h (darwin_binds_local_p): Likewise.
	* config/darwin.c (darwin_binds_local_p): Likewise.
	* config/frv/frv.c (frv_string_begins_with, frv_in_small_data_p):
	Likewise.
	* config/i386/i386-protos.h (i386_pe_binds_local_p,
	i386_pe_valid_dllimport_attribute_p): Likewise.
	* config/i386/i386.c (ix86_function_regparm,
	ix86_comp_type_attributes, ix86_ms_bitfield_layout_p,
	x86_can_output_mi_thunk, ix86_mangle_type,
	TARGET_USE_BLOCKS_FOR_CONSTANT_P): Likewise.
	* config/i386/winnt.c (i386_pe_valid_dllimport_attribute_p,
	i386_pe_binds_local_p): Likewise.
	* config/ia64/ia64.c
	(ia64_first_cycle_multipass_dfa_lookahead_guard_spec,
	ia64_needs_block_p, ia64_in_small_data_p, ia64_mangle_type,
	ia64_invalid_conversion, ia64_invalid_unary_op,
	ia64_invalid_binary_op, TARGET_ASM_CAN_OUTPUT_MI_THUNK):
	Likewise.
	* config/m32c/m32c.c (m32c_comp_type_attributes): Likewise.
	* config/m32r/m32r.c (m32r_in_small_data_p): Likewise.
	* config/m68k/m68k.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise.
	* config/mips/mips.c (mips_use_blocks_for_constant_p,
	mips_in_small_data_p, mips_use_anchors_for_symbol_p,
	mips_comp_type_attributes, TARGET_ASM_CAN_OUTPUT_MI_THUNK,
	mips_near_type_p, mips_far_type_p, mips_global_symbol_p,
	mips_symbol_binds_local_p, mips_classify_symbol): Likewise.
	* config/pa/pa.c (pa_commutative_p): Likewise.
	* config/rs6000/rs6000-protos.h (rs6000_elf_in_small_data_p):
	Likewise.
	* config/rs6000/rs6000.c (rs6000_invalid_within_doloop,
	rs6000_ms_bitfield_layout_p, rs6000_mangle_type,
	rs6000_use_blocks_for_constant_p,
	rs6000_vector_alignment_reachable, rs6000_is_opaque_type,
	invalid_arg_for_unprototyped_fn, TARGET_ASM_CAN_OUTPUT_MI_THUNK,
	TARGET_SPLIT_COMPLEX_ARG, rs6000_elf_in_small_data_p): Likewise.
	* config/s390/s390.c (s390_mangle_type,
	TARGET_ASM_CAN_OUTPUT_MI_THUNK, TARGET_INVALID_WITHIN_DOLOOP):
	Likewise.
	* config/score/score.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK,
	th_in_small_data_p): Likewise.
	* config/sh/sh.c (sh_ms_bitfield_layout_p,
	sh_dwarf_calling_convention, TARGET_ASM_CAN_OUTPUT_MI_THUNK):
	Likewise.
	* config/sparc/sparc.c (sparc_can_output_mi_thunk,
	sparc_mangle_type): Likewise.
	* config/spu/spu.c (spu_vector_alignment_reachable): Likewise.
	* config/xtensa/xtensa.c (TARGET_SPLIT_COMPLEX_ARG): Likewise.
	* emit-rtl.c (const_fixed_htab_hash, const_fixed_htab_eq):
	Likewise.
	* hooks.c (hook_bool_mode_const_rtx_false,
	hook_bool_mode_const_rtx_true,
	hook_bool_const_tree_hwi_hwi_const_tree_false,
	hook_bool_const_tree_hwi_hwi_const_tree_true,
	hook_int_const_tree_0, hook_int_const_tree_const_tree_1,
	hook_constcharptr_const_tree_null,
	hook_constcharptr_const_rtx_null,
	hook_constcharptr_const_tree_const_tree_null,
	hook_constcharptr_int_const_tree_null,
	hook_constcharptr_int_const_tree_const_tree_null): New.
	(hook_bool_mode_rtx_false, hook_bool_mode_rtx_true,
	hook_bool_tree_hwi_hwi_tree_false,
	hook_bool_tree_hwi_hwi_tree_true, hook_int_tree_0,
	hook_int_tree_tree_1, hook_constcharptr_tree_null,
	hook_constcharptr_rtx_null, hook_constcharptr_tree_tree_null,
	hook_constcharptr_int_tree_null,
	hook_constcharptr_int_tree_tree_null): Delete.
	(default_can_output_mi_thunk_no_vcall): Constify.
	* hooks.h (hook_bool_mode_rtx_false, hook_bool_mode_rtx_true,
	hook_bool_tree_hwi_hwi_tree_false,
	hook_bool_tree_hwi_hwi_tree_true, hook_int_tree_0,
	hook_int_tree_tree_1, hook_constcharptr_tree_null,
	hook_constcharptr_rtx_null, hook_constcharptr_tree_tree_null,
	hook_constcharptr_int_tree_null,
	hook_constcharptr_int_tree_tree_null): Delete.
	(hook_bool_mode_const_rtx_false, hook_bool_mode_const_rtx_true,
	hook_bool_const_tree_hwi_hwi_const_tree_false,
	hook_bool_const_tree_hwi_hwi_const_tree_true,
	hook_int_const_tree_0, hook_int_const_tree_const_tree_1,
	hook_constcharptr_const_tree_null,
	hook_constcharptr_const_rtx_null,
	hook_constcharptr_const_tree_const_tree_null,
	hook_constcharptr_int_const_tree_null,
	hook_constcharptr_int_const_tree_const_tree_null): New.
	(default_can_output_mi_thunk_no_vcall): Constify.
	* integrate.c (function_attribute_inlinable_p): Likewise.
	* integrate.h (function_attribute_inlinable_p): Likewise.
	* jump.c (rtx_renumbered_equal_p): Likewise.
	* output.h (decl_readonly_section, categorize_decl_for_section,
	default_use_anchors_for_symbol_p, default_binds_local_p,
	default_binds_local_p_1): Likewise.
	* rtl.h (rtx_renumbered_equal_p, decl_default_tls_model):
	Likewise.
	* target-def.h (TARGET_ASM_CAN_OUTPUT_MI_THUNK,
	TARGET_VALID_DLLIMPORT_ATTRIBUTE_P, TARGET_VECTOR_OPAQUE_P,
	TARGET_COMMUTATIVE_P, TARGET_USE_BLOCKS_FOR_CONSTANT_P,
	TARGET_COMP_TYPE_ATTRIBUTES,
	TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P,
	TARGET_MS_BITFIELD_LAYOUT_P, TARGET_MANGLE_TYPE,
	TARGET_IN_SMALL_DATA_P, TARGET_INVALID_CONVERSION,
	TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP,
	TARGET_DWARF_CALLING_CONVENTION): Likewise.
	* target.h (can_output_mi_thunk, needs_block_p,
	first_cycle_multipass_dfa_lookahead_guard_spec,
	vector_alignment_reachable, comp_type_attributes,
	function_attribute_inlinable_p, ms_bitfield_layout_p, mangle_type,
	commutative_p, use_blocks_for_constant_p,
	use_anchors_for_symbol_p, in_small_data_p, binds_local_p,
	vector_opaque_p, dwarf_calling_convention, stdarg_optimize_hook,
	invalid_within_doloop, valid_dllimport_attribute_p,
	split_complex_arg, invalid_arg_for_unprototyped_fn,
	invalid_conversion, invalid_unary_op, invalid_binary_op):
	Likewise.
	* targhooks.c (default_invalid_within_doloop,
	hook_invalid_arg_for_unprototyped_fn,
	default_builtin_vector_alignment_reachable): Likewise.
	(hook_bool_rtx_commutative_p): Delete.
	(hook_bool_const_rtx_commutative_p): New.
	* targhooks.h (default_invalid_within_doloop,
	default_builtin_vector_alignment_reachable,
	hook_invalid_arg_for_unprototyped_fn): Constify.
	(hook_bool_rtx_commutative_p): Delete.
	(hook_bool_const_rtx_commutative_p): New.
	* varasm.c (bss_initializer_p, decl_default_tls_model,
	categorize_decl_for_section, decl_readonly_section,
	default_use_anchors_for_symbol_p, default_binds_local_p,
	default_binds_local_p_1): Constify.

From-SVN: r127785
2007-08-24 19:00:59 +00:00
Chao-ying Fu 091a3ac7b8 rtl.c (rtx_code_size): Check CONST_FIXED to calcualte correct sizes in DEF_RTL_EXPR.
* rtl.c (rtx_code_size): Check CONST_FIXED to calcualte correct sizes
	in DEF_RTL_EXPR.
	(copy_rtx): Handle CONST_FIXED.
	(rtx_equal_p): Likewise.
	* rtl.h (fixed_value.h): New include.
	(rtx_def): Add a new field of fixed_value to u.
	(XCNMPFV): Define for accessing fixed_value.
	(CONST_FIXED_VALUE, CONST_FIXED_VALUE_HIGH, CONST_FIXED_VALUE_LOW):
	Define.
	* rtl.def (CONST_FIXED): New constant.
	(SS_MULT, US_MULT, SS_DIV, US_DIV, FRACT_CONVERT,
	UNSIGNED_FRACT_CONVERT, SAT_FRACT, UNSIGNED_SAT_FRACT, US_NEG,
	US_ASHIFT): New codes.
	* doc/rtl.texi (Expressions): Document const_fixed, us_neg, ss_mult,
	us_mult, ss_div, us_div, us_ashift, fract_convert, sat_fract,
	unsigned_fract_convert, unsigned_sat_fract): Document them.
	* varasm.c (assemble_integer): Extend to support fixed-point constants
	by using different machine classes.
	(decode_addr_const): Handle FIXED_CST.
	(const_hash_1): Likewise.
	(compare_constant): Likewise.
	(copy_constant): Likewise.
	(const_rtx_hash_1): Handle CONST_FIXED.
	(output_constant_pool_2): Handle MODE_FRACT, MODE_UFRACT, MODE_ACCUM,
	MODE_UACCUM, MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM,
	MODE_VECTOR_UACCUM.
	(initializer_constant_valid_p): Handle FIXED_CST.
	(output_constant): Support FIXED_POINT_TYPE.
	* gengenrtl.c (excluded_rtx): Check CONST_FIXED to exclude.
	* cse.c (hash_rtx): Support CONST_FIXED.
	(exp_equiv_p): Likewise.
	(cannon_reg): Likewise.
	(fold_rtx): Likewise.
	(equiv_constant): Likewise.
	(cse_process_notes_1): Likewise.
	(count_reg_usage): Likewise.
	* cselib.c (entry_and_rtx_equal_p): Check CONST_FIXED.
	(rtx_equal_for_cselib_p): Handle CONST_FIXED.
	(wrap_constant): Check CONST_FIXED.
	(cselib_hash_rtx): Support CONST_FIXED.
	(cselib_subst_to_values): Likewise.
	* df-scan.c (df_uses_record): Likewise.
	* gcse.c (want_to_gcse_p): Likewise.
	(oprs_unchanged_p): Likewise.
	(oprs_not_set_p): Likewise.
	(compute_transp): Likewise.
	(extract_mentioned_regs_helper): Likewise.
	* genemit.c (gen_exp): Likewise.
	* local-alloc.c (equiv_init_varies_p): Likewise.
	(contains_replace_regs): Likewise.
	(memref_referenced_p): Likewise.
	* loop-invariant.c (check_maybe_invariant): Likewise.
	(hash_invariant_expr_1): Likewise.
	(invariant_expr_equal_p): Likewise.
	* postreload-gcse.c (oprs_unchanged_p): Likewise.
	* regclass.c (reg_scan_mark_refs): Likewise.
	* regrename.c (scan_rtx): Likewise.
	* resource.c (mark_referenced_resources): Likewise.
	(mark_set_resources): Likewise.
	* rtlanal.c (rtx_unstable_p): Likewise.
	(rtx_varies_p): Likewise.
	(count_occurrences): Likewise.
	(reg_mentioned_p): Likewise.
	(modified_between_p): Likewise.
	(modified_in_p): Likewise.
	(volatile_insn_p): Likewise.
	(volatile_refs_p): Likewise.
	(side_effects_p): Likewise.
	(may_trap_p_1): Likewise.
	(inequality_comparisons_p): Likewise.
	(computed_jump_p_1): Likewise.
	(commutative_operand_precedence): Likewise.
	* sched-deps.c (sched_analyze_2): Likewise.
	* sched-vis.c (print_value): Likewise.
	* reload.c (operands_match_p): Likewise.
	(subst_reg_equivs): Likewise.
	* reload1.c (eliminate_regs_1): Likewise.
	(elimination_effects): Likewise.
	(scan_paradoxical_subregs): Likewise.
	* alias.c (rtx_equal_for_memref_p): Likewise.
	* Makefile.in (RTL_BASE_H): Add fixed-value.h.
	* emit-rtl.c (const_fixed_htab): New hash table.
	(const_fixed_htab_hash, const_fixed_htab_eq, lookup_const_fixed):
	Declare.
	(const_fixed_htab_hash, const_fixed_htab_eq, lookup_const_fixed,
	const_fixed_from_fixed_value): New functions.
	(verify_rtx_sharing): Handle CONST_FIXED.
	(copy_rtx_if_shared_1): Likewise.
	(reset_used_flags): Likewise.
	(set_used_flags): Likewise.
	(copy_insn_1): Likewise.
	(init_emit_once): Create const_fixed_htab.
	Store fixed-point scalar and vector zero and one to const_tiny_rtx.

From-SVN: r127725
2007-08-23 00:30:39 +00:00
Kaveh R. Ghazi 22ea9ec0e8 alias.c (component_uses_parent_alias_set): Constify.
* alias.c (component_uses_parent_alias_set): Constify.
	* alias.h (component_uses_parent_alias_set): Likewise.
	* cfgrtl.c (print_rtl_with_bb): Likewise.
	* double-int.c (tree_to_double_int, double_int_fits_to_tree_p,
	mpz_get_double_int): Likewise.
	* double-int.h (double_int_fits_to_tree_p, tree_to_double_int,
	mpz_get_double_int): Likewise.
	* expr.c (is_aligning_offset, undefined_operand_subword_p,
	mostly_zeros_p, all_zeros_p, safe_from_p, is_aligning_offset):
	Likewise.
	* expr.h (safe_from_p): Likewise.
	* gimple-low.c (try_catch_may_fallthru, block_may_fallthru):
	Likewise.
	* gimplify.c (should_carry_locus_p, zero_sized_field_decl,
	zero_sized_type, goa_lhs_expr_p): Likewise.
	* omp-low.c (is_variable_sized, use_pointer_for_field): Likewise.
	* rtl.h (print_rtl_with_bb): Likewise.
	* sched-vis.c (print_exp, print_value, print_pattern): Likewise.
	* tree-cfg.c (const_first_stmt, const_last_stmt): New.
	* tree-flow-inline.h (bb_stmt_list): Constify.
	(cbsi_start, cbsi_last, cbsi_end_p, cbsi_next, cbsi_prev,
	cbsi_stmt): New.
	* tree-flow.h (const_block_stmt_iterator, cbsi_start, cbsi_last,
	const_first_stmt, const_last_stmt): New.
	(block_may_fallthru, empty_block_p): Constify.
	* tree-iterator.c (EXPR_FIRST_BODY, EXPR_LAST_BODY,
	EXPR_ONLY_BODY): New.
	(expr_first, expr_last, expr_only): Use macro for body.
	(const_expr_first, const_expr_last, const_expr_only): New.
	* tree-iterator.h (const_tree_stmt_iterator, ctsi_start,
	ctsi_last, ctsi_end_p, ctsi_one_before_end_p, ctsi_next,
	ctsi_prev, ctsi_stmt): New.
	* tree-scalar-evolution.c (get_loop_exit_condition): Constify.
	* tree-scalar-evolution.h (get_loop_exit_condition): Likewise.
	* tree-ssa-loop-niter.c (loop_only_exit_p,
	derive_constant_upper_bound): Likewise.
	* tree-ssa-phiopt.c (empty_block_p): Likewise.
	* tree-ssa-threadupdate.c (redirection_block_p): Likewise.
	* tree-vectorizer.c (slpeel_can_duplicate_loop_p): Likewise.
	* tree-vectorizer.h (slpeel_can_duplicate_loop_p): Likewise.
	* tree-vrp.c (vrp_bitmap_equal_p): Likewise.
	* tree.c (get_type_static_bounds): Likewise.
	* tree.h (const_expr_first, const_expr_last, const_expr_only): New.
	(get_type_static_bounds): Constify.

From-SVN: r127483
2007-08-14 15:18:11 +00:00
Kaveh R. Ghazi ed7a4b4b30 alias.c (rtx_equal_for_memref_p): Constify.
* alias.c (rtx_equal_for_memref_p): Constify.
	* basic-block.h (const_edge, const_basic_block): New.
	(reg_set_to_hard_reg_set, dfs_enumerate_from, single_succ_p,
	single_pred_p, single_succ_edge, single_pred_edge, single_succ,
	single_pred, maybe_hot_bb_p, probably_cold_bb_p,
	probably_never_executed_bb_p, edge_probability_reliable_p,
	br_prob_note_reliable_p, forwarder_block_p, flow_nodes_print,
	inside_basic_block_p, control_flow_insn_p, dominated_by_p):
	Likewise.
	* bb-reorder.c (better_edge_p, push_to_next_round_p): Likewise.
	* bt-load.c (basic_block_freq, insn_sets_btr_p, can_move_up):
	Likewise.
	* cfganal.c (flow_active_insn_p, forwarder_block_p,
	flow_nodes_print, dfs_enumerate_from): Likewise.
	* cfgbuild.c (count_basic_blocks, inside_basic_block_p,
	control_flow_insn_p, count_basic_blocks): Likewise.
	* cfgloop.c (flow_bb_inside_loop_p, glb_enum_p,
	get_loop_body_with_size, loop_exit_edge_p): Likewise.
	* cfgloop.h (flow_bb_inside_loop_p, num_loop_insns,
	average_num_loop_insns, loop_exit_edge_p,
	just_once_each_iteration_p, can_duplicate_loop_p): Likewise.
	* cfgloopanal.c (just_once_each_iteration_p, num_loop_insns,
	average_num_loop_insns, seq_cost): Likewise.
	* cfgloopmanip.c (rpe_enum_p, can_duplicate_loop_p): Likewise.
	* dominance.c (dominated_by_p): Likewise.
	* emit-rtl.c (validate_subreg): Likewise.
	* except.c (can_throw_internal, can_throw_external): Likewise.
	* except.h (can_throw_internal, can_throw_external): Likewise.
	* gcse.c (gcse_constant_p, oprs_unchanged_p, oprs_anticipatable_p,
	oprs_available_p, hash_expr, expr_equiv_p, oprs_not_set_p,
	compute_transp, load_killed_in_block_p, reg_killed_on_edge,
	simple_mem, store_ops_ok, load_kills_store, find_loads,
	store_killed_in_insn, store_killed_after, store_killed_before,
	gcse_mem_operand, implicit_set_cond_p, store_killed_in_pat):
	Likewise.
	* ifcvt.c (count_bb_insns, cheap_bb_rtx_cost_p, noce_operand_ok,
	noce_mem_write_may_trap_or_fault_p): Likewise.
	* pointer-set.c (pointer_set_contains, pointer_map_contains):
	Likewise.
	* pointer-set.h (pointer_set_contains, pointer_map_contains):
	Likewise.
	* predict.c (can_predict_insn_p, maybe_hot_bb_p,
	probably_cold_bb_p, probably_never_executed_bb_p,
	edge_probability_reliable_p, br_prob_note_reliable_p,
	can_predict_insn_p): Likewise.
	* regclass.c (reg_set_to_hard_reg_set): Likewise.
	* resource.c (return_insn_p): Likewise.
	* rtl.h (reg_set_between_p, reg_set_p, validate_subreg):
	Likewise.
	* rtlanal.c (reg_set_between_p, reg_set_p): Likewise.
	* tracer.c (count_insns, ignore_bb_p, better_p): Likewise.
	* tree-cfg.c (verify_gimple_unary_expr, verify_gimple_binary_expr,
	verify_gimple_modify_stmt): Likewise.
	* tree-chrec.c (is_not_constant_evolution,
	is_multivariate_chrec_rec, is_multivariate_chrec,
	chrec_contains_symbols, chrec_contains_undetermined,
	tree_contains_chrecs, evolution_function_is_affine_multivariate_p,
	evolution_function_is_univariate_p, avoid_arithmetics_in_type_p,
	eq_evolutions_p, scev_direction): Likewise.
	* tree-chrec.h (automatically_generated_chrec_p, tree_is_chrec,
	eq_evolutions_p, is_multivariate_chrec, chrec_contains_symbols,
	chrec_contains_symbols_defined_in_loop,
	chrec_contains_undetermined, tree_contains_chrecs,
	evolution_function_is_affine_multivariate_p,
	evolution_function_is_univariate_p, chrec_zerop,
	evolution_function_is_constant_p, evolution_function_is_affine_p,
	evolution_function_is_affine_or_constant_p,
	tree_does_not_contain_chrecs, chrec_type): Likewise.
	* tree-data-ref.c (tree_fold_divides_p,
	object_address_invariant_in_loop_p, dr_may_alias_p,
	ziv_subscript_p, siv_subscript_p, gcd_of_steps_may_divide_p,
	same_access_functions, constant_access_functions,
	access_functions_are_affine_or_constant_p, find_vertex_for_stmt):
	Likewise.
	* tree-flow.h (scev_direction): Likewise.
	* tree-gimple.c (is_gimple_stmt): Likewise.
	* tree-outof-ssa.c (identical_copies_p, identical_stmt_lists_p):
	Likewise.
	* tree-pretty-print.c (op_prio): Likewise.
	* tree-scalar-evolution.c (chrec_contains_symbols_defined_in_loop,
	analyzable_condition, backedge_phi_arg_p): Likewise.
	* tree-scalar-evolution.h (get_chrec_loop): Likewise.
	* tree-ssa-operands.c (get_name_decl, operand_build_cmp): Likewise.
	* tree-ssa-threadupdate.c (dbds_continue_enumeration_p):
	Likewise.

From-SVN: r127404
2007-08-14 04:44:35 +00:00
Ian Lance Taylor 4862826d55 alias.h (alias_set_type): Define new type.
./:	* alias.h (alias_set_type): Define new type.
	(ALIAS_SET_MEMORY_BARRIER): Use it.
	* rtl.h: Include alias.h.
	(struct mem_attrs): Use alias_set_type.
	* tree.h: Include alias.h
	(struct tree_type): Use alias_set_type.
	(struct tree_struct_field_tag): Likewise.
	(struct tree_decl_common): Likewise.
	* alias.c (struct alias_set_entry): Use alias_set_type.
	(get_alias_set_entry, alias_set_subset_of): Likewise.
	(alias_sets_conflict_p): Likewise.
	(alias_sets_must_conflict_p): Likewise.
	(objects_must_conflict_p): Likewise.
	(get_alias_set, new_alias_set): Likewise.
	(record_alias_subset, record_component_aliases): Likewise.
	(varargs_set, frame_set): Change to alias_set_type.
	(get_varargs_alias_set): Use alias_set_type.
	(get_frame_alias_set): Likewise.
	* builtins.c (setjmp_alias_set): Change to alias_set_type.
	* dse.c (struct store_info): Use alias_set_type.
	(struct read_info, struct clear_alias_mode_holder): Likewise.
	(clear_alias_set_lookup, canon_address): Likewise.
	(record_store, check_mem_read_rtx): Likewise.
	(dse_record_singleton_alias_set): Likewise.
	(dse_invalidate_singleton_alias_set): Likewise.
	* emit-rtl.c (get_mem_attrs): Likewise.
	(set_mem_attributes_minus_bitpos): Likewise.
	(set_mem_alias_set): Likewise.
	* expr.c (store_constructor_field, store_field): Likewise.
	* gimplify.c (struct gimplify_init_ctor_preeval_data): Likewise.
	* langhooks.c (lhd_get_alias_set): Likewise.
	* langhooks-def.h (lhd_get_alias_set): Likewise.
	* reload1.c (alter_reg): Likewise.
	* tree-flow.h (struct fieldoff): Likewise.
	* tree-ssa-alias.c (struct alias_map_d): Likewise.
	(may_alias_p, get_smt_for, create_sft): Likewise.
	* tree-ssa-alias-warnings.c (nonstandard_alias_types_p): Likewise.
	* tree-ssa-structalias.c (set_uids_in_ptset): Likewise.
	(merge_smts_into): Likewise.
	* varasm.c (const_alias_set): Likewise.
	* c-common.c (strict_aliasing_warning): Likewise.
	(c_common_get_alias_set): Likewise.
	* dse.h (dse_record_singleton_alias_set): Update declaration.
	(dse_invalidate_singleton_alias_set): Likewise.
	* emit-rtl.h (set_mem_alias_set): Likewise.
	* c-common.h (c_common_get_alias_set): Likewise.
	* print-rtl.c (print_rtx): Cast MEM_ALIAS_SET when printing it.
	* print-tree.c (print_node): Likewise.
	* config/alpha/alpha.c (alpha_sr_alias_set): Change to
	alias_set_type.
	(alpha_setup_incoming_varargs): Use alias_set_type.
	* config/i386/i386.c (setup_incoming_varargs_64): Use
	alias_set_type.
	(setup_incoming_varargs_ms_64): Likewise.
	(ix86_GOT_alias_set): Likewise.
	* config/mn10300/mn10300.c (mn10300_builtin_saveregs): Likewise.
	* config/rs6000/rs6000.c (setup_incoming_varargs): Likewise.
	(set): Change to alias_set_type.
	(get_TOC_alias_set): Use alias_set_type.
	* config/rs6000/rs6000-protos.h (get_TOC_alias_set): Update
	declaration.
	* config/sh/sh.c (sh_builtin_saveregs): Use alias_set_type.
	* config/sparc/sparc.c (sparc_sr_alias_set): Change to
	alias_set_type.
	(struct_value_alias_set): Likewise.
	* Makefile.in (GTFILES): Add $(srcdir)/alias.h.
ada/:
	* misc.c (gnat_get_alias_set): Change return type to
	alias_set_type.
cp/:
	* cp-objcp-common.c (cxx_get_alias_set): Change return type to
	alias_set_type.
	* cp/cp-tree.h (cxx_get_alias_set): Update declaration.
fortran:/
	* f95-lang.c (gfc_get_alias_set): Change return type to
	alias_set_type.

From-SVN: r127362
2007-08-11 17:21:56 +00:00
Kaveh R. Ghazi 7bc980e1d9 alias.c (record_set, [...]): Constify.
* alias.c (record_set, memory_modified_1): Constify.
	* bt-load.c (note_btr_set): Likewise.
	* caller-save.c (mark_set_regs, add_stored_regs): Likewise.
	* combine.c (set_nonzero_bits_and_sign_copies,
	expand_field_assignment, record_dead_and_set_regs_1,
	use_crosses_set_p, reg_dead_at_p_1, can_combine_p,
	likely_spilled_retval_1): Likewise.
	* config/frv/frv.c (frv_registers_update_1, frv_io_check_address,
	frv_io_handle_set): Likewise.
	* config/mips/mips.c (mips_sim_record_set,
	vr4130_true_reg_dependence_p_1): Likewise.
	* config/mt/mt.c (insn_dependent_p_1): Likewise.
	* config/s390/s390.c (s390_reg_clobbered_rtx): Likewise.
	* config/sh/sh.c (flow_dependent_p_1): Likewise.
	* cselib.c (cselib_invalidate_rtx_note_stores): Likewise.
	* dce.c (mark_nonreg_stores_1, mark_nonreg_stores_2): Likewise.
	* ddg.c (mark_mem_store): Likewise.
	* df-problems.c (df_urec_mark_reg_change): Likewise.
	* function.c (update_epilogue_consts): Likewise.
	* gcse.c (record_set_info, record_last_set_info,
	mems_conflict_for_gcse_p, canon_list_insert, reg_set_info,
	reg_clear_last_set): Likewise.
	* global.c (mark_reg_store, mark_reg_clobber, reg_becomes_live):
	Likewise.
	* jump.c (reversed_comparison_code_parts): Likewise.
	* local-alloc.c (validate_equiv_mem_from_store, no_equiv,
	reg_is_set): Likewise.
	* loop-iv.c (mark_altered): Likewise.
	* mode-switching.c (reg_becomes_live): Likewise.
	* optabs.c (no_conflict_move_test): Likewise.
	* postreload-gcse.c (record_last_set_info, find_mem_conflicts):
	Likewise.
	* postreload.c (reload_combine_note_store, move2add_note_store):
	Likewise.
	* regmove.c (flags_set_1): Likewise.
	* regrename.c (note_sets, kill_clobbered_value, kill_set_value):
	Likewise.
	* reload1.c (mark_not_eliminable, forget_old_reloads_1):
	Likewise. 
	* resource.c (update_live_status): Likewise.
	* rtl.h (set_of, note_stores): Likewise.
	* rtlanal.c (set_of_1, parms_set, struct set_of_data, set_of,
	note_stores, parms_set): Likewise.
	* sched-rgn.c (sets_likely_spilled_1): Likewise.
	* stack-ptr-mod.c (notice_stack_pointer_modification_1):
	Likewise. 
	* var-tracking.c (count_stores, add_stores): Likewise.

From-SVN: r127065
2007-07-30 16:30:18 +00:00
Kaveh R. Ghazi 4f5888905c alias.c (mems_in_disjoint_alias_sets_p, [...]): Constify.
* alias.c (mems_in_disjoint_alias_sets_p,
	fixed_scalar_and_varying_struct_p, aliases_everything_p,
	nonoverlapping_component_refs_p, nonoverlapping_memrefs_p,
	write_dependence_p, mems_in_disjoint_alias_sets_p,
	read_dependence, true_dependence, canon_true_dependence,
	anti_dependence, output_dependence): Constify.
	* combine.c (extended_count): Likewise.
	* cse.c (cse_rtx_varies_p, hash_rtx, exp_equiv_p): Likewise.
	* cselib.c (get_value_hash, references_value_p,
	cselib_reg_set_mode, cselib_rtx_varies_p): Likewise.
	* cselib.h (cselib_reg_set_mode, references_value_p): Likewise.
	* emit-rtl.c (mem_expr_equal_p, active_insn_p): Likewise.
	* function.c (contains, prologue_epilogue_contains,
	sibcall_epilogue_contains): Likewise. 
	* jump.c (simplejump_p, condjump_p, condjump_in_parallel_p,
	pc_set, any_uncondjump_p, any_condjump_p, onlyjump_p,
	only_sets_cc0_p, sets_cc0_p, rtx_renumbered_equal_p, true_regnum,
	reg_or_subregno): Likewise.
	* recog.c (asm_noperands): Likewise.
	* reload1.c (function_invariant_p): Likewise.
	* rtl.h (mem_expr_equal_p, active_insn_p, rtx_varies_p,
	rtx_addr_varies_p, asm_noperands, exp_equiv_p, hash_rtx,
	condjump_p, any_condjump_p, any_uncondjump_p, pc_set,
	simplejump_p, onlyjump_p, only_sets_cc0_p, sets_cc0_p,
	true_regnum, reg_or_subregno, condjump_in_parallel_p,
	extended_count, prologue_epilogue_contains,
	sibcall_epilogue_contains, function_invariant_p, true_dependence,
	canon_true_dependence, read_dependence, anti_dependence,
	output_dependence): Likewise.
	* rtlanal.c (rtx_varies_p, rtx_addr_varies_p): Likewise.

java:
	* jcf-io.c (find_class): Fix -Wcast-qual warnings.

From-SVN: r127063
2007-07-30 15:35:02 +00:00
Kaveh R. Ghazi fa233e34c9 attribs.c (hash_attr, [...]): Constify.
* attribs.c (hash_attr, eq_attr, init_attributes): Constify.
	* builtins.c (validate_arg, builtin_mathfn_code,
	validate_arglist): Likewise.
	* calls.c (call_expr_flags): Likewise.
	* combine.c (reg_nonzero_bits_for_combine,
	reg_num_sign_bit_copies_for_combine, get_last_value,
	reg_truncated_to_mode): Likewise.
	* emit-rtl.c (subreg_lowpart_p): Likewise.
	* expr.c (highest_pow2_factor_for_target,
	categorize_ctor_elements_1, categorize_ctor_elements,
	count_type_elements, contains_packed_reference,
	highest_pow2_factor, highest_pow2_factor_for_target): Likewise.
	* fold-const.c (may_negate_without_overflow_p, int_const_binop,
	fold_convertible_p, operand_equal_p, tree_swap_operands_p,
	native_encode_int, native_encode_real, native_encode_complex,
	native_encode_vector, native_encode_expr, native_interpret_int,
	native_interpret_real, native_interpret_complex,
	native_interpret_vector, native_interpret_expr): Likewise.
	* function.c (use_register_for_decl): Likewise.
	* gimplify.c (get_name): Likewise.
	* langhooks-def.h (lhd_return_null_const_tree): New.
	(LANG_HOOKS_GET_CALLEE_FNDECL): Use it.
	* langhooks.c (lhd_return_null_const_tree): New.
	* langhooks.h (lang_get_callee_fndecl): Constify.
	* output.h (constructor_static_from_elts_p): Likewise.
	* rtl-factoring.c (gen_symbol_ref_rtx_for_label): Likewise.
	* rtl.h (nonzero_bits, num_sign_bit_copies, truncated_to_mode,
	subreg_lowpart_p, noop_move_p, struct rtl_hooks): Likewise.
	* rtlanal.c (cached_nonzero_bits, nonzero_bits1,
	cached_num_sign_bit_copies, num_sign_bit_copies1, noop_move_p,
	nonzero_bits, num_sign_bit_copies, truncated_to_mode): Likewise.
	* rtlhooks-def.h (reg_nonzero_bits_general,
	reg_num_sign_bit_copies_general, reg_truncated_to_mode_general):
	Likewise. 
	* rtlhooks.c (reg_num_sign_bit_copies_general,
	reg_nonzero_bits_general, reg_truncated_to_mode_general):
	Likewise. 
	* stmt.c (warn_if_unused_value, is_body_block): Likewise.
	* stor-layout.c (mode_for_size_tree): Likewise.
	* tree-ssa-loop-im.c (memref_eq): Likewise.
	* tree-ssa-loop-ivopts.c (tree_int_cst_sign_bit): Likewise.
	* tree.c (contains_placeholder_p, type_list_equal,
	simple_cst_equal, get_callee_fndecl, operand_equal_for_phi_arg_p):
	Likewise. 
	* tree.h (tree_int_cst_sign_bit, may_negate_without_overflow_p,
	mode_for_size_tree, categorize_ctor_elements, count_type_elements,
	contains_placeholder_p, contains_packed_reference,
	get_callee_fndecl, operand_equal_for_phi_arg_p,
	warn_if_unused_value, is_body_block, native_encode_expr,
	native_interpret_expr, fold_convertible_p, operand_equal_p,
	int_const_binop, tree_swap_operands_p, builtin_mathfn_code,
	validate_arglist, simple_cst_equal, type_list_equal,
	use_register_for_decl, call_expr_flags, get_name,
	highest_pow2_factor): Likewise.
	(const_call_expr_arg_iterator_d,
	init_const_call_expr_arg_iterator, next_const_call_expr_arg,
	first_const_call_expr_arg, more_const_call_expr_args_p,
	FOR_EACH_CONST_CALL_EXPR_ARG): New.
	* varasm.c (constructor_static_from_elts_p): Constify.
	
cp:
	* parser.c (eof_token): Un-constify.
	(cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc,
	cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious
	casts.

java:
	* lang.c (java_get_callee_fndecl): Constify.

objc:
	* objc-act.c (objc_get_callee_fndecl): Constify.
	* objc-act.h (objc_get_callee_fndecl): Likewise.

From-SVN: r127036
2007-07-29 05:43:43 +00:00
Nick Clifton 9dcd6f09a3 Change copyright header to refer to version 3 of the GNU General Public License and to point readers at the COPYING3 file and the FSF's license web page.
From-SVN: r126948
2007-07-26 08:37:01 +00:00
Kaveh R. Ghazi f7d504c227 cfglayout.c (insn_scope, insn_line): Constify.
* cfglayout.c (insn_scope, insn_line): Constify.
	* emit-rtl.c (const_int_htab_hash, const_int_htab_eq,
	const_double_htab_hash, const_double_htab_eq,
	mem_attrs_htab_hash): Likewise.
	* loop-iv.c (biv_eq): Likewise.
	* print-rtl.c (print_rtx, print_decl_name, print_mem_expr,
	print_inline_rtx, debug_rtx, debug_rtx_list, debug_rtx_range,
	debug_rtx_find, print_rtl, print_rtl_single, print_simple_rtl):
	Likewise. 
	* rtl-error.c (location_for_asm, diagnostic_for_asm,
	error_for_asm, warning_for_asm, _fatal_insn,
	_fatal_insn_not_found): Likewise. 
	* rtl.c (rtx_size, shared_const_p, shallow_copy_rtx_stat,
	rtx_equal_p, rtl_check_failed_bounds, rtl_check_failed_type1,
	rtl_check_failed_type2, rtl_check_failed_code1,
	rtl_check_failed_code2, rtl_check_failed_code_mode,
	rtvec_check_failed_bounds, rtl_check_failed_flag): Likewise.
	* rtl.h (rtl_check_failed_bounds, rtl_check_failed_type1,
	rtl_check_failed_type2, rtl_check_failed_code1,
	rtl_check_failed_code2, rtl_check_failed_code_mode,
	rtvec_check_failed_bounds, rtl_check_failed_flag, LABEL_KIND,
	SET_LABEL_KIND, rhs_regno, subreg_lsb, subreg_regno, subreg_nregs,
	shared_const_p, rtx_size, shallow_copy_rtx_stat, rtx_equal_p,
	get_pool_mode, insn_line, insn_file, simplify_replace_rtx,
	mode_signbit_p, rtx_addr_can_trap_p, nonzero_address_p,
	rtx_unstable_p, get_integer_term, get_related_value,
	offset_within_block_p, reg_mentioned_p, count_occurrences,
	reg_referenced_p, reg_used_between_p, no_labels_between_p,
	single_set_2, multiple_sets, set_noop_p, refers_to_regno_p,
	reg_overlap_mentioned_p, dead_or_set_p, dead_or_set_regno_p,
	find_reg_note, find_regno_note, find_reg_equal_equiv_note,
	find_constant_src, find_reg_fusage, find_regno_fusage,
	pure_call_p, remove_note, side_effects_p, volatile_refs_p,
	volatile_insn_p, may_trap_p, may_trap_after_code_motion_p,
	may_trap_or_fault_p, inequality_comparisons_p, tablejump_p,
	computed_jump_p, auto_inc_p, in_expr_list_p,
	remove_node_from_expr_list, loc_mentioned_in_p,
	label_is_jump_target_p, reversed_comparison_code_parts,
	debug_rtx, debug_rtx_list, debug_rtx_range, debug_rtx_find,
	print_mem_expr, print_rtl, print_simple_rtl, print_rtl_single,
	print_inline_rtx): Likewise.
	* rtlanal.c (covers_regno_p, covers_regno_no_parallel_p,
	computed_jump_p_1, nonzero_bits1, rtx_unstable_p,
	rtx_addr_can_trap_p_1, rtx_addr_can_trap_p, nonzero_address_p,
	get_integer_term, get_related_value, offset_within_block_p,
	count_occurrences, reg_mentioned_p, no_labels_between_p,
	reg_used_between_p, reg_referenced_p, single_set_2,
	multiple_sets, set_noop_p, refers_to_regno_p,
	reg_overlap_mentioned_p, dead_or_set_p,
	covers_regno_no_parallel_p, covers_regno_p,
	dead_or_set_regno_p, find_reg_note, find_regno_note,
	find_reg_equal_equiv_note, find_constant_src, find_reg_fusage,
	find_regno_fusage, pure_call_p, remove_note, in_expr_list_p,
	remove_node_from_expr_list, volatile_insn_p, volatile_refs_p,
	side_effects_p, may_trap_p_1, may_trap_p,
	may_trap_after_code_motion_p, may_trap_or_fault_p,
	inequality_comparisons_p, tablejump_p, computed_jump_p_1,
	computed_jump_p, auto_inc_p, loc_mentioned_in_p, subreg_lsb,
	subreg_regno, subreg_nregs, label_is_jump_target_p): Likewise.
	* simplify-rtx.c (neg_const_int, plus_minus_operand_p,
	mode_signbit_p, simplify_replace_rtx, plus_minus_operand_p):
	Likewise. 
	* toplev.h (_fatal_insn_not_found, _fatal_insn, error_for_asm,
	warning_for_asm): Likewise.
	* tree.h (print_rtl): Likewise.
	* varasm.c (get_pool_mode): Likewise.

From-SVN: r126922
2007-07-25 18:33:26 +00:00
Kaveh R. Ghazi a57193e811 coretypes.h (const_bitmap, [...]): New.
* coretypes.h (const_bitmap, const_rtx, const_rtvec, const_tree):
	New.
	
	* rtl.h (RTL_CHECK1, RTL_CHECK2, RTL_CHECKC1, RTL_CHECKC2,
	RTVEC_ELT, XWINT, XCWINT, XCMWINT, XCNMPRV, BLOCK_SYMBOL_CHECK,
	RTL_FLAG_CHECK1, RTL_FLAG_CHECK2, RTL_FLAG_CHECK3,
	RTL_FLAG_CHECK4, RTL_FLAG_CHECK5, RTL_FLAG_CHECK6,
	RTL_FLAG_CHECK7, RTL_FLAG_CHECK8, LABEL_KIND, SET_LABEL_KIND):
	Preserve const-ness of parameters through use of __typeof(),
	also constify and tidy.
	
	* tree.h (TREE_CHECK, TREE_NOT_CHECK, TREE_CHECK2,
	TREE_NOT_CHECK2, TREE_CHECK3, TREE_NOT_CHECK3, TREE_CHECK4,
	NON_TREE_CHECK4, TREE_CHECK5, TREE_NOT_CHECK5,
	CONTAINS_STRUCT_CHECK, TREE_CLASS_CHECK, TREE_RANGE_CHECK,
	OMP_CLAUSE_SUBCODE_CHECK, OMP_CLAUSE_RANGE_CHECK, EXPR_CHECK,
	GIMPLE_STMT_CHECK, NON_TYPE_CHECK, TREE_VEC_ELT_CHECK,
	PHI_NODE_ELT_CHECK, OMP_CLAUSE_ELT_CHECK, TREE_OPERAND_CHECK,
	TREE_OPERAND_CHECK_CODE, GIMPLE_STMT_OPERAND_CHECK,
	TREE_RTL_OPERAND_CHECK, TREE_CHAIN, TREE_TYPE): Likewise.

From-SVN: r126918
2007-07-25 18:00:08 +00:00
Peter Bergner 7e0b4eaea1 PR middle-end/PR28690
PR middle-end/PR28690
	* optabs.c (expand_binop): (emit_cmp_and_jump_insns): Allow EQ compares.
	* rtlanal.c (commutative_operand_precedence): Prefer both REG_POINTER
	and MEM_POINTER operands over REG and MEM operands.
	(swap_commutative_operands_p): Change return value to bool.
	* rtl.h: Update the corresponding prototype.
	* tree-ssa-address.c (gen_addr_rtx): Use simplify_gen_binary
	instead of gen_rtx_PLUS.
	* simplify-rtx.c (simplify_plus_minus_op_data_cmp): Change return
	value to bool.  Change function arguments to rtx's and update code
	to match.
	(simplify_plus_minus): Update the simplify_plus_minus_op_data_cmp
	calls to match the new declaration.
	* simplify-rtx.c (simplify_associative_operation): Don't
	reorder simplify_binary_operation arguments.

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

From-SVN: r126852
2007-07-23 11:43:24 -05:00
Caroline Tice 62760ffd15 Add ability to track uninitialized variables, and mark uninitialized variables in the Dwarf debug info.
Add ability to track uninitialized variables, and mark uninitialized
variables in the Dwarf debug info.  Controlled by compile option
-fvar-tracking-uninit

From-SVN: r126630
2007-07-13 16:11:15 -07:00
Kenneth Zadeck ef4375b218 toplev.c (no_new_pseudos): Deleted.
2007-07-11  Kenneth Zadeck <zadeck@naturalbridge.com>

	* toplev.c (no_new_pseudos): Deleted.
	* rtl.h (no_new_pseudos): Deleted.
	* tree-pass.h (pass_no_new_pseudos): Deleted. 
	* passes.c (pass_no_new_pseudos): Deleted.
	* final.c (rest_of_clean_state): Removed no_new_pseudos.
	(rest_of_no_new_pseudos, pass_no_new_pseudos): Deleted.
	* struct-equiv.c (rtx_equiv_p): Replaced no_new_pseudos with 
	reload_completed.
	* cfgcleanup.c (try_crossjump_to_edge): Ditto. 
	* rtlhooks.c (gen_lowpart_general): Ditto.
	* optabs.c (prepare_operand): Ditto.
	* mode-switching.c (rest_of_handle_mode_switching): Deleted set of
	no_new_pseudos.
	* modulo-sched.c (rest_of_handle_sms): Ditto.
	* see.c (rest_of_handle_see): Ditto.
	* ifcvt.c (if_convert): Ditto.
	(gate_handle_if_after_combine): Replaced no_new_pseudos with 
	reload_completed.
	* init-regs.c (gate_initialize_regs): Deleted set of
	no_new_pseudos.
	* lower-subreg.c (decompose_multiword_subregs): Ditto. 
	* bb-reorder.c (rest_of_handle_partition_blocks): Ditto.
	* doc/md.texi: Changed no_new_pseudos to can_create_pseudo_p.

From-SVN: r126561
2007-07-11 22:57:51 +00:00
Ian Lance Taylor b3a134196f Replace no_new_pseudos in backends.
* rtl.h (can_create_pseudo_p): Define.
	* config/darwin.c (machopic_indirect_data_reference): Use
	can_create_pseudo_p () instead of no_new_pseudos.
	(machopic_indirect_data_reference): Likewise.
	(machopic_legitimize_pic_address): Likewise.
	* config/alpha/alpha.c (alpha_legitimize_address): Likewise.
	(alpha_emit_set_const_1): Likewise.
	(alpha_emit_set_const): Likewise.
	(alpha_emit_conditional_move): Likewise.
	(alpha_split_conditional_move): Likewise.
	* config/alpha/alpha.md (various splitters): Likewise.
	(movti): Likewise.
	* config/arm/arm.c (legitimize_pic_address): Likewise.
	(arm_load_pic_register): Likewise.
	* config/arm/arm.md (addsi3, subsi3, andsi3, iorsi3): Likewise.
	(movdi, movsi, movhi, movqi, movsf, movdf): Likewise.
	* config/bfin/bfin.c (legitimize_pic_address): Likewise.
	* config/cris/cris.c (cris_expand_pic_call_address): Likewise.
	* config/cris/cris.md (movsi): Likewise.
	* config/frv/frv.md (symGOT2reg_hilo): Likewise.
	(symGOTOFF2reg_hilo): Likewise.
	(symGPREL2reg, symGPREL2reg_hilo): Likewise.
	* config/h8300/h8300.md (insv, extzv): Likewise.
	* config/i386/i386.c (ix86_expand_move): Likewise.
	(ix86_expand_vector_move): Likewise.
	(ix86_prepare_fp_compare_args): Likewise.
	(ix86_expand_carry_flag_compare): Likewise.
	* config/i386/i386.md (tls_dynamic_gnu2_32): Likewise.
	(tls_dynamic_gnu2_combine_32): Likewise.
	(tls_dynamic_gnu2_64, tls_dynamic_gnu2_combine_64): Likewise.
	* config/ia64/ia64.c (ia64_expand_move): Likewise.
	(ia64_expand_movxf_movrf): Likewise.
	* config/m32c/m32c.c (m32c_prepare_move): Likewise.
	(m32c_split_move): Likewise.
	(m32c_expand_insv): Likewise.
	* config/m68k/m68k.md (movsi): Likewise.
	* config/mips/mips.c (mips_force_temporary): Likewise.
	(mips_split_symbol): Likewise.
	(mips_move_integer): Likewise.
	(mips_legitimize_const_move): Likewise.
	* config/mn10300/mn10300.md (movsi): Likewise.
	* config/pa/pa.c (emit_move_sequence): Likewise.
	* config/rs6000/rs6000.c (rs6000_emit_move): Likewise.
	(rs6000_got_register): Likewise.
	(create_TOC_reference): Likewise.
	(rs6000_machopic_legitimize_pic_address): Likewise.
	* config/rs6000/rs6000.md (add<mode>3): Likewise.
	(various splitters): Likewise.
	(iorsi3, xorsi3, iordi3, xordi3): Likewise.
	(movsi_got): Likewise.
	* config/s390/s390.c (emit_symbolic_move): Likewise.
	* config/s390/s390.md (movhi, movqi): Likewise.
	(load_multiple, store_multiple): Likewise.
	* config/score/score.c (score_force_temporary): Likewise.
	* config/sh/sh.c (prepare_move_operands): Likewise.
	(prepare_cbranch_operands): Likewise.
	(emit_fpu_switch): Likewise.
	(fpscr_set_from_mem): Likewise.
	* config/sh/sh.md (movdicc, movsicc, movsicc_umin): Likewise.
	(adddi3, subsi3): Likewise.
	(various splitters): Likewise.
	(divsi_inv_fp_combine): Likewise.
	(symGOT_load, symGOTOFF2reg, symDTPOFF2reg): Likewise.
	(seq, slt, sle, sgt, sge, sgtu, sltu, sleu, sgeu): Likewise.
	(sne): Likewise.
	* config/sh/predicates.md (xor_operand): Likewise.
	* config/sparc/sparc.c (legitimize_tls_address): Likewise.
	* config/sparc/sparc.md (movsi_pic_label_ref): Likewise.
	(movdi_pic_label_ref): Likewise.
	* config/spu/spu.c (spu_split_immediate): Likewise.
	* config/alpha/alpha.md (various splitters): Remove test
	!no_new_pseudos || reload_completed.
	* config/ia64/ia64.c (ia64_output_mi_thunk): Don't set
	no_new_pseudos.
	* config/m68k/m68k.c (m68k_output_mi_thunk): Likewise.
	* config/mips/mips.c (mips_output_mi_thunk): Likewise.
	* config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise.
	* config/score/score.c (th_output_mi_thunk): Likewise.
	* config/sh/sh.c (sh_output_mi_thunk): Likewise.
	* config/sparc/sparc.c (sparc_output_mi_thunk): Likewise.

From-SVN: r126517
2007-07-10 17:23:11 +00:00
Kazu Hirata 0a6b055f65 cfgrtl.c (delete_insn_chain_and_edges): Remove.
* cfgrtl.c (delete_insn_chain_and_edges): Remove.
	* rtl.h: Remove the prototype for delete_insn_chain_and_edges.

From-SVN: r126441
2007-07-07 14:20:02 +00:00
Daniel Berlin 6fb5fa3cbc Merge dataflow branch into mainline
From-SVN: r125624
2007-06-11 18:02:15 +00:00
Steve Ellcey bb27eeda7d re PR target/31850 (gcc.c-torture/compile/limits-fnargs.c is slow at compiling for spu-elf)
PR target/31850
	* rtl.h (push_to_sequence2): New.
	* emit-rtl.c (push_to_sequence2): New.
	* function.c (assign_parm_data_all): Add new fields.
	(assign_parm_setup_block): Call push_to_sequence2 instead of 
	push_to_sequence.
	(assign_parm_setup_reg): Ditto.
	(assign_parm_setup_stack): Ditto.
	(assign_parms_unsplit_complex): Ditto.
	(assign_parms): Change field name.

From-SVN: r125532
2007-06-07 16:46:26 +00:00
Zdenek Dvorak a7b87f730f haifa-sched.c (restore_bb_notes): Clear bb field of the notes emited outside of basic block.
* haifa-sched.c (restore_bb_notes): Clear bb field of the notes
	emited outside of basic block.
	* cfgbuild.c (find_bb_boundaries): Clear bb field for insns between
	the created blocks.
	* rtl.h (delete_insn_chain): Declaration changed.
	* cfgrtl.c (delete_insn_chain): Add option to clear bb field for
	non-removed insns.
	(rtl_delete_block, rtl_merge_blocks): Pass true to delete_insn_chain.
	(delete_insn_chain_and_edges, try_redirect_by_replacing_jump,
	rtl_tidy_fallthru_edge, cfg_layout_merge_blocks): Pass false 
	to delete_insn_chain.
	(rtl_verify_flow_info_1): Verify that the insns in header and footer
	do not have bb field set.
	(rtl_verify_flow_info): Verify that insns between basic blocks do not
	have bb field set.
	* recog.c (peephole2_optimize): Add argument to delete_insn_chain call.
	* cfgcleanup.c (try_optimize_cfg): Ditto.

From-SVN: r125492
2007-06-06 14:46:34 +00:00
Jan Hubicka a38e7aa544 gengtype.c (adjust_field_rtx_def): Use NOTE_KIND instead of NOTE_LINE_NUMBER...
* gengtype.c (adjust_field_rtx_def): Use NOTE_KIND instead of
	NOTE_LINE_NUMBER; use NOTE_INSN_BASIC_BLOCK_P when possible.
	* ddg.c (create_ddg): LIkewise.
	* final.c (final): Remove hunk moving line numbernotes around since
	they are no longer present at this stage.
	(final_scan_insn): Use NOTE_KIND instead of
	NOTE_LINE_NUMBER; use NOTE_INSN_BASIC_BLOCK_P when possible.
	(output_asm_label): Likewise.
	* reorg.c (dbr_schedule): Likewise.
	* haifa-sched.c (unlink_other_notes): Likewise.
	* mode-switching.c (optimize_mode_switching): Likewise.
	* graph.c (start_bb): Likewise.
	* rtl.def (NOTE): Update description.
	* jump.c (squeeze_notes): Delete.
	(mark_jump_label): Use NOTE_KIND instead of NOTE_LINE_NUMBER; use
	NOTE_INSN_BASIC_BLOCK_P when possible.
	* ifcvt.c (dead_or_predicable): Remove call of squeeze_notes.
	* dwarf2out.c (gen_label_die): Use NOTE_KIND instead of
        NOTE_LINE_NUMBER; use NOTE_INSN_BASIC_BLOCK_P when possible.
	(dwarf2out_var_location): Likewise.
	* cfgbuild.c (make_edges): Likewise.
	(find_basic_blocks_1): Likewise.
	* function.c (reorder_blocks_1): Likewise.
	(epilogue_done): Likewise.
	(reposition_prologue_and_epilogue_notes): Likewise.
	* print-rtl.c (print_rtx): Likewise; drop code for printing line number
	notes.
	(print_rtl): Likewise.
	(print_rtl_single): Likewise.
	* gcse.c (insert_insn_start_bb): Likewise.
	* alias.c (init_alias_analysis): Likewise.
	* calls.c (fixup_tail_calls): Likewise.
	* except.c (sjlj_emit_function_enter): Likewise.
	* emit-rtl.c (add_insn_after): Likeiwse.
	(emit_label_before): Likewise.
	(emit_label_after): Likewise.
	(emit_note_before, emit_note_after, emit_note): Update
	parameter to be enum insn_note; do not deal with source
	files.
	* cfgcleanup.c (merge_blocks_move_predecessor_nojumps):
	Use NOTE_KIND instead of NOTE_LINE_NUMBER; use NOTE_INSN_BASIC_BLOCK_P
	when possible.
	(merge_blocks_move_successor_nojumps): Simplify now when
	we don't have BLOCK notes.
	(try_optimize_cfg): Likewise.
	* cfglayout.c (skip_insns_after_block): Likewise.
	(record_effective_endpoints): Likewise.
	(duplicate_insn_chain): Likewise.
	* varasm.c (output_constant_pool_1): Likewise.
	* sched-deps.c (sched_analyze): Likewise.
	* rtl.c (NOTE_INSN_MAX_isnt_negative_adjust_NOTE_INSN_BIAS):
	Exterminate.
	(note_insn_name): Simplify now when NOTE_INSN_BIAS is gone.
	* rtl.h (NOTE_SOURCE_LOCATION, NOTE_EXPANDED_LOCATION): Exterminate.
	(SET_INSN_DELETED): Simplify.
	(NOTE_LINE_NUMBER): Exterminate.
	(NOTE_LINE_KIND): New.
	(NOTE_INSN_BASIC_BLOCK_P): Update.
	(enum insn_note): Simplify.
	(GET_NOTE_INSN_NAME) Simplify.
	(emit_note_before, emit_note_after, emit_note): Update prototype.
	(squeeze_notes): Remove.
	* sched-int.h (NOTE_NOT_BB_P): Update.
	* resource.c (mark_target_live_regs): Update.
	* sched-rgn.c (debug_dependencies): Update.
	* sched-vis.c (print_insn): Update.
	* config/alpha/alpha.c (alpha_handle_trap_shadows): Update.
	* config/i386/i386.c (ix86_output_function_epilogue): Update.
	* config/sh/sh.c (sh_adjust_unroll_max): Function dead since gcc 4.0.0.
	(TARGET_ADJUST_UNROLL_MAX): Likewise.
	(split_branches): Update.
	(sh_optimize_target_register_callee_saved): Remove hunk dead since gcc
	4.0.0.
	(sh_adjust_unroll_max): Exterminate.
	* config/c4x/c4x.c (c4x_reorg): Use SET_INSN_DELETED.
	* config/m68hc11/m68hc11.c (m68hc11_check_z_replacement): Likewise.
	(m68hc11_reorg): Likewise.
	* config/ia64/ia64.c (emit_insn_group_barriers): Update.
	(emit_predicate_relation_info): Update.
	(process_for_unwind_directive): Update.
	* config/rs6000/rs6000.c (rs6000_output_function_epilogue): Update.
	(output_call): Update.
	* config/pa/pa.c (output_lbranch): Update.
	(output_millicode_call): Update.
	(output_call): Update.
	(pa_combine_instructions): Update.
	* config/mips/mips.c (mips16_gp_pseudo_reg): Update.
	* config/bfin/bfin.c (gen_one_bundle): Update.
	* cfgrtl.c (can_delete_note_p): Update.
	(delete_insn): Update.
	(rtl_merge_blocks): Update.
	(commit_one_edge_insertion): Update.
	(rtl_verify_flow_info): Update.
	* stmt.c (expand_case): Do not call squeeze_notes.

From-SVN: r124895
2007-05-21 06:19:50 +00:00
Jan Hubicka 55e092c4d0 alpha.c (alpha_output_mi_thunk_osf): Use insn_locators_alloc instead of insn_locators_initialize...
* config/alpha/alpha.c (alpha_output_mi_thunk_osf): Use
	insn_locators_alloc instead of insn_locators_initialize;
	call reset_block_changes.
	* config/sparc/sparc.c (sparc_output_mi_thunk): Likewise.
	* config/sh/sh.c (sparc_output_mi_thunk): Likewise.
	* config/is64/ia64.c (ia64_output_mi_thunk): Likewise.
	* config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise.
	* config/score/score.c (th_output_mi_thunk): Likewise.
	* config/mips/mips.c (mips_output_mi_thunk): Likewise.
	* cfglyaout.c (set_curr_insn_source_location, set_curr_insn_block):
	tolerate uninitialized locator info.

	Re-apply:
	* function.c (init_function_start): Don't init line number info.
	(expand_function_end): Update.
	(reset_block_changes, record_block_change, finalize_block_changes,
	check_block_change, free_block_changes): Kill.
	* function.h (reset_block_changes, record_block_change,
	finalize_block_changes, check_block_change, free_block_changes): Remove
	prototypes.
	(struct function): Remove ib_boundaries_block.
	* emit-rtl.c (make_insn_raw, make_jump_insn_raw, make_call_insn_raw):
	Use curr_insn_locator to initialize locator.
	(emit_line_note): Remove.
	* cfgexpand.c (expand_gimple_cond_expr): Update.
	(construct_exit_block): Likewise.
	(tree_expand_cfg): Initialize/finalize locators.
	* expr.c (expand_expr_real): Update.
	* cfglayout.c (line_locators_locs, line_locators_lines,
	file_locators_locs, file_locators_files): Remove.
	(set_block_levels): Move to cfgexpand.c.
	(insn_locators_initialize): Remove.
	(pass_insn_locators_initialize): Remove.
	(locations_locators_locs, locations_locators_vals): New static vars.
	(curr_location, last_location, curr_block, last_block, curr_rtl_loc):
	Likewise.
	(insn_locators_alloc, insn_locators_finalize,
	set_curr_insn_source_location, set_curr_insn_block, curr_insn_locator):
	New functions.
	(locator_location): New.
	(locator_line, locator_file): Rewrite.
	* rtl.h (emit_line_note): Kill.
	(insn_locators_alloc, insn_locators_finalize,
	set_curr_insn_source_location, set_curr_insn_block, curr_insn_locator):
	Declare.
	* tree-inline.c (initialize_cfun): Do not initialize
	ib_boundaries_block.
	* passes.c (pass_insn_locators_initialize): Remove.

From-SVN: r124258
2007-04-28 08:20:08 +00:00
Jan Hubicka ec9ac2bc42 Revert:
2007-04-23  Jan Hubicka  <jh@suse.cz>
	* function.c (init_function_start): Don't init line number info.
	(expand_function_end): Update.
	(reset_block_changes, record_block_change, finalize_block_changes,
	check_block_change, free_block_changes): Kill.
	* function.h (reset_block_changes, record_block_change,
	finalize_block_changes, check_block_change, free_block_changes): Remove
	prototypes.
	(struct function): Remove ib_boundaries_block.
	* emit-rtl.c (make_insn_raw, make_jump_insn_raw, make_call_insn_raw):
	Use curr_insn_locator to initialize locator.
	(emit_line_note): Remove.
	* cfgexpand.c (expand_gimple_cond_expr): Update.
	(construct_exit_block): Likewise.
	(tree_expand_cfg): Initialize/finalize locators.
	* expr.c (expand_expr_real): Update.
	* cfglayout.c (line_locators_locs, line_locators_lines,
	file_locators_locs, file_locators_files): Remove.
	(set_block_levels): Move to cfgexpand.c.
	(insn_locators_initialize): Remove.
	(pass_insn_locators_initialize): Remove.
	(locations_locators_locs, locations_locators_vals): New static vars.
	(curr_location, last_location, curr_block, last_block, curr_rtl_loc):
	Likewise.
	(insn_locators_alloc, insn_locators_finalize,
	set_curr_insn_source_location, set_curr_insn_block, curr_insn_locator):
	New functions.
	(locator_location): New.
	(locator_line, locator_file): Rewrite.
	* rtl.h (emit_line_note): Kill.
	(insn_locators_alloc, insn_locators_finalize,
	set_curr_insn_source_location, set_curr_insn_block, curr_insn_locator):
	Declare.
	* tree-inline.c (initialize_cfun): Do not initialize
	ib_boundaries_block.
	* passes.c (pass_insn_locators_initialize): Remove.

From-SVN: r124094
2007-04-24 00:05:57 +00:00
Jan Hubicka c90533c60b function.c (init_function_start): Don't init line number info.
* function.c (init_function_start): Don't init line number info.
	(expand_function_end): Update.
	(reset_block_changes, record_block_change, finalize_block_changes,
	check_block_change, free_block_changes): Kill.
	* function.h (reset_block_changes, record_block_change,
	finalize_block_changes, check_block_change, free_block_changes): Remove
	prototypes.
	(struct function): Remove ib_boundaries_block.
	* emit-rtl.c (make_insn_raw, make_jump_insn_raw, make_call_insn_raw):
	Use curr_insn_locator to initialize locator.
	(emit_line_note): Remove.
	* cfgexpand.c (expand_gimple_cond_expr): Update.
	(construct_exit_block): Likewise.
	(tree_expand_cfg): Initialize/finalize locators.
	* expr.c (expand_expr_real): Update.
	* cfglayout.c (line_locators_locs, line_locators_lines,
	file_locators_locs, file_locators_files): Remove.
	(set_block_levels): Move to cfgexpand.c.
	(insn_locators_initialize): Remove.
	(pass_insn_locators_initialize): Remove.
	(locations_locators_locs, locations_locators_vals): New static vars.
	(curr_location, last_location, curr_block, last_block, curr_rtl_loc):
	Likewise.
	(insn_locators_alloc, insn_locators_finalize,
	set_curr_insn_source_location, set_curr_insn_block, curr_insn_locator):
	New functions.
	(locator_location): New.
	(locator_line, locator_file): Rewrite.
	* rtl.h (emit_line_note): Kill.
	(insn_locators_alloc, insn_locators_finalize,
	set_curr_insn_source_location, set_curr_insn_block, curr_insn_locator):
	Declare.
	* tree-inline.c (initialize_cfun): Do not initialize
	ib_boundaries_block.
	* passes.c (pass_insn_locators_initialize): Remove.

From-SVN: r124061
2007-04-23 09:53:59 +00:00
Steven Bosscher ad21dab7f7 tracer.c (tracer): Don't take FLAGS argument.
* tracer.c (tracer): Don't take FLAGS argument.  Assert we are
	in cfglayout mode.  Don't go into and out of cfglayout mode.
	Link the blocks in the order of the constructed traces.
	(rest_of_handle_tracer): Adjust call to tracer.
	* loop-init.c (rtl_loop_init): Assert we are in cfglayout mode.
	Don't go into cfglayout mode.
	(rtl_loop_done): Don't go out of cfglayout mode.
	* cfglayout.c (relink_block_chain): New function, split out from...
	(fixup_reorder_chain): ...here.  Remove redundant checking.
	(cfg_layout_finalize): Don't clear the header, footer, and aux
	fields here, move the code to do so to relink_block_chain.  Likewise
	for free_original_copy_tables.
	* rtl.h (tracer): Update prototype.
	* bb-reorder.c (reorder_basic_blocks): Don't take FLAGS argument.
	Assert we are in cfglayout mode.  Don't go into and out of cfglayout
	mode.  Use relink_block_chain to serialize the CFG according to the
	new basic block order.  Move targetm.cannot_modify_jumps_p check from
	here...
	(gate_handle_reorder_blocks): ...to here.
	(duplicate_computed_gotos): Move targetm.cannot_modify_jumps_p check
	from here...
	(gate_duplicate_computed_gotos): ...to here.
	(rest_of_handle_reorder_blocks): Don't see if anything has changed,
	something always changes when going into and out of cfglayout mode.
	Perform an expensive cfg cleanup while going into cfglayout mode.
	Always update liveness information on HAVE_conditional_execution
	targets.  Reserialize the basic blocks and go out of cfglayout mode.
	* reg-stack.c: Include cfglayout.h.
	(rest_of_handle_stack_regs): Go into and out of cfglayout mode around
	the call to reorder_basic_blocks.
	* basic-block.h (reorder_basic_blocks): Update prototype.
	(relink_block_chain): New prototype.
	* passes.c (pass_outof_cfg_layout_mode): Move after cse2.

From-SVN: r123167
2007-03-23 23:05:28 +00:00
Richard Sandiford 2a45063980 rtl.h (constant_pool_reference_p): Delete.
gcc/
	* rtl.h (constant_pool_reference_p): Delete.
	(find_constant_src): Declare.
	* rtlanal.c (find_constant_src): New function.
	* simplify-rtx.c (constant_pool_reference_p): Delete.
	* config/i386/i386.md: Use find_constant_src instead of
	constant_pool_reference_p/avoid_constant_pool_reference pairs.

From-SVN: r123106
2007-03-21 09:10:08 +00:00
Alexandre Oliva 0de2ae0273 rtl.h (gen_rtx_ASM_INPUT): Use "" instead of NULL file name.
* rtl.h (gen_rtx_ASM_INPUT): Use "" instead of NULL file name.
* final.c (final_scan_insn): Test for non-"" file name.

From-SVN: r122750
2007-03-09 15:10:33 +00:00
Alexandre Oliva bff4b63d31 rtl.def (ASM_INPUT): Add location.
* rtl.def (ASM_INPUT): Add location.
* rtl.h (ASM_INPUT_SOURCE_LOCATION): New.
(ASM_INPUT_SOURCE_FILE, ASM_INPUT_SOURCE_LINE): New.
(decode_asm_operands): Add loc operand.
(gen_rtx_ASM_INPUT, gen_rtx_ASM_INPUT_loc): Define.
* stmt.c (expand_asm): Rename to...
(expand_asm_loc): ... this.  Add locus argument.  Pass it on to
gen_rtx_ASM_INPUT_loc.
(expand_asm_expr): Adjust.
* recog.c (decode_asm_operands): Add loc operand.
(check_asm_operands, extract_insn): Adjust.
* reload1.c (maybe_fix_stack_asms): Likewise.
* final.c (asm_insn_count): Likewise.
(final_scan_insn): Output # line before and after asm.

From-SVN: r122742
2007-03-09 07:36:43 +00:00
Richard Sandiford 7ffb5e7879 Makefile.in (rtlanal.o): Depend on tree.h.
gcc/
	* Makefile.in (rtlanal.o): Depend on tree.h.
	* rtl.h (offset_within_section_p, split_const): Declare.
	* rtlanal.c: Include tree.h.
	(offset_within_block_p): New function, taken from
	mips_offset_within_object_p.
	(split_const): New function, taken from mips_split_const.
	* config/m68k/m68k-protos.h (m68k_illegitimate_symbolic_constant_p):
	Declare.
	* config/m68k/m68k.h (M68K_OFFSETS_MUST_BE_WITHIN_SECTIONS_P): Define.
	(CONSTANT_ADDRESS_P): Only accept legitimate constants.
	(LEGITIMATE_CONSTANT_P): Check m68k_illegitimate_symbolic_constant_p.
	* config/m68k/m68k.c (TARGET_CANNOT_FORCE_CONST_MEM): Define.
	(m68k_illegitimate_symbolic_constant_p): New function.
	* config/m68k/m68k.md (movsi): Remove misleading predicates.
	If M68K_OFFSETS_MUST_BE_WITHIN_SECTIONS_P and the source is a
	symbolic constant that might be outside the symbol's section,
	move the symbol first and then add the offset.
	* config/m68k/uclinux.h (M68K_OFFSETS_MUST_BE_WITHIN_SECTIONS_P):
	Override.
	* config/mips/mips.c (mips_split_const): Delete.
	(mips_offset_within_object_p): Delete.
	(mips_symbolic_constant_p): Use offset_within_section_p and
	split_const instead of mips_offset_within_object_p and
	mips_split_const.
	(mips_cannot_force_const_mem, mips_const_insns, mips_unspec_address)
	(mips_legitimize_const_move, print_operand_reloc)
	(mips_dangerous_for_la25_p): Use split_const instead of
	mips_split_const.

From-SVN: r122428
2007-03-01 09:58:12 +00:00
Steven Bosscher 7cd689bcf0 rtl.h (remove_reg_equal_equiv_notes): New prototype.
* rtl.h (remove_reg_equal_equiv_notes): New prototype.
	* rtlanal.c (remove_reg_equal_equiv_notes): New function.
	* combine.c (adjust_for_new_dest): Use it.
	* postreload.c (reload_combine): Likewise.

From-SVN: r122178
2007-02-20 22:14:41 +00:00
Paolo Bonzini c47277a619 jump.c (get_label_after): Delete.
2007-02-15  Paolo Bonzini  <bonzini@gnu.org>

	* jump.c (get_label_after): Delete.
	(get_label_before, delete_computation, delete_jump,
	delete_prior_computation, follow_jumps): Move...
	* reorg.c (delete_computation, delete_prior_computation): ... here...
	(get_label_before, delete_jump): ... making these static ...
	(follow_jumps): ... and simplifying this since it only runs after
	reload.
	* rtl.h (get_label_after, get_label_before, delete_jump,
	follow_jumps): Delete prototypes.

From-SVN: r122003
2007-02-15 16:40:16 +00:00
Kazu Hirata a638bdc2fd emit-rtl.c (renumber_insns): Remove.
* emit-rtl.c (renumber_insns): Remove.
	* flags.h: Remove the extern for flag_renumber_insns.
	* rtl.h: Remove the prototype for renumber_insns.
	* toplev.c (flag_renumber_insns): Remove.

From-SVN: r121517
2007-02-02 19:02:18 +00:00
Maxim Kuvyrkov b198261f9c re PR middle-end/28071 (A file that can not be compiled in reasonable time/space)
* sched-int.h (ds_to_dk, dk_to_ds): Declare functions.
	
	(struct _dep): New type.
	(dep_t): New typedef.
	(DEP_PRO, DEP_CON, DEP_KIND): New access macros.
	(DEP_STATUS): New access macro.  The macro with the same name was
	renamed to DEP_LINK_STATUS.
	(dep_init): Declare function

	(struct _dep_link): New type.
	(dep_link_t): New typedef.
	(DEP_LINK_NODE, DEP_LINK_NEXT, DEP_LINK_PREV_NEXTP): New access macros.
	(DEP_LINK_DEP, DEP_LINK_PRO, DEP_LINK_CON, DEP_LINK_KIND): New macros.
	(DEP_LINK_STATUS): New macro.
	(debug_dep_links): New debug function.

	(struct _deps_list): New type.
	(deps_list_t): New typedef.
	(DEPS_LIST_FIRST): New access macro.
	(FOR_EACH_DEP_LINK): New cycle macro.
	(create_deps_list, free_deps_list, delete_deps_list): Declare
	functions.
	(deps_list_empty_p, debug_deps_list, add_back_dep_to_deps_list): Ditto.
	(find_link_by_pro_in_deps_list, find_link_by_con_in_deps_list): Ditto.
	(copy_deps_list_change_con): Ditto.

	(move_dep_link): Declare function.

	(struct _dep_node): New type.
	(dep_node_t): New typedef.
	(DEP_NODE_BACK, DEP_NODE_DEP, DEP_NODE_FORW): New access macros.

	(struct haifa_insn_data.back_deps): New field to hold backward
	dependencies of the insn.
	(struct haifa_insn_data.depend): Rename to forw_deps.  Change its type
	to deps_list_t.
	(struct haifa_insn_data.resolved_deps): Rename to resolved_back_deps.
	Change its type	to deps_list_t.
	(INSN_BACK_DEPS): New access macro to use instead of LOG_LINKS.
	(INSN_DEPEND): Rename to INSN_FORW_DEPS.
	(RESOLVED_DEPS): Rename to INSN_RESOLVED_BACK_DEPS.

	(INSN_COST): Move to haifa-sched.c.  Use insn_cost () instead.
	
	(DEP_STATUS): Rename to DEP_LINK_STATUS.  Fix typo in the comment.

	(add_forw_dep, delete_back_forw_dep, insn_cost): Update declaration and
	all callers.
	(dep_cost): Declare.
	
	* sched-deps.c (CHECK): New macro to (en/dis)able sanity checks.
	(ds_to_dk, dk_to_ds): New functions.
	
	(init_dep_1): New static function.
	(init_dep): New function.
	(copy_dep): New static function.
	
	(dep_link_consistent_p, attach_dep_link, add_to_deps_list): New static
	functions.
	(detach_dep_link): New static function.
	(move_dep_link): New function.
	
	(dep_links_consistent_p, dump_dep_links): New static functions.
	(debug_dep_links): New debugging function.
	
	(deps_obstack, dl_obstack, dn_obstack): New static variables.
	
	(alloc_deps_list, init_deps_list): New static functions.
	(create_deps_list): New function.
	(clear_deps_list): New static function.
	(free_deps_list, delete_deps_list, deps_list_empty_p): New functions.
	(deps_list_consistent_p, dump_deps_list): New static functions.
	(debug_deps_list): New function.
	(add_back_dep_to_deps_list, find_link_by_pro_in_deps_list): New
	functions.
	(find_link_by_con_in_deps_list, copy_deps_list_change_con): Ditto.

	(maybe_add_or_update_back_dep_1, add_or_update_back_dep_1): Update to
	use new scheduler dependencies lists.
	(add_back_dep, delete_all_dependences, fixup_sched_groups): Ditto.
	(sched_analyze): Ditto.  Initialize dependencies lists.
	(add_forw_dep, compute_forward_dependences): Update to use new
	scheduler dependencies lists.
	
	(init_dependency_caches): Init deps_obstack.
	(free_dependency_caches): Free deps_obstack.
	
	(adjust_add_sorted_back_dep, adjust_back_add_forw_dep): Update to use
	new scheduler dependencies lists.
	(delete_forw_dep, add_or_update_back_forw_dep): Ditto.
	(add_back_forw_dep, delete_back_forw_dep): Ditto.

	* sched-rgn.c (set_spec_fed, find_conditional_protection, is_pfree):
	Update to use new scheduler dependencies lists.
	(is_conditionally_protected, is_prisky, add_branch_dependences): Ditto.
	(debug_dependencies): Ditto.
	(schedule_region): Update comments.
	
	* sched-ebb.c (earliest_block_with_similiar_load): Update to use new
	scheduler dependencies lists.
	(schedule_ebb): Update comments.
	
	* rtl.def (DEPS_LIST): Remove.
	
	* lists.c (unused_deps_list): Remove.
	(free_list): Update assertions.
	
	(alloc_DEPS_LIST, free_DEPS_LIST_list, free_DEPS_LIST_node): Remove.
	(remove_free_DEPS_LIST_elem, copy_DEPS_LIST_list): Ditto.

	* rtl.h (free_DEPS_LIST_list, alloc_DEPS_LIST): Remove declarations.
	(remove_free_DEPS_LIST_elem, copy_DEPS_LIST_list): Ditto.
	
	* haifa-sched.c (comments): Update.
	(insn_cost1): Remove.  Inline the code into insn_cost ().
	(insn_cost): Update to use new scheduler dependencies lists.  Move
	processing of the dependency cost to dep_cost ().
	(dep_cost): New function.  Use it instead of insn_cost () when
	evaluating cost of the dependency.  Use compatible interface to
	interact with the target.
	(priority): Update to use new scheduler dependencies lists.
	(rank_for_schedule): Ditto.  Optimize heuristic that prefers the insn
	with greater number of insns that depend on the insn.
	(schedule_insn): Update to use new scheduler dependencies lists.  Add
	code to free backward dependencies lists.  Inline and optimize code
	from resolve_dep () - see PR28071.
	(ok_for_early_queue_removal): Update to use new scheduler dependencies
	lists.  Update call to targetm.sched.is_costly_dependence hook.
	
	(fix_inter_tick, try_ready, fix_tick_ready): Update to use new
	scheduler dependencies lists.
	
	(resolve_dep): Remove.  Move the logic to schedule_insn ().
	(init_h_i_d): Initialize dependencies lists.
	
	(process_insn_depend_be_in_spec): Rename to
	process_insn_forw_deps_be_in_spec.  Update to use new scheduler
	dependencies lists.
	(add_to_speculative_block, create_check_block_twin, fix_recovery_deps):
	Update to use new scheduler dependencies lists.
	(clear_priorities, calc_priorities, add_jump_dependencies): Ditto.
	
	* ddg.c (create_ddg_dependence, create_ddg_dep_no_link): Update to use
	new scheduler dependencies lists.
	(build_intra_loop_deps): Ditto.
	
	* target.h (struct _dep): Declare to use in
	gcc_target.sched.is_costly_dependence.
	(struct gcc_target.sched.adjust_cost): Fix typo.
	(struct gcc_target.sched.is_costly_dependence): Change signature to use
	single dep_t parameter instead of an equivalent triad.
	(struct gcc_target.sched.adjust_cost_2): Remove.

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

	* reg-notes.def (DEP_TRUE, DEP_OUTPUT, DEP_ANTI): Update comments.

	* doc/tm.texi (TARGET_SCHED_IS_COSTLY_DEPENDENCE): Update
	documentation.
	(TARGET_SCHED_ADJUST_COST_2): Remove documentation.

	* doc/rtl.texi (LOG_LINKS): Remove part about instruction scheduler.
	(REG_DEP_TRUE): Document.
	
	* config/ia64/ia64.c (ia64_adjust_cost_2): Rename to ia64_adjust_cost.
	Change signature to correspond to the targetm.sched.adjust_cost hook.  
	Update use in TARGET_SCHED_ADJUST_COST_2.
	(TARGET_SCHED_ADJUST_COST_2): Rename to TARGET_SCHED_ADJUST_COST.
	(ia64_dependencies_evaluation_hook, ia64_dfa_new_cycle): Update to use
	new scheduler dependencies lists.
	(ia64_gen_check): Ditto.

	* config/mips/mips.c (vr4130_swap_insns_p): Update to use new scheduler
	dependencies lists.
	
	* config/rs6000/rs6000.c (rs6000_is_costly_dependence): Change
	signature to correspond to the targetm.sched.is_costly_dependence hook.
	(is_costly_group): Update to use new scheduler dependencies lists.

	* config/spu/spu.c (spu_sched_adjust_cost): Use insn_cost () function
	instead of INSN_COST () macro.

From-SVN: r121494
2007-02-02 09:11:11 +00:00
Ian Lance Taylor e53a16e75f lower-subreg.c: New file.
gcc/:
	* lower-subreg.c: New file.
	* rtl.def (CONCATN): Define.
	* passes.c (init_optimization_passes): Add pass_lower_subreg and
	pass_lower_subreg2.
	* emit-rtl.c (update_reg_offset): New static function, broken out
	of gen_rtx_REG_offset.
	(gen_rtx_REG_offset): Call update_reg_offset.
	(gen_reg_rtx_offset): New function.
	* regclass.c: Revert patch of 2006-03-05, restoring
	reg_scan_update.
	(clear_reg_info_regno): New function.
	* dwarf2out.c (concatn_loc_descriptor): New static function.
	(loc_descriptor): Handle CONCATN.
	* common.opt (fsplit_wide_types): New option.
	* opts.c (decode_options): Set flag_split_wide_types when
	optimizing.
	* timevar.def (TV_LOWER_SUBREG): Define.
	* rtl.h (gen_reg_rtx_offset): Declare.
	(reg_scan_update): Declare.
	* regs.h (clear_reg_info_regno): Declare.
	* tree-pass.h (pass_lower_subreg): Declare.
	(pass_lower_subreg2): Declare.
	* doc/invoke.texi (Option Summary): List -fno-split-wide-types.
	(Optimize Options): Add -fsplit-wide-types to -O1 list.  Document
	-fsplit-wide-types.
	* doc/rtl.texi (Regs and Memory): Document concat and concatn.
	* Makefile.in (OBJS-common): Add lower-subreg.o.
	(lower-subreg.o): New target.
gcc/testsuite/:
	* gcc.dg/lower-subreg-1.c (test): New test.

From-SVN: r121453
2007-02-01 01:09:35 +00:00
Kazu Hirata 9b1ae0a097 basic-block.h: Remove the prototype for expected_value_to_br_prob.
* basic-block.h: Remove the prototype for
	expected_value_to_br_prob.
	* rtl.h: Remove the prototypes for expand_builtin_expect_jump
	and purge_line_number_notes.

From-SVN: r120186
2006-12-24 01:47:56 +00:00
Kazu Hirata 3c1dd4a384 * rtl.h (NOTE_EXPECTED_VALUE): Remove.
From-SVN: r120169
2006-12-23 16:01:47 +00:00
Joseph Myers f1f4e530a5 rtlanal.c (struct subreg_info, [...]): New.
* rtlanal.c (struct subreg_info, subreg_get_info, subreg_nregs):
	New.
	(subreg_regno_offset, subreg_offset_representable_p): Change to
	wrappers about subreg_get_info.
	(refers_to_regno_p, reg_overlap_mentioned_p): Use subreg_nregs.
	* rtl.h (subreg_nregs): Declare.
	* doc/tm.texi (HARD_REGNO_NREGS_HAS_PADDING): Update to refer to
	subreg_get_info.
	* caller-save.c (mark_set_regs, add_stored_regs): Use
	subreg_nregs.
	* df-scan.c (df_ref_record): Use subreg_nregs.
	* flow.c (mark_set_1): Use subreg_nregs.
	* postreload.c (move2add_note_store): Use subreg_nregs.
	* reload.c (decompose, refers_to_regno_for_reload_p,
	reg_overlap_mentioned_for_reload_p): Use subreg_nregs.
	* resource.c (update_live_status, mark_referenced_resources,
	mark_set_resources): Use subreg_nregs.

From-SVN: r120076
2006-12-20 16:25:00 +00:00
Jan Hubicka ef950eba66 extended.texi (__builtin_expect): We no longer require second argument to be constant.
* extended.texi (__builtin_expect): We no longer require second argument
	to be constant.
	* gengtype.c (adjust_field_rtx_def): Drop NOTE_INSN_EXPECTED_VALUE.
	* builtins.c (expand_builtin_expect): Simplify.
	(expand_builtin_expect_jump): Kill.
	* final.c (final_scan_insn): Do not skip the removed notes.
	* insn-notes.def (LOOP_BEG, LOOP_END, REPEATED_LINE_NUMBER,
	EXPECTED_VALUE): Remove.
	* dojump.c (do_jump): Do not care about __builtin_expect.
	* predict.c (expected_value_to_br_prob): Kill.
	* function.c (expand_function_end): Do not expand
	NOTE_INSN_REPEATED_LINE_NUMBER.
	* print-rtl.c (print_rtx): Do not pretty print the removed notes.
	* expect.c (sjlj_emit_function_enter): Emit directly branch probability.
	* cfgexpand.c (add_reg_br_prob_note): Export.
	* cfgcleanup.c (rest_of_handle_jump2): Do not call
	expected_value_to_br_prob.
	* cfglayout.c (duplicate_insn_chain): Do not deal with removed notes.
	* rtl.h (add_reg_br_prob_note): Declare.

From-SVN: r118696
2006-11-11 16:54:57 +00:00
Jan Hubicka 6039a0c74a tree-pass.h (pass_purge_lineno_notes): Remove declaration.
* tree-pass.h (pass_purge_lineno_notes): Remove declaration.
	* modulo-sched.c (find_line_note): Remove.
	(loop_canon_p): Do not worry about line number notes.
	(sms_schedule): Likewise.
	* cse.c (cse_main): Likewise.
	* regmove.c (fixup_match_1): Likewise
	* function.c (emit_return_info_block): Likewise.
	(expand_function_end): Likewise.
	(thread_prologue_an_epilogue_insns): Likewise.
	* cfgrtl.c (try_redirect_by_replacing_jump, rtl_tidy_fallthru_edge):
	Likewise.
	* emit-rtl.c (find_line_note, emit_insn_after_with_line_notes,
	emit_note_copy_after): Kill.
	(emit_note_copy): Do not worry about line numbers.
	* jump.c (purge_line_number_notes): Kill.
	(pass_purge_lineno_notes): Kill.
	* cfgcleanup.c (rest_of_handle_jump2): Kill purge_line_number_notes
	call.
	* rtl.h (emit_note_copy_after, emit_insn_after_with_line_notes): Kill.
	* passes.c (init_optimization_passes): Don't purge_lineno_notes.
	* sched-ebb.c (schedule_ebbs): Don't do rm_redundant_line_notes.
	* tree-pass.h (pass_purge_lineno_notes): Kill.
	* sched-ebb.c (schedule_ebb): Don't rm_line_notes,
	rm_redundant_line_notes.
	* sched-rgb.c (schedule_region): Don't rm_line_notes,
	rm_redundant_line_notes.
	* sched-int.h (rm_line_notes, rm_redundant_line_notes): Kill.
	* haifa-sched.c: Update comment about handling notes.
 	(unlink_line_notes): Kill.
	(rm_line_notes): Kill.
	(save_line_notes): Simplify.
	(rm_redundant_line_notes): Kill.

From-SVN: r118693
2006-11-11 15:50:16 +00:00
Peter Bergner adb43ed451 rtl.h (MEM_COPY_ATTRIBUTES): Copy MEM_POINTER.
* rtl.h (MEM_COPY_ATTRIBUTES): Copy MEM_POINTER.

From-SVN: r118684
2006-11-10 22:20:37 -06:00
Steven Bosscher 1049f47570 rtl.h (LABEL_OUTSIDE_LOOP_P): Remove.
* rtl.h (LABEL_OUTSIDE_LOOP_P): Remove.
        * doc/rtl.texi: Remove related documentation.

From-SVN: r116992
2006-09-16 08:46:22 +00:00
Bernd Schmidt 11b904a1fc cfgrtl.c (emit_insn_at_entry): New function.
* cfgrtl.c (emit_insn_at_entry): New function.
	* rtl.h (emit_insn_at_entry): Declare it.
	* integrate.c (emit_initial_value_sets): Use it.

From-SVN: r116968
2006-09-15 12:35:43 +00:00
Stuart Hastings 4fbbe6941c * rtl.h (UINTVAL) New.
* config/rs6000/rs6000.c (SMALL_INT) Use it.
	* testsuite/gcc.dg/20060801-1.c: New.

From-SVN: r115855
2006-08-01 16:17:53 +00:00
Kazu Hirata c98662e020 c-common.h: Remove the prototype for yyparse.
* c-common.h: Remove the prototype for yyparse.
	* rtl.h: Remove the prototype for init_loop.

From-SVN: r114242
2006-05-30 18:34:32 +00:00
Daniel Berlin 23249ac43c re PR rtl-optimization/26855 (ICE in add_deps_for_def with -fmodulo-sched -maltivec)
2006-05-19  Daniel Berlin  <dberlin@dberlin.org>
            Kenneth Zadeck <zadeck@naturalbridge.com>

	PR rtl-optimization/26855

	* df-scan.c (mw_reg_pool, mw_link_pool): New allocation pools for
	multiword refs.
	(df_scan_alloc): Added code to properly handle multiword hard
	registers and add all_blocks parameter.
	(df_scan_free_internal, df_insn_refs_delete, df_ref_record): Added
	code to properly handle multiword hard registers.
	(df_rescan_blocks): Added code to remove deleted blocks from
	bitmap.
	(df_ref_create_structure, df_ref_record): Added code to properly
	handle subregs.
	(df_ref_record_1): Changed DF_REF_CLOBBER into DF_REF_MUST_CLOBBER
	and set DF_REF_PARTIAL.
	(df_defs_record): Changed DF_REF_CLOBBER into DF_REF_MUST_CLOBBER.
	(df_uses_record): Added DF_REF_PARTIAL for subreg. 
	(df_scan_add_problem): Added flags parameter.
	(df_ref_create_structure): Changed switching structure.
	(df_bb_refs_record): Fixed case where duplicate artificial refs
	were created.  Changed location of flags.
	(df_record_entry_block_defs): Added code to make stack pointer
	live in entry block.  Refined cases where frame pointer is needed.
	Changed location of flags.
	(df_record_exit_block_uses, df_insn_refs_record): Changed location of flags.
	(df_set_state): Removed function.
	(df_grow_reg_info, df_reg_chain_unlink, df_ref_remove,
	df_insn_create_insn_record, df_insn_refs_delete, 
	df_ref_create_structure): Formatting changes.  
	* df-core.c (df_mvs_dump, df_set_flags, df_clear_flags,
	df_delete_basic_block): New function.
	(df_init): Changed location of flags.
	(df_add_problem): Added flags parameter and the way flags are
	processed.
	(df_insn_uid_debug, df_ref_debug, debug_df_defno, debug_df_ref,
	debug_df_chain): Improved debugging output.
	(df_insn_debug, df_insn_uid_debug): Added multiword reg support.
	(df_refs_chain_dump): Removed df parameter.
	(df_iterative_dataflow): Added consistency check.
	(df_prune_to_subcfg): Made public.
	(df_analyze_problem): Added blocks_to_init parameter and made
	public.
	(df_ref_record, df_bb_refs_record, df_mark_reg, 
	 df_record_exit_block_uses): Whitespace changes.
	(df_dump): Whitespace changes.
	* df.h: Some reordering to remove forward references.
	(df_ref_flags.DF_REF_MW_HARDREG, DF_REF_PARTIAL,
	DF_REF_MUST_CLOBBER, DF_REF_MAY_CLOBBER): New fields.
	(df_ref_flags.DF_REF_CLOBBER): Deleted field.
	(dataflow.flags): New field.
	(df.flag): Deleted field.
	(df_alloc_function): Added additional bitmap parameter.
	(df_dependent_problem_function): New type.
	(df_problem.changeable_flags): New field.
	(df_ref_flags.DF_REF_DIES_AFTER_THIS_USE, DF_SCAN_INITIAL,
	DF_SCAN_GLOBAL, DF_SCAN_POST_ALLOC, df_state): Removed.
	(df_mw_hardreg): New struct.
	(DF_INSN_UID_MWS): New macro.
	(df_refs_chain_dump, df_ref_debug, df_chain_dump): Removed df
	parameter.
	(df_add_problem, df_ru_add_problem, df_rd_add_problem,
	df_lr_add_problem, df_ur_add_problem, df_urec_add_problem,
	df_ri_add_problem, df_scan_add_problem): Added flags parameter.
	(df_set_state): Removed function.
	(df_set_flags, df_clear_flags, df_delete_basic_block) New functions.
	* df-problems.c (df_chain_dump): Removed df parameter.
	(df_ru_alloc, df_rd_alloc, df_lr_alloc, df_ur_alloc,
	df_urec_alloc, df_chain_alloc, df_ri_alloc): Added all blocks
	parameter.
	(df_ru_alloc, df_rd_alloc): Now resets all blocks.
	(df_rd_bb_local_compute_process_def, df_ur_bb_local_compute,
	df_chain_create_bb, df_create_unused_note, df_ri_bb_compute):
	Split DF_REF_CLOBBER into DF_REF_MAY_CLOBBER and
	DF_REF_MUST_CLOBBER cases.
	(df_ru_bb_local_compute_process_def,
	df_rd_bb_local_compute_process_def, df_lr_bb_local_compute,
	df_lr_bb_local_compute, df_ur_bb_local_compute,
	df_chain_create_bb): Made subreg aware.
	(df_ru_bb_local_compute, df_rd_bb_local_compute,
	df_lr_bb_local_compute, df_lr_bb_local_compute,
	df_chain_create_bb): Cleanup to use proper macros.
	(df_ur_local_finalize, df_urec_local_finalize): Removed unnecessary
	code to fixup bitvectors.
	(df_ri_alloc): Cleared lifetime.
	(df_ignore_stack_reg, df_kill_notes, df_set_notes_for_mw,
	df_create_unused_note): New function.
	(df_ri_bb_compute, df_ri_compute): Added code to create/update
	REG_DEAD and REG_UNUSED notes as well as register information.
	(df_ru_dump, df_rd_dump, df_lr_dump, df_ur_dump, df_urec_dump,
	df_chains_dump): Fixed crash if problem was never run.
	(df_ru_add_problem, df_rd_add_problem, df_lr_add_problem,
	df_ur_add_problem, df_urec_add_problem, df_chain_add_problem,
	df_ri_add_problem): Processes flags in uniform manner.
	(df_ru_alloc, df_ru_local_compute, df_ru_confluence_n, df_ru_free,
	df_ru_dump, df_rd_local_compute, df_rd_confluence_n, df_rd_free,
	df_rd_dump, df_urec_free_bb_info): Formatting changes.
	(df_ru_free_bb_info, df_ru_bb_local_compute, df_ru_dump,
	df_rd_free_bb_info, df_rd_bb_local_compute_process_def,
	df_rd_bb_local_compute, df_rd_dump, df_lr_free_bb_info,
	df_lr_bb_local_compute, df_lr_local_compute, df_ur_free_bb_info,
	df_ur_dump, df_urec_free_bb_info, df_urec_dump,
	df_chain_create_bb, df_ri_bb_compute): Whitespace changes.
	* modulo-sched.c (sms_schedule): Added flag parameter to calls.
	* see.c (see_initialize_data): Ditto.
	* final.c (rest_of_clean_state) Added regstack_completed.
	* rtl.h (regstack_completed): Ditto.
	* reg-stack.c (regstack_completed): Ditto.

From-SVN: r113915
2006-05-19 21:18:23 +00:00
Kazu Hirata 917f1b7ea3 builtins.c, [...]: Fix comment typos.
* builtins.c, config/arm/arm.c, config/i386/cygwin.h,
	config/i386/i386.c, config/ia64/ia64.c, config/s390/fixdfdi.h,
	config/sh/sh.c, config/sh/sh.h, df-scan.c, except.c,
	haifa-sched.c, optabs.c, rtl.h, sched-deps.c, sched-int.h,
	sched-rgn.c, tree-inline.h, tree-ssa-dom.c,
	tree-ssa-loop-prefetch.c, tree-ssa-operands.c,
	tree-vect-patterns.c, tree-vrp.c: Fix comment typos.  Follow
	spelling convensions.
	* config/ia64/ia64.opt, doc/contrib.texi, doc/invoke.texi,
	doc/passes.texi, doc/tm.texi, doc/tree-ssa.texi: Fix comment
	typos.  Follow spelling conventions.

From-SVN: r112782
2006-04-08 17:01:17 +00:00
Maxim Kuvyrkov c7ec547267 re PR target/26734 (GCC cannot bootstrap on IA64 HP-UX)
2006-03-30  Maxim Kuvyrkov  <mkuvyrkov@ispras.ru>

	PR target/26734
	* rtl.def (DEPS_LIST): Change type of the second operand to 'int'.
	* target.h (struct gcc_target.speculate_insn): Change type of the
	second parameter to 'int'.
	* lists.c (alloc_DEPS_LIST): Change signature.  Update reference to
	the second operand of the DEPS_LIST.
	(copy_DEPS_LIST_list): Update reference	to the second operand of the
	DEPS_LIST.
	* rtl.h (alloc_DEPS_LIST): Update signature.
	* sched-int.h (ds_t): Change typedef to 'int'.
	(DEP_STATUS, BITS_PER_DEP_STATUS): Update.

From-SVN: r112538
2006-03-30 15:41:00 +00:00
Maxim Kuvyrkov 3cc82eea2b 2006-03-28 Maxim Kuvyrkov <mkuvyrkov@ispras.ru>
Revert my 2006-03-27 patches.

From-SVN: r112456
2006-03-28 17:33:41 +00:00
Maxim Kuvyrkov 5edb2b13fa rtl.def (Copyright): Update date.
2006-03-27  Maxim Kuvyrkov  <mkuvyrkov@ispras.ru>

	* rtl.def (Copyright): Update date.
	(DEPS_LIST): Change type of the second operand to 'int'.
	* target.h (Copyright): Update date.
	(struct gcc_target.speculate_insn): Change type of the second parameter
	to 'int'.
	* lists.c (Copyright): Update date.
	(alloc_DEPS_LIST): Change signature.  Update reference to the second
	operand of the DEPS_LIST.
	(copy_DEPS_LIST_list): Update reference	to the second operand of the
	DEPS_LIST.
	* rtl.h (Copyright): Update date.
	(alloc_DEPS_LIST): Update signature.
	* sched-int.h (Copyright): Update date.
	(ds_t): Change typedef to 'int'.
	(DEP_STATUS, BITS_PER_DEP_STATUS): Update.

From-SVN: r112428
2006-03-27 22:59:07 +00:00
Steven Bosscher ede497cfbd function.h (struct function): Rename to x_stack_check_probe_note.
* function.h (struct function) <x_tail_recursion_reentry>:
	Rename to x_stack_check_probe_note.
	(tail_recursion_reentry): Rename to stack_check_probe_note.
	* function.c: Replace tail_recursion_reentry with
	stack_check_probe_note everywhere.
	(expand_function_start): Only emit a note for
	stack_check_probe_note with -fstack-protect.
	* stmt.c (expand_case): Don't emit NOTE_INSN_DELETED notes.

	* emit-rtl.c (remove_unnecessary_notes): Remove.
	(pass_remove_unnecessary_notes): Remove.
	* rtl.h (remove_unnecessary_notes): Remove prototype.
	* final.c (final_start_function): Don't call remove_unnecessary_notes.
	* tree-pass.h (pass_remove_unnecessary_notes): Remove.
	* passes.c (pass_remove_unnecessary_notes): Don't run it.

From-SVN: r112229
2006-03-20 21:22:55 +00:00
Jan-Benedict Glaw d97c12956f rtl.h (CONST_INT_P): Define.
* rtl.h (CONST_INT_P): Define.
	* config/vax/vax.c (print_operand_address): Use CONST_INT_P()
	instead of GET_CODE(x) == CONST_INT.
	(vax_rtx_costs): Likewise.
	(vax_output_int_move): Likewise.
	(vax_output_int_add): Likewise.
	(legitimate_constant_address_p): Likewise.
	(index_term_p): Likewise.
	* config/vax/vax.h (PRINT_OPERAND): Likewise.
	* config/vax/vax.md (and<mode>3): Likewise.
	(ashrsi3): Likewise.
	(extv): Likewise.
	(movstricthi): Likewise.
	(movstrictqi): Likewise.
	(rotrsi3): Likewise.
	(five unnamed insns): Likewise.

From-SVN: r112169
2006-03-17 01:12:33 +00:00
Maxim Kuvyrkov 496d7bb032 target.h (struct spec_info_def): New opaque declaration.
2006-03-16  Maxim Kuvyrkov <mkuvyrkov@ispras.ru>

        * target.h (struct spec_info_def): New opaque declaration.
        (struct gcc_target.sched): New fields: adjust_cost_2, h_i_d_extended,
        speculate_insn, needs_block_p, gen_check,
        first_cycle_multipass_dfa_lookahead_guard_spec, set_sched_flags.
        * target-def.h (TARGET_SCHED_ADJUST_COST_2,
        TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN,
        TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK,
        TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC,
        TARGET_SCHED_SET_SCHED_FLAGS): New macros to initialize fields in
        gcc_target.sched.
        (TARGET_SCHED): Use new macros.
        * rtl.h (copy_DEPS_LIST_list): New prototype.
        * sched-int.h (struct sched_info): Change signature of new_ready field,
	adjust all initializations. New fields: add_remove_insn,
        begin_schedule_ready, add_block, advance_target_bb, fix_recovery_cfg,
	region_head_or_leaf_p.
        (struct spec_info_def): New structure declaration.
        (spec_info_t): New typedef.
        (struct haifa_insn_data): New fields: todo_spec, done_spec, check_spec,
        recovery_block, orig_pat.
        (glat_start, glat_end): New variables declaraions.
        (TODO_SPEC, DONE_SPEC, CHECK_SPEC, RECOVERY_BLOCK, ORIG_PAT):
	New access macros.
        (enum SCHED_FLAGS): New constants: SCHED_RGN, SCHED_EBB,
        DETACH_LIFE_INFO, USE_GLAT.
        (enum SPEC_SCHED_FLAGS): New enumeration.
        (NOTE_NOTE_BB_P): New macro.
        (extend_dependency_caches, xrecalloc, unlink_bb_notes, add_block,
        attach_life_info, debug_spec_status, check_reg_live): New functions.
        (get_block_head_tail): Change signature to get_ebb_head_tail, adjust
        all uses in ddg.c, modulo-sched.c, haifa-sched.c, sched-rgn.c,
        sched-ebb.c
	(get_dep_weak, ds_merge): Prototype functions from sched-deps.c .
        * ddg.c (get_block_head_tail): Adjust all uses.
        * modulo-sched.c (get_block_head_tail): Adjust all uses.
	(sms_sched_info): Initialize new fields.
	(contributes_to_priority): Removed.
        * haifa-sched.c (params.h): New include.
	(get_block_head_tail): Adjust all uses.
        (ISSUE_POINTS): New macro.
        (glat_start, glat_end): New global variables.
        (spec_info_var, spec_info, added_recovery_block_p, nr_begin_data,
	nr_be_in_data, nr_begin_control, nr_be_in_control, bb_header,
	old_last_basic_block, before_recovery, current_sched_info_var,
	rgn_n_insns, luid): New static variables.
        (insn_cost1): New function.  Move logic from insn_cost to here.
        (find_insn_reg_weight1): New function.  Move logic from
        find_insn_reg_weight to here.
        (reemit_notes, move_insn, max_issue): Change signature.
        (move_insn1): Removed.
        (extend_h_i_d, extend_ready, extend_global, extend_all, init_h_i_d,
        extend_bb): New static functions to support extension of scheduler's
        data structures.
        (generate_recovery_code, process_insn_depend_be_in_spec,
        begin_speculative_block, add_to_speculative_block,
        init_before_recovery, create_recovery_block, create_check_block_twin,
        fix_recovery_deps): New static functions to support
        generation of recovery code.
        (fix_jump_move, find_fallthru_edge, dump_new_block_header,
        restore_bb_notes, move_block_after_check, move_succs): New static
        functions to support ebb scheduling.
        (init_glat, init_glat1, attach_life_info1, free_glat): New static
        functions to support handling of register live information.
        (associate_line_notes_with_blocks, change_pattern, speculate_insn,
	sched_remove_insn, clear_priorities, calc_priorities, bb_note,
	add_jump_dependencies):	New static functions.
        (check_cfg, has_edge_p, check_sched_flags): New static functions for
	consistancy checking.
	(debug_spec_status): New function to call from debugger.
	(priority): Added code to handle speculation checks.
	(rank_for_schedule): Added code to distinguish speculative instructions.
	(schedule_insn): Added code to handle speculation checks.
	(unlink_other_notes, rm_line_notes, restore_line_notes, rm_other_notes):
	Fixed to handle ebbs.
        (move_insn): Added code to handle ebb scheduling.
	(max_issue): Added code to use ISSUE_POINTS of instructions.
        (choose_ready): Added code to choose between speculative and
        non-speculative instructions.
        (schedule_block): Added code to handle ebb scheduling and scheduling of
        speculative instructions.
        (sched_init): Initialize new variables.
        (sched_finish): Free new variables.  Print statistics.
        (try_ready): Added code to handle speculative instructions.
        * lists.c (copy_DEPS_LIST_list): New function.
        * sched-deps.c (extend_dependency_caches): New function.  Move logic
        from create_dependency_caches to here.
	(get_dep_weak, ds_merge): Make global.
        * genattr.c (main): Code to output prototype for
        dfa_clear_single_insn_cache.
        * genautomata.c (DFA_CLEAR_SINGLE_INSN_CACHE_FUNC_NAME): New macros.
        (output_dfa_clean_insn_cache_func): Code to output
        dfa_clear_single_insn_cache function.
        * sched-ebb.c (target_n_insns): Remove.  Adjust all users to use
	n_insns.
        (can_schedule_ready_p, fix_basic_block_boundaries, add_missing_bbs):
        Removed.
        (n_insns, dont_calc_deps, ebb_head, ebb_tail, last_bb):
        New static variables.
        (begin_schedule_ready, add_remove_insn, add_block1, advance_target_bb,
	fix_recovery_cfg, ebb_head_or_leaf_p): Implement hooks from
	struct sched_info.
        (ebb_sched_info): Initialize new fields.
	(get_block_head_tail): Adjust all uses.
	(compute_jump_reg_dependencies): Fixed to use glat_start.
	(schedule_ebb): Code to remove unreachable last block.
        (schedule_ebbs): Added code to update register live information.
        * sched-rgn.c (region_sched_info): Initialize new fields.
	(get_block_head_tail): Adjust all uses.
	(last_was_jump): Removed.  Adjust users.
        (begin_schedule_ready, add_remove_insn, insn_points, extend_regions,
	add_block1, fix_recovery_cfg, advance_target_bb, region_head_or_leaf_p):
	Implement new hooks.
        (check_dead_notes1): New static function.
        (struct region): New fields: dont_calc_deps, has_real_ebb.
        (RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB): New access macros.
        (BB_TO_BLOCK): Fixed to handle EBBs.
        (EBB_FIRST_BB, EBB_LAST_BB): New macros.
        (ebb_head): New static variable.
        (debug_regions, contributes_to_priority): Fixed to handle EBBs.
        (find_single_block_regions, find_rgns, find_more_rgns): Initialize
	new fields.
	(compute_dom_prob_ps): New assertion.
        (check_live_1, update_live_1): Fixed to work with glat_start instead of
        global_live_at_start.
	(init_ready_list): New assertions.
	(can_schedule_ready_p): Split update code to begin_schedule_ready.
	(new_ready): Add support for BEGIN_CONTROL speculation.
        (schedule_insns): Fixed code that updates register live information
        to handle EBBs.
        (schedule_region): Fixed to handle EBBs.
	(init_regions): Use extend_regions and check_dead_notes1.
        * params.def (PARAM_MAX_SCHED_INSN_CONFLICT_DELAY,
        PARAM_SCHED_SPEC_PROB_CUTOFF): New parameters.
	* doc/tm.texi (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_H_I_D_EXTENDED,
	TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P,
	TARGET_SCHED_GEN_CHECK,
	TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC,
	TARGET_SCHED_SET_SCHED_FLAGS): Document.
        * doc/invoke.texi (max-sched-insn-conflict-delay,
	sched-spec-prob-cutoff): Document.

From-SVN: r112128
2006-03-16 05:27:03 +00:00
Maxim Kuvyrkov 63f54b1abd sched-int.h (struct haifa_insn_data): New fields: resolved_deps, inter_tick, queue_index.
2006-03-16  Maxim Kuvyrkov <mkuvyrkov@ispras.ru>

        * sched-int.h (struct haifa_insn_data): New fields: resolved_deps,
	inter_tick, queue_index.
	(struct sched_info): Change signature of init_ready_list field.
	Adjust all initializations.
	(RESOLVED_DEPS): New access macro.
	(ready_add): Remove prototype.
	(try_ready): Add prototype.
	* sched-rgn.c (init_ready_list): Use try_ready.
	(schedule_region): Initialize
	current_sched_info->{sched_max_insns_priority, queue_must_finish_empty}.
	* sched-ebb.c (new_ready): Remove.  Adjust ebb_sched_info.
	(init_ready_list): Use try_ready.
	(schedule_ebb): Initialize current_sched_info->sched_max_insns_priority.
	* lists.c (remove_list_elem): Remove `static'.
	(remove_free_INSN_LIST_elem): New function.
	* rtl.h (remove_list_elem, remove_free_INSN_LIST_elem): Add prototypes.
	* haifa-sched.c (INTER_TICK, QUEUE_INDEX): New macros.
	(INVALID_TICK, MIN_TICK, QUEUE_SCHEDULED, QUEUE_NOWHERE, QUEUE_READY):
	New constants.
	(readyp): New variable.
	(queue_remove, ready_remove_insn, fix_inter_tick, fix_tick_ready,
	change_queue_index, resolve_dep): New static functions.
	(try_ready): New function.  Adjust callers in sched-rgn.c and
	sched-ebb.c to use it instead of ready_add.
	(clock_var): Move at the begining of file.
	(rank_for_schedule): Fix typo.
	(queue_insn): Add assertion.  Handle QUEUE_INDEX.
	(ready_lastpos): Enforce assertion.
	(ready_add): Make it static.  Handle QUEUE_INDEX.  Add new argument,
	update all callers.
	(ready_remove_first, ready_remove): Handle QUEUE_INDEX.
	(schedule_insn): Rewrite to use try_ready and resolve_dep.
	(queue_to_ready): Use free_INSN_LIST_list.
	(early_queue_to_ready): Fix typo.
	(schedule_block): Init readyp.  Move init_ready_list call after the
	initialization of clock_var.  Fix error in rejecting insn by
	targetm.sched.dfa_new_cycle.  Add call to fix_inter_tick.  Remove code
	that previously	corrected INSN_TICKs.  Add code for handling
	QUEUE_INDEX.
	(set_priorities): Fix typo.
	(sched_init): Initialize INSN_TICK, INTER_TICK and QUEUE_INDEX.
	Clarify comment and code that keeps current_sched_info->next_tail
	non-null.

From-SVN: r112127
2006-03-16 05:23:21 +00:00
Maxim Kuvyrkov ddbd543924 ddg.c (build_intra_loop_deps): Adjust add_forward_dependence call.
2006-03-16  Maxim Kuvyrkov <mkuvyrkov@ispras.ru>
            Andrey Belevantsev <abel@ispras.ru>

	* ddg.c (build_intra_loop_deps): Adjust add_forward_dependence call.
        * lists.c (unused_deps_list): New variable.
	(free_list): Add assertions to verify the proper distinguishing 
        between INSN_LISTs and DEPS_LISTs.
        (find_list_elem, remove_list_elem, remove_list_node): New static
	functions.
        (alloc_DEPS_LIST, free_DEPS_LIST, free_DEPS_LIST_node,
        remove_free_INSN_LIST_elem, remove_free_DEPS_LIST_elem,
        remove_free_INSN_LIST_node, remove_free_DEPS_LIST_node): New functions.
        (alloc_INSN_LIST): Assert that the list we're working on is indeed
	an INSN_LIST.
        (free_INSN_LIST_node): Likewise.
	* modulo-sched.c (current_sched_info): Initialize flags field.
	* reg-notes.def: Exchange DEP_ANTI and DEP_OUTPUT.
	* rtl.def (DEPS_LIST): Define.
        * rtl.h: Declare new functions from lists.c.
        * sched-deps.c (spec_dependency_cache): New static variable.
        (maybe_add_or_update_back_dep_1, add_back_dep): New static functions.
        (add_dependence): Change return type to void.  Move the logic to ...
        (add_or_update_back_dep_1): ... here.  Handle speculative dependencies.
        (delete_all_dependences): Add comment about forward_dependency_cache.
	Handle spec_dependency_cache.  Handle DEPS_LISTs.
        (fixup_sched_groups): Clarify the change of priority of output
        and anti dependencies.
        (sched_analyze_2): Adjust add_dependence calls to create data
	speculative dependence.
        (add_forward_dependence): Renamed to add_forw_dep, change prototype.
	Adjust all callers.  Handle DEPS_LISTS.
        (compute_forward_dependences): Use add_forw_dep.  Sort LOG_LINKs in
	presence of speculation.
        (init_dependency_caches, free_dependency_caches):
	Handle spec_dependency_cache.
        (adjust_add_sorted_back_dep, adjust_back_add_forw_dep, delete_forw_dep,
	estimate_dep_weak, get_dep_weak, ds_merge, check_dep_status):
	New static functions.
        (add_or_update_back_dep, add_or_update_back_forw_dep,
	add_back_forw_dep, delete_back_forw_dep): New functions.
	* sched-int.h (ds_t, dw_t): New typedefs.
	(struct sched_info): Add new field flags.
	(struct haifa_insn_data): Add new bitfield has_internal_dep.
	Prototype new sched-deps.c functions.
        (HAS_INTERNAL_DEP, DEP_STATUS): New access macros.
	(BITS_PER_DEP_STATUS, BITS_PER_DEP_WEAK, DEP_WEAK_MASK, MAX_DEP_WEAK,
	MIN_DEP_WEAK, NO_DEP_WEAK, UNCERTAIN_DEP_WEAK, BEGIN_DATA, BE_IN_DATA,
	BEGIN_CONTROL, BE_IN_CONTROL, BEGIN_SPEC, DATA_SPEC, CONTROL_SPEC,
	SPECULATIVE, BE_IN_SPEC, FIRST_SPEC_TYPE, LAST_SPEC_TYPE,
	SPEC_TYPE_SHIFT, DEP_TRUE, DEP_OUTPUT, DEP_ANTI, DEP_TYPES, HARD_DEP):
	New constants.
        (enum SPEC_TYPES_OFFSETS, enum DEPS_ADJUST_RESULT, enum SCHED_FLAGS):
	New enums.
	* sched-rgn.c (current_sched_info): Initialize flags field.
	(schedule_insns): Initialize current_sched_info before the sched_init
	call.
	* sched-ebb.c (current_sched_info): Initialize flags field.
	(add_deps_for_risky_insns): Use control_flow_insn_p instead of JUMP_P.
	Call add_or_update_back_dep instead of add_dependence.
	Create control speculative dependencies.
	(schedule_insns): Initialize current_sched_info before the sched_init
	call.

Co-Authored-By: Andrey Belevantsev <abel@ispras.ru>

From-SVN: r112125
2006-03-16 05:17:41 +00:00
Steven Bosscher fc6c490eea rtl.def (LABEL_REF): Remove the field for LABEL_NEXTREF.
* rtl.def (LABEL_REF): Remove the field for LABEL_NEXTREF.
        * rtl.h (LABEL_NEXTREF): Remove field accessor.

From-SVN: r111969
2006-03-11 22:14:35 +00:00