Commit Graph

758 Commits

Author SHA1 Message Date
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