Commit Graph

88 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
Shujing Zhao 481683e1d5 alias.c: Use REG_P...
2009-06-22  Shujing Zhao  <pearly.zhao@oracle.com>

	* alias.c: Use REG_P, MEM_P, CONST_INT_P, LABEL_P, CALL_P, NOTE_P and
	JUMP_TABLE_DATA_P predicates where applicable.
	* auto-inc-dec.c: Ditto.
	* builtins.c: Ditto.
	* caller-save.c: Ditto.
	* calls.c: Ditto.
	* cfgcleanup.c: Ditto.
	* cfglayout.c: Ditto.
	* cfgrtl.c: Ditto.
	* combine.c: Ditto.
	* combine-stack-adj.c: Ditto.
	* cse.c: Ditto.
	* cselib.c: Ditto.
	* dbxout.c: Ditto.
	* df-scan.c: Ditto.
	* dse.c: Ditto.
	* dwarf2asm.c: Ditto.
	* dwarf2out.c: Ditto.
	* emit-rtl.c: Ditto.
	* except.c: Ditto.
	* explow.c: Ditto.
	* expmed.c: Ditto.
	* expr.c: Ditto.
	* final.c: Ditto.
	* function.c: Ditto.
	* fwprop.c: Ditto.
	* gcse.c: Ditto.
	* genpreds.c: Ditto.
	* genrecog.c: Ditto.
	* ifcvt.c: Ditto.
	* ira-costs.c: Ditto.
	* ira-lives.c: Ditto.
	* jump.c: Ditto.
	* loop-iv.c: Ditto.
	* lower-subreg.c: Ditto.
	* modulo-sched.c: Ditto.
	* optabs.c: Ditto.
	* postreload.c: Ditto.
	* print-rtl.c: Ditto.
	* recog.c: Ditto.
	* reginfo.c: Ditto.
	* regmove.c: Ditto.
	* reload1.c: Ditto.
	* reload.c: Ditto.
	* reorg.c: Ditto.
	* rtlanal.c: Ditto.
	* rtl.c: Ditto.
	* sched-vis.c: Ditto.
	* sdbout.c: Ditto.
	* sel-sched-ir.c: Ditto.
	* simplify-rtx.c: Ditto.
	* targhooks.c: Ditto.
	* var-tracking.c: Ditto.
	* vmsdbgout.c: Ditto.

From-SVN: r148786
2009-06-22 10:29:13 +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
Jakub Jelinek 8dd5516b4c re PR middle-end/31150 (Not promoting an whole array to be static const)
PR middle-end/31150
	* dse.c (struct store_info): Add const_rhs field.
	(clear_rhs_from_active_local_stores): Clear also const_rhs.
	(record_store): Try also cselib_expand_value_rtx to get a constant.
	(find_shift_sequence, get_stored_val): Use const_rhs instead of
	rhs if worthwhile.
	* cselib.c (cselib_record_sets): If !cselib_record_memory and
	there is just one set from read-only MEM, look at REG_EQUAL or
	REG_EQUIV note.

	* dse.c (struct store_info): Add redundant_reason field.
	(record_store): When storing the same constant as has been
	stored by an earlier store, set redundant_reason field
	to the earlier store's insn_info_t.  Don't delete cannot_delete
	insns.
	(find_shift_sequence): Remove read_info argument, add read_mode
	and require_cst arguments.  Return early if require_cst and
	constant wouldn't be returned.
	(get_stored_val): New function.
	(replace_read): Use it.
	(scan_insn): Put even cannot_delete insns with exactly 1 store
	into active_local_stores.
	(dse_step1): Don't delete cannot_delete insns.  Remove redundant
	constant stores if contains_cselib_groups and earlier store storing
	the same value hasn't been eliminated.
	(dse_step6): Renamed to dse_step7.  New function.
	(dse_step7): Renamed from dse_step6.
	(rest_of_handle_dse): Call dse_step6 and dse_step7 at the end.
	* cselib.c (cselib_expand_value_rtx): Don't wrap CONST_INTs
	into CONST unless really necessary.  Handle SUBREG, unary,
	ternary, bitfield and compares specially, to be able to simplify
	operations on constants.
	(expand_loc): Try to optimize LO_SUM.

	* dse.c (get_call_args): New function.
	(scan_insn): Don't handle BUILT_IN_BZERO.  For memset, attempt
	to get call arguments and if successful and both len and val are
	constants, handle the call as (mem:BLK) (const_int) store.

	* dse.c (struct store_info): Add is_large bool field, change
	positions_needed into a union of a bitmask and bitmap + count.
	(free_store_info): Free bitmap if is_large.
	(set_usage_bits): Don't look at stores where
	offset + width >= MAX_OFFSET.
	(set_position_unneeded, set_all_positions_unneeded,
	any_positions_needed_p, all_positions_needed_p): New static inline
	functions.
	(record_store): Handle BLKmode stores of CONST_INT, if
	MEM_SIZE is set on the MEM.  Use the new positions_needed
	accessor inlines.
	(replace_read): Handle reads from BLKmode CONST_INT stores.
	(check_mem_read_rtx): Use all_positions_needed_p function.
	(dse_step1): Free large positions_needed bitmaps and clear is_large.

	* dse.c (struct store_info): Change begin and end types to
	HOST_WIDE_INT.

	* dse.c (record_store): Fix check for unused store.

	* expr.c (block_clear_fn): No longer static.
	* expr.h (block_clear_fn): Declare.
	* dse.c (scan_insn): Memset and bzero can just read their
	arguments.

	* gcc.c-torture/execute/20081218-1.c: New test.

From-SVN: r142892
2008-12-23 00:41:17 +01:00
Kaveh R. Ghazi f883e0a7dc alias.c (record_alias_subset, [...]): Fix -Wc++-compat and/or -Wcast-qual warnings.
* alias.c (record_alias_subset, init_alias_analysis): Fix
	-Wc++-compat and/or -Wcast-qual warnings.
	* attribs.c (lookup_attribute_spec): Likewise.
	* bb-reorder.c (find_traces, rotate_loop, find_traces_1_round,
	copy_bb, connect_traces,
	find_rarely_executed_basic_blocks_and_cr): Likewise.
	* bt-load.c (find_btr_def_group, add_btr_def, new_btr_user,
	note_btr_set, migrate_btr_defs): Likewise.
	* builtins.c (result_vector, expand_builtin_memcpy,
	expand_builtin_mempcpy_args, expand_builtin_strncpy,
	builtin_memset_read_str, expand_builtin_printf,
	fold_builtin_memchr, rewrite_call_expr, fold_builtin_printf):
	Likewise.
	* caller-save.c (mark_set_regs): Likewise.
	* calls.c (expand_call, emit_library_call_value_1): Likewise.
	* cgraph.c (cgraph_edge): Likewise.
	* combine.c (likely_spilled_retval_1): Likewise.
	* coverage.c (htab_counts_entry_hash, htab_counts_entry_eq,
	htab_counts_entry_del, get_coverage_counts): Likewise.
	* cselib.c (new_elt_list, new_elt_loc_list, entry_and_rtx_equal_p,
	new_cselib_val): Likewise.
	* dbgcnt.c (dbg_cnt_process_opt): Likewise.
	* dbxout.c (dbxout_init, dbxout_type, output_used_types_helper):
	Likewise.
	* df-core.c (df_compact_blocks): Likewise.
	* df-problems.c (df_grow_bb_info, df_chain_create): Likewise.
	* df-scan.c (df_grow_reg_info, df_ref_create,
	df_insn_create_insn_record, df_insn_rescan, df_notes_rescan,
	df_ref_compare, df_ref_create_structure, df_bb_refs_record,
	df_record_entry_block_defs, df_record_exit_block_uses,
	df_bb_verify): Likewise.
	* df.h (DF_REF_EXTRACT_WIDTH_CONST, DF_REF_EXTRACT_OFFSET_CONST,
	DF_REF_EXTRACT_MODE_CONST): New.
	* dominance.c (get_immediate_dominator, get_dominated_by,
	nearest_common_dominator, root_of_dom_tree,
	iterate_fix_dominators, first_dom_son, next_dom_son): Fix
	-Wc++-compat and/or -Wcast-qual warnings.
	* dse.c (clear_alias_set_lookup, get_group_info, gen_rtx_MEM,
	record_store, replace_read, check_mem_read_rtx, scan_insn,
	dse_step1, dse_record_singleton_alias_set): Likewise.
	* dwarf2asm.c (dw2_force_const_mem): Likewise.

From-SVN: r137137
2008-06-26 00:28:15 +00:00
Steven Bosscher 4a8cae8370 Remove libcall notes.
* see.c (see_analyse_one_def): Do not look for REG_LIBCALL and
	REG_RETVAL notes.
	(see_update_relevancy): Likewise.
	* fwprop.c (try_fwprop_subst): Likewise.
	* rtlanal.c (noop_move_p): Likewise.
	* builtins.c (expand_buitlin_mathfn): Don't try to add REG_EQUAL
	notes to non-existing libcall blocks.
	* cse.c (cse_insn): Change prototype.  Don't update libcall notes.
	Remove orig_set.
	(cse_extended_basic_block): Don't track libcall and no-conflict notes.
	(dead_libcall_p): Remove.
	(delete_trivially_dead_insns): Don't use it.
	* web.c (union_defs): Remove comment about keeping nops.
	* gcse.c (hash_scan_insn): Don't take libcall pointers.
	(compute_hash_table_work): Don't track libcall notes.
	(do_local_cprop): Don't take libcall pointers.  Don't update
	libcall notes.
	(adjust_libcall_notes): Deleted.
	(local_cprop_pass): Remove stack for nested libcalls (which shouldn't
	ever have existed in the first place).
	(replace_store_insn): Don't try to remove libcall notes.
	* lower-subreg.c (move_libcall_note, move_retval_note): Deleted.
	(resolve_reg_notes): Don't call them.
	(resolve_simple_move): Likewise.
	(decompose_multiword_subregs): Remove block handling REG_RETVAL notes.
	Don't remove REG_RETVAL notes.
	* emit-rtl.c (try_split): Don't update libcall notes.
	(emit_copy_of_insn_after): Dito.
	* cselib.c (cselib_current_insn_in_libcall): Remove.
	(cselib_process_insn): Don't set/clear it.
	(new_elt_loc_list): Don't record it.
	(cselib_init): Don't initialize it.
	* cselib.c (struct elt_loc_list): Remove in_libcall field.
	* loop-invariant.c (find_invariant_insn): Don't look for libcall
	notes.
	* sched-deps.c (sched_analyze_insn): Don't group libcall blocks.
	(sched_analyze): Don't set up deps->libcall_block_tail_insn.
	(init_deps): Don't initialize it.
	* sched-int.h (struct deps): Rremove libcall_block_tail_insn field.
	* combine.c (delete_noop_moves): Don't update libcall notes.
	(can_combine_p): Remove now pointless #if 0 block.
	(try_combine): Remove another obsolete #if 0 block.
	(distribute_notes): Don't distribute libcall notes.
	* reg-notes.def (REG_LIBCALL, REG_RETVAL): Remove.
	* dce.c (libcall_dead_p): Remove.
	(delete_unmarked_insns): Don't handle libcall blocks.
	(preserve_libcall_for_dce): Remove.
	(prescan_insns_for_dce): Don't special-case libcall block insns.
	* reload1 (reload): Don't handle libcall notes. 
	* doc/rtl.texi (REG_LIBCALL, REG_RETVAL, REG_LIBCALL_ID): Remove
	documentation.

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

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

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

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

From-SVN: r127063
2007-07-30 15:35:02 +00:00
Kazu Hirata cea618ac1f cfglayout.c, [...]: Fix comment typos.
* cfglayout.c, config/arm/arm.c, config/arm/cortex-a8.md,
	config/arm/neon-schedgen.ml, config/arm/neon.ml,
	config/arm/vec-common.md, config/ia64/div.md, cselib.c,
	df-core.c, df.h, dominance.c, optabs.c, opts.c, reg-stack.c,
	regstat.c, target.h, tree-ssa-live.c, tree-ssa-pre.c,
	tree-vect-transform.c, tree.def: Fix comment typos.  Follow
	spelling conventions.
	* doc/invoke.texi: Follow spelling conventions.

From-SVN: r127030
2007-07-28 23:55:00 +00:00
Nick Clifton 9dcd6f09a3 Change copyright header to refer to version 3 of the GNU General Public License and to point readers at the COPYING3 file and the FSF's license web page.
From-SVN: r126948
2007-07-26 08:37:01 +00:00
Kaveh R. Ghazi e5cfc29f59 cselib.c (entry_and_rtx_equal_p): Constify.
* cselib.c (entry_and_rtx_equal_p): Constify.
	* gengtype.c (output_mangled_typename, write_types, write_local):
	Likewise.
	* gengtype.h (const_type_p): New.
	* see.c (eq_descriptor_extension, hash_descriptor_extension):
	Constify.
	* tlink.c (scan_linker_output): De-constify.
	* tree-ssa-loop-im.c (memref_eq): Constify.
	* tree-ssa-structalias.c (const_shared_bitmap_info_t): New.
	(shared_bitmap_hash, shared_bitmap_eq): Constify.

cp:
	* parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
	Constify.

From-SVN: r126926
2007-07-25 19:19:42 +00:00
Kazu Hirata 6ed3da0066 auto-inc-dec.c, [...]: Fix comment typos.
* auto-inc-dec.c, config/arm/arm.c,
	config/m32r/constraints.md, config/mips/mips.md,
	config/rs6000/rs6000.c, cselib.c, dce.c, df-core.c,
	df-problems.c, df-scan.c, df.h, dse.c, gimplify.c,
	tree-if-conv.c, tree-ssa-sccvn.c, tree-ssa.c: Fix comment
	typos.  Follow spelling conventions.
	* doc/invoke.texi, doc/rtl.texi: Fix typos.

From-SVN: r126439
2007-07-07 13:00:43 +00:00
Daniel Berlin 6fb5fa3cbc Merge dataflow branch into mainline
From-SVN: r125624
2007-06-11 18:02:15 +00:00
Richard Sandiford 09e18274fd regs.h (end_hard_regno): New function.
gcc/
	* regs.h (end_hard_regno): New function.
	(END_HARD_REGNO, END_REGNO): New macros.
	(add_to_hard_reg_set): New function.
	(remove_from_hard_reg_set): Likewise.
	(in_hard_reg_set_p): Likewise.
	(overlaps_hard_reg_set_p): Likewise.
	* bt-load.c (find_btr_reference): Use overlaps_hard_reg_set_p.
	(note_btr_set): Use END_HARD_REGNO.
	* caller-save.c (setup_save_areas): Use end_hard_regno.
	(mark_set_regs): Use END_HARD_REGNO.
	(add_stored_regs): Use end_hard_regno.
	(mark_referenced_regs): Use add_to_hard_reg_set.
	* combine.c (update_table_tick): Use END_REGNO.
	(record_value_for_reg): Likewise.
	(record_dead_and_set_regs): Likewise.
	(get_last_value_validate): Likewise.
	(use_crosses_set_p): Likewise.
	(reg_dead_at_p_1): Likewise.
	(reg_dead_at_p): Likewise.
	(mark_used_regs_combine): Use add_to_hard_reg_set.
	(move_deaths): Use END_HARD_REGNO.
	(reg_bitfield_target_p): Use end_hard_regno.
	(distribute_notes): Use END_HARD_REGNO.
	* cse.c (mention_regs): Use END_REGNO.
	(insert): Use add_to_hard_reg_set.
	(invalidate): Use END_HARD_REGNO.
	(invalidate_for_call): Likewise.
	(exp_equiv_p): Use END_REGNO.
	(cse_insn): Likewise.
	* cselib.c (cselib_invalidate_regno): Use end_hard_regno.
	* df-problems.c (df_urec_mark_reg_change): Use END_HARD_REGNO.
	* df-scan.c (df_ref_record): Use END_HARD_REGNO.
	* function.c (keep_stack_depressed): Use end_hard_regno.
	* global.c (global_alloc): Use end_hard_regno.
	(global_conflicts): Use add_to_hard_reg_set instead of
	mark_reg_live_nc.
	(find_reg): Likewise.
	(mark_reg_store): Likewise.
	(mark_reg_conflicts): Likewise.
	(mark_reg_death): Use remove_from_hard_reg_set.
	(mark_reg_live_nc): Delete.
	(set_preference): Use end_hard_regno.
	* local-alloc.c (mark_life): Use add_to_hard_reg_set and
	remove_from_hard_reg_set.
	(post_mark_life): Use add_to_hard_reg_set.
	* mode-switching.c (reg_dies): Use remove_from_hard_reg_set.
	(reg_becomes_live): Use add_to_hard_reg_set.
	* recog.c (reg_fits_class_p): Use in_hard_reg_set_p.
	(peep2_find_free_register): Use add_to_hard_reg_set.
	* reg-stack.c (convert_regs_exit): Use END_HARD_REGNO.
	* regclass.c (record_reg_classes): Use in_hard_reg_set_p.
	* regrename.c (note_sets): Use add_to_hard_reg_set.
	(clear_dead_regs): Use remove_from_hard_reg_set.
	(regrename_optimize): Use add_to_hard_reg_set.
	(find_oldest_value_reg): Use in_hard_reg_set_p.
	* reload.c (push_reload): Use in_hard_reg_set_p and end_hard_regno.
	(hard_reg_set_here_p): Use end_hard_regno.
	(decompose): Likewise.
	(reg_overlap_mentioned_for_reload_p): Use END_HARD_REGNO.
	(find_equiv_reg): Use in_hard_reg_set_p and end_hard_regno.
	* reload1.c (compute_use_by_pseudos): Use add_to_hard_reg_set.
	(mark_home_live): Use end_hard_regno.
	(spill_hard_reg): Likewise.
	(clear_reload_reg_in_use): Likewise.
	* reorg.c (delete_prior_computation): Use END_REGNO.
	* resource.c (update_live_status): Use END_HARD_REGNO.
	(mark_referenced_resources): Use add_to_hard_reg_set.
	(mark_set_resources): Likewise.
	(mark_target_live_regs): Likewise.  Use remove_from_hard_reg_set.
	* rtlanal.c (refers_to_regno_p): Use END_REGNO.
	(reg_overlap_mentioned_p): Likewise.
	(dead_or_set_p): Likewise.  Use an exclusive upper loop bound.
	(covers_regno_no_parallel_p): Use END_REGNO.
	(find_regno_note): Likewise.
	(find_reg_fusage): Use END_HARD_REGNO.
	* stmt.c (decl_overlaps_hard_reg_set_p): Use overlaps_hard_reg_set_p.
	* var-tracking.c (emit_note_insn_var_location): Use end_hard_regno.

From-SVN: r124961
2007-05-22 20:52:39 +00:00
Kazu Hirata 9f5ed61a80 c-decl.c, [...]: Fix comment typos.
* c-decl.c, config/avr/avr.c, config/avr/avr.h,
	config/m68k/m68k.c, config/m68k/netbsd-elf.h,
	config/mn10300/mn10300.c, config/pdp11/pdp11.h,
	config/rs6000/cell.md, config/rs6000/darwin.h,
	config/sh/sh.md, config/sh/sh4-300.md, config/spu/spu.c,
	config/spu/spu.md, cselib.c, expr.c, haifa-sched.c, hwint.h,
	jump.c, reload.c, sched-deps.c, sched-int.h, tree-inline.c,
	tree-profile.c, tree-ssa-live.h, tree-vrp.c: Fix comment
	typos.  Follow spelling conventions.
	* doc/invoke.texi: Follow spelling conventions.

From-SVN: r121546
2007-02-03 16:47:06 +00:00
Steven Bosscher 757bbef814 cselib.c (struct cselib_val_struct): Make val_rtx its own field, remove the union that contained it.
* cselib.c (struct cselib_val_struct): Make val_rtx its
	own field, remove the union that contained it.
	* cselib.c: Update accordingly where necessary.

From-SVN: r119994
2006-12-17 22:57:04 +00:00
Steven Bosscher ac3768f69a cselib.c (cselib_init): Use special MEM rtx form for callmem.
* cselib.c (cselib_init): Use special MEM rtx form for callmem.
	* alias.c (canon_true_dependence): Update comment.

From-SVN: r119358
2006-11-30 07:24:03 +00:00
Roger Sayle 4c6669c2c6 re PR middle-end/4520 (cselib.c hash_rtx incorrectly hashes based on rtx address)
PR middle-end/4520
	PR bootstrap/28784
	* cselib.c (cselib_hash_rtx): Avoid hashing on the address of labels
	and symbols.  Instead use the implementation from cse.c's hash_rtx.

From-SVN: r116891
2006-09-12 16:02:31 +00:00
Jan Hubicka 96d0cc8186 re PR middle-end/28071 (A file that can not be compiled in reasonable time/space)
PR rtl-optimization/28071
	* cselib.c (cselib_process_insn): Don't remove useless values too
	often for very large hashtables.

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

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

From-SVN: r111254
2006-02-18 22:06:53 +00:00
Marcin Dalecki 5ed6ace578 tree-vrp.c: Use XNEW/XCNEW allocation wrappers.
2006-01-31  Marcin Dalecki  <martin@dalecki.de>

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

From-SVN: r110446
2006-01-31 20:56:55 +01:00
Kazu Hirata 7c514720e4 cselib.c (hash_table): Rename to cselib_hash_table.
* cselib.c (hash_table): Rename to cselib_hash_table.
	(cselib_clear_table, discard_useless_values,
	remove_useless_values, cselib_lookup_mem, cselib_lookup,
	cselib_init, cselib_finish): Adjust uses of hash_table.

From-SVN: r109716
2006-01-15 02:16:11 +00:00
Richard Henderson 37cf61167f cse.c (exp_equiv_p): Special case CONST_DOUBLE.
* cse.c (exp_equiv_p): Special case CONST_DOUBLE.
        * cselib.c (rtx_equal_for_cselib_p): Likewise.
        * jump.c (rtx_renumbered_equal_p): Likewise.
        * loop.c (rtx_equal_for_loop_p): Tidy and special case PC, CC0,
        CONST_INT and CONST_DOUBLE.
        (rtx_equal_for_prefetch_p): Likewise, plus LABEL_REF.
        * reload.c (operands_match_p): Special case CONST_INT and
        CONST_DOUBLE; check mode earlier.

From-SVN: r102548
2005-07-28 22:57:44 -07:00
J"orn Rennecke 29c1846ba3 re PR rtl-optimization/22445 (Optimizations done by cselib depend on pointer values)
PR rtl-optimization/22445
	* cselib.c (target.h): Include.
	(rtx_equal_for_cselib_p): Allow commutative matches.
	(cselib_hash_rtx): Don't use MODE for CONST_INT hashing.
	Remove MODE parameter.  Changed all callers.

From-SVN: r102280
2005-07-22 13:06:18 +01:00
Kelley Cook 366ccddb2b Update FSF address.
From-SVN: r101317
2005-06-25 02:02:01 +00:00
Steven Bosscher eb232f4ef1 cselib.c (clear_table): Rename to cselib_clear_table.
* cselib.c (clear_table): Rename to cselib_clear_table.
	* cselib.h (cselib_clear_table): Add prototype.
	* gcse.c (gcse_main): Make 'f' argument unused.
	(alloc_gcse_mem): Do not walk the insn chain, walk the contents
	of each basic block instead.
	(compute_sets, compute_hash_table_work): Likewise.
	(constprop_register): Change int 'alter_jumps' argument to bool.
	(do_local_cprop): Likewise.
	(local_cprop_pass): Likewise.  Also walk basic blocks instead of
	the insn chain.  Explicitly clear the cselib tables after finishing
	one basic block.  Make sure there are no unterminated libcall blocks.
	Update compute_sets call.
	(cprop): Walk basic blocks instead of the insn chain.
	(one_cprop_pass, compute_ld_motion_mems, compute_store_table):
	Likewise.
	(bypass_jumps): Update alloc_gcse_mem, compute_sets, and
	one_cprop_pass calls.

From-SVN: r97945
2005-04-10 08:45:25 +00:00
Kazu Hirata 5211d65acf * cselib.c (reg_values, reg_values_size): Make them static.
From-SVN: r95987
2005-03-06 20:02:46 +00:00
Dale Johannesen 7e42db17f9 cselib.c (cselib_process_insn): Clear out regs where HARD_REGNO_CALL_PART_CLOBBERED is true at a call.
2005-02-11  Dale Johannesen  <dalej@apple.com>

	* cselib.c (cselib_process_insn):  Clear out regs where
	HARD_REGNO_CALL_PART_CLOBBERED is true at a call.
	* reload.c (find_equiv_reg): Ditto.

From-SVN: r94885
2005-02-11 18:12:33 +00:00
Kazu Hirata ad616de14c basic-block.h, [...]: Update copyright.
* basic-block.h, c-common.c, c-cppbuiltin.c, c-lang.c,
	c-tree.h, cfgbuild.c, cgraph.c, cgraph.h, collect2.c,
	combine.c, config.gcc, coverage.h, cse.c, cselib.c,
	defaults.h, df.c, dwarf2asm.c, dwarf2out.c, explow.c, expr.c,
	flow.c, fold-const.c, gcse.c, ggc-page.c, gimple-low.c,
	gimplify.c, ifcvt.c, langhooks-def.h, lcm.c, optabs.h,
	output.h, postreload-gcse.c, postreload.c, recog.c,
	resource.c, rtl.def, rtlanal.c, sched-deps.c, sched-rgn.c,
	targhooks.h, toplev.c, tree-data-ref.c, tree-eh.c,
	tree-flow.h, tree-loop-linear.c, tree-mudflap.h, tree-nrv.c,
	tree-optimize.c, tree-outof-ssa.c, tree-pass.h,
	tree-scalar-evolution.c, tree-ssa-copy.c, tree-ssa-dce.c,
	tree-ssa-dse.c, tree-ssa-loop-ivopts.c, tree-ssa-operands.c,
	tree-ssa-pre.c, tree-ssa.c, tree-vectorizer.c, tree.def,
	unwind-dw2-fde-darwin.c, var-tracking.c: Update copyright.

From-SVN: r93827
2005-01-18 11:36:31 +00:00
Steven Bosscher 46d096a3c7 combine.c (expand_compound_operation): Add comment that we fall through after case.
* combine.c (expand_compound_operation)  <ZERO_EXTRACT>: Add
	comment that we fall through after case.
	(mark_used_regs_combine): Don't expect a SIGN_EXTRACT in a SET_DEST.
	(distribute_links): Likewise.
	* cse.c (cse_insn): Likewise.
	* cselib.c (cselib_invalidate_mem): Likewise.
	* df.c: Update comments at the top of the file.
	(read_modify_subreg_p): Update comments here too.
	(df_def_record_1): Don't expect a SIGN_EXTRACT in a SET_DEST.
	* flow.c (mark_set_1): Likewise.
	(mark_used_regs): Likewise.
	* gcse.c (mems_conflict_for_gcse_p): Likewise.
	(canon_list_insert): Likewise.
	(mark_set): Likewise.
	(try_replace_reg): Likewise.
	(store_killed_in_insn): Likewise.
	* loop.c (count_one_set): Likewise.
	(basic_induction_var): Likewise.
	* postreload-gcse.c (find_mem_conflicts): Likewise.
	* postreload.c (reload_combine_note_store): Likewise.
	(move2add_note_store): Likewise.
	* reload.c (find_equiv_reg): Likewise.
	(mark_referenced_resources): Likewise.
	* rtlanal.c (set_noop_p): Likewise.
	(note_stores): Likewise.
	(note_uses): Likewise.
	* sched-deps.c (sched_analyze_1): Likewise.
	* sched-rgn.c (check_live_1): Likewise.
	(update_live_1): Likewise.
	* config/i860/i860.c: Likewise.

	* rtl.dec (SIGN_EXTRACT): Document that this cannot appear as
	an lvalue.
	(ZERO_EXTRACT): Mention that this one can be an lvalue.

	* doc/rtl.texi: Update documentation for bit-fields and SET.

From-SVN: r92974
2005-01-05 23:19:23 +00:00
Kazu Hirata daa956d01f * cselib.c, expr.c: Fix comment typos.
From-SVN: r90620
2004-11-14 13:05:19 +00:00
Steven Bosscher d67fb775b3 cse.c (CHEAP_REGNO): Redefine using REGNO_PTR_FRAME_P and HARD_REGISTER_NUM_P.
* cse.c (CHEAP_REGNO): Redefine using REGNO_PTR_FRAME_P and
	HARD_REGISTER_NUM_P.

	* cselib.c (new_cselib_val): Make comment correct and more detailed.
	* flow.c (mark_set_1): Likewise.

	* except.c (duplicate_eh_region_1, duplicate_eh_region_2,
	duplicate_eh_regions): Remove.
	* except.h (duplicate_eh_regions): Remove prototype.
	* integrate.c (get_label_from_map, copy_rtx_and_substitute,
	global_const_equiv_varray): Remove.
	* integrate.h (get_label_from_map, copy_rtx_and_substitute,
	global_const_equiv_varray, set_label_in_map): Remove prototypes,
	extern declaration, and #define.
	(MAYBE_EXTEND_CONST_EQUIV_VARRAY, SET_CONST_EQUIV_DATA): Remove.
	(struct inline_remap): Remove.
	* varray.c (struct element): Remove entry for const_equiv_data.
	* varray.h (struct const_equiv_data): Remove.
	(enum varray_data_enum) <VARRAY_DATA_CONST_EQUIV>: Remove.
	(union varray_data_tag) <const_equiv>: Remove.
	(VARRAY_CONST_EQUIV_INIT, VARRAY_CONST_EQUIV,
	VARRAY_PUSH_CONST_EQUIV, VARRAY_TOP_CONST_EQUIV): Remove.

	* regstack.c (record_label_references): Remove unused function.

	* rtl.def (VALUE): Update comment.
	(LABEL_REF): Remove unused operand 2.
	* rtl.h (struct rtx_def): Update for removed accessor macros.
	(XCADVFLAGS, INSN_DEAD_CODE_P, LINE_NUMBER, CONTAINING_INSN,
	REG_LOOP_TEST_P): Remove.
	(ADDR_DIFF_VEC_FLAGS, CSELIB_VAL_PTR, LABEL_NEXTREF): Add comments.
	* web.c (entry_register): Don't copy REG_LOOP_TEST_P.
	* doc/rtl.texi (INSN_DEAD_CODE_P, REG_LOOP_TEST_P): Remove.

From-SVN: r90580
2004-11-13 14:18:04 +00:00
Roger Sayle 5976e643ed re PR rtl-optimization/17581 (Long long arithmetic fails inside a switch/case statement when compiled with -O2)
PR rtl-optimization/17581
	* cselib.c (cselib_process_insn): The last instruction of a libcall
	block, with the REG_RETVAL note, should be considered in the libcall.
	* gcse.c (do_local_cprop): Allow constants to be propagated outside
	of libcall blocks.
	(adjust_libcall_notes): Use simplify_replace_rtx instead of
	replace_rtx to avoid creating invalid RTL in REG_RETVAL notes.

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

From-SVN: r89873
2004-10-30 00:56:59 +00:00
Richard Henderson 0d87c76525 re PR inline-asm/6806 (gcc 3.0.4 ignoring clobbered registers in inline asm with -O1 or higher on i386)
PR inline-asm/6806
        * cselib.c (cselib_invalidate_rtx): Export.  Remove unused args.
        (cselib_invalidate_rtx_note_stores): New.
        (cselib_record_sets, cselib_process_insn): Update to match.
        * cselib.h (cselib_invalidate_rtx): Declare.
        * postreload.c (reload_cse_simplify): Invalidate asm clobbers.

From-SVN: r87432
2004-09-13 02:05:31 -07:00
Nathan Sidwell 341c100fc5 cfganal.c (flow_depth_first_order_compute, [...]): Use gcc_assert or gcc_unreachable.
* cfganal.c (flow_depth_first_order_compute, dfs_enumerate_from,
	cfgbuild.c, inside_basic_block_p, control_flow_insn_p,
	make_label_edge, make_edges, find_basic_blocks_1): Use gcc_assert
	or gcc_unreachable.
	* cfg.c (clear_edges, initialize_bb_rbi, compact_blocks,
	remove_edge, alloc_aux_for_blocks, free_aux_for_blocks,
	alloc_aux_for_edges, free_aux_for_edges): Likewise.
	* cfgcleanup.c (try_forward_edges,
	merge_blocks_move_predecessor_nojumps,
	merge_blocks_move_successor_nojumps): Likewise.
	* cfgexpand.c (expand_gimple_cond_expr,
	expand_gimple_tailcall): Likewise.
	* cfghooks.c (duplicate_block): Likewise.
	* cfglayout.c (record_effective_endpoints,
	insn_locators_initialize, change_scope, fixup_reorder_chain,
	verify_insn_chain, fixup_fallthru_exit_predecessor,
	duplicate_insn_chain, cfg_layout_finalize): Likewise.
	* cfgloopanal.c (check_irred): Likewise.
	* cfgloop.c (superloop_at_depth, flow_loops_free,
	flow_loop_entry_edges_find, flow_loops_find,
	flow_loop_outside_edge_p, get_loop_body,
	get_loop_body_in_dom_order, get_loop_body_in_bfs_order,
	get_loop_exit_edges, num_loop_branches, cancel_loop,
	verify_loop_structure): Likewise.
	cfgloopmanip.c (find_path, remove_path, loop_delete_branch_edge,
	duplicate_loop_to_header_edge, create_preheader,
	create_loop_notes): Likewise.
	* cfgrtl.c (delete_insn, try_redirect_by_replacing_jump,
	edirect_branch_edge, force_nonfallthru_and_redirect,
	rtl_split_edge, insert_insn_on_edge, commit_one_edge_insertion,
	commit_edge_insertions, commit_edge_insertions_watch_calls,
	purge_dead_edges, cfg_layout_redirect_edge_and_branch,
	cfg_layout_redirect_edge_and_branch_force,
	cfg_layout_merge_blocks, rtl_flow_call_edges_add): Likewise.
	* cgraph.c (cgraph_node, cgraph_create_edge, cgraph_remove_edge,
	cgraph_redirect_edge_callee, cgraph_global_info, cgraph_rtl_info,
	cgraph_varpool_node): Likewise.
	* cgraphunit.c (cgraph_finalize_function,
	cgraph_finalize_compilation_unit, cgraph_mark_functions_to_output,
	cgraph_expand_function, cgraph_remove_unreachable_nodes,
	cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
	cgraph_mark_inline, cgraph_expand_all_functions,
	cgraph_build_static_cdtor): Likewise.
	* combine.c  (do_SUBST, try_combine, subst, combine_simplify_rtx,
	simplify_logical, distribute_notes, insn_cuid): Likewise.
	* conflict.c (conflict_graph_add, print_conflict): Likewise.
	* coverage.c (rtl_coverage_counter_ref, tree_coverage_counter_ref,
	coverage_checksum_string): Likewise.
	* cse.c (make_new_qty, make_regs_eqv, insert, invalidate,
	hash_rtx, exp_equiv_p, cse_basic_block, count_reg_usage,
	cse_cc_succs, cse_condition_code_reg): Likewise.
	* cselib.c (entry_and_rtx_equal_p, remove_useless_values,
	rtx_equal_for_cselib_p, wrap_constant, cselib_hash_rtx,
	new_cselib_val, cselib_subst_to_values, cselib_invalidate_regno,
	cselib_record_set): Likewise.

From-SVN: r87145
2004-09-07 15:46:53 +00:00
Steven Bosscher 0516f6fe82 Makefile.in (OBJS-common): Add postreload-gcse.c.
* Makefile.in (OBJS-common): Add postreload-gcse.c.
	Add new postreload-gcse.o.
	* cse.c (SAFE_HASH): Define as wrapper around safe_hash.
	(lookup_as_function, insert, rehash_using_reg, use_related_value,
	equiv_constant): Use SAFE_HASH instead of safe_hash.
	(exp_equiv_p): Export.  Add for_gcse argument when comparing
	for GCSE.
	(lookup, lookup_for_remove, merge_equiv_classes, find_best_addr,
	find_comparison_args, fold_rtx, cse_insn): Update callers.
	(hash_rtx): New function derived from old canon_hash and bits
	from gcse.c hash_expr_1.
	(canon_hash_string): Rename to hash_rtx_string.
	(canon_hash, safe_hash): Make static inline.  Call hash_rtx.
	* cselib.c (hash_rtx): Rename to cselib_hash_rtx.
	(cselib_lookup): Update this caller.
	* gcse.c (modify_mem_list_set, canon_modify_mem_list_set):
	Make static.
	(hash_expr): Call hash_rtx.
	(ldst_entry): Likewise.
	(expr_equiv_p): Call exp_equiv_p.
	(struct unoccr, hash_expr_1, hash_string_1, lookup_expr,
	reg_used_on_edge, reg_set_between_after_reload_p,
	reg_used_between_after_reload_p, get_avail_load_store_reg,
	is_jump_table_basic_block, bb_has_well_behaved_predecessors,
	get_bb_avail_insn, hash_scan_set_after_reload,
	compute_hash_table_after_reload,
	eliminate_partially_redundant_loads, gcse_after_reload,
	get_bb_avail_insn, gcse_after_reload_main): Remove.
	* postreload-gcse.c: New file, reincarnating most of the above.
	* rtl.h (exp_equiv_p, hash_rtx): New prototypes.
	(gcse_after_reload_main): Update prototype.
	* timevar.def (TV_GCSE_AFTER_RELOAD): New timevar.
	* passes.c (rest_of_handle_gcse2): Use it.

From-SVN: r86206
2004-08-18 20:53:59 +00:00
Jerry Quinn 4b4bf9414f alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P.
2004-07-08  Jerry Quinn  <jlquinn@optonline.net>

	* alias.c (nonlocal_mentioned_p, nonlocal_referenced_p,
	nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P,
	NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P.
	* bb-reorder.c (mark_bb_for_unlikely_executed_section,
	add_labels_and_missing_jumps, find_jump_block,
	fix_crossing_unconditional_branches, add_reg_crossing_jump_notes):
	Likewise.
	* bt-load.c (btr_referenced_p, compute_defs_uses_and_gen,
	link_btr_uses, move_btr_def): Likewise.
	* builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto,
	expand_builtin_expect_jump): Likewise.
	* caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise.
	* calls.c (expand_call, emit_library_call_value_1): Likewise.
	* cfganal.c (forwarder_block_p): Likewise.
	* cfgbuild.c (inside_basic_block_p, count_basic_blocks,
	make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1,
	find_bb_boundaries): Likewise.
	* cfgcleanup.c (try_simplify_condjump, try_forward_edges,
	merge_blocks_move_predecessor_nojumps,
	merge_blocks_move_successor_nojumps, insns_match_p,
	flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge,
	try_optimize_cfg): Likewise.
	* cfgexpand.c (expand_block, construct_exit_block): Likewise.
	* cfglayout.c (skip_insns_after_block, label_for_bb,
	record_effective_endpoints, insn_locators_initialize,
	fixup_reorder_chain, update_unlikely_executed_notes): Likewise.
	* cfgmainloop.c (create_loop_notes): Likewise.
	* cfgrtl.c (delete_insn, delete_insn_chain,
	create_basic_block_structure, rtl_delete_block, free_bb_for_insn,
	update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks,
	block_label, try_redirect_by_replacing_jump, last_loop_beg_note,
	redirect_branch_edge, force_nonfallthru_and_redirect,
	rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p,
	rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb,
	update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info,
	purge_dead_edges, cfg_layout_redirect_edge_and_branch,
	cfg_layout_delete_block, cfg_layout_can_merge_blocks_p,
	cfg_layout_merge_blocks, rtl_block_ends_with_call_p,
	need_fake_edge_p, rtl_flow_call_edges_add): Likewise.
	* combine.c (combine_instructions, can_combine_p, try_combine,
	find_split_point, record_dead_and_set_regs, reg_dead_at_p,
	distribute_notes, distribute_links, insn_cuid): Likewise.
	* cse.c (fold_rtx, cse_insn, cse_around_loop,
	invalidate_skipped_block, cse_set_around_loop,
	cse_end_of_basic_block, cse_main, cse_basic_block,
	cse_condition_code_reg): Likewise.
	* cselib.c (cselib_process_insn): Likewise.
	* ddg.c (create_ddg): Likewise.
	* df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify):
	Likewise.
	* dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug,
	gen_label_die, dwarf2out_var_location): Likewise.
	* emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn,
	next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn,
	last_call_insn, active_insn_p, next_label, prev_label,
	link_cc0_insns, next_cc0_user, try_split, add_insn_after,
	add_insn_before, remove_insn, add_function_usage_to,
	reorder_insns, find_line_note, remove_unnecessary_notes,
	emit_insn_after_1, classify_insn): Likewise.
	* except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before,
	connect_post_landing_pads, sjlj_mark_call_sites,
	sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers,
	can_throw_internal, can_throw_external, set_nothrow_function_flags,
	convert_to_eh_region_ranges): Likewise.
	* explow.c (optimize_save_area_alloca): Likewise.
	* expr.c (expand_expr_real): Likewise.
	* final.c (insn_current_reference_address, compute_alignments,
	shorten_branches, final, scan_ahead_for_unlikely_executed_note,
	final_scan_insn, output_asm_label, leaf_function_p): Likewise.
	* flow.c (first_insn_after_basic_block_note, delete_dead_jumptables,
	propagate_block_delete_insn, propagate_one_insn,
	init_propagate_block_info, propagate_block, libcall_dead_p,
	mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment):
	Likewise.
	* function.c (instantiate_virtual_regs,	reorder_blocks_1,
	expand_function_start, expand_function_end, contains,
	thread_prologue_and_epilogue_insns,
	reposition_prologue_and_epilogue_notes): Likewise.
	* gcse.c (constprop_register, bypass_conditional_jumps,
	insert_insn_end_bb, gcse_after_reload): Likewise.
	* genemit.c (gen_expand, gen_split): Likewise.
	* genpeep.c (gen_peephole, main): Likewise.
	* global.c (build_insn_chain): Likewise.
	* graph.c (node_data, print_rtl_graph_with_bb): Likewise.
	* haifa-sched.c (unlink_other_notes, unlink_line_notes,
	get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes,
	restore_line_notes, rm_redundant_line_notes, rm_other_notes,
	ok_for_early_queue_removal, set_priorities, sched_init): Likewise.
	* ifcvt.c (count_bb_insns, first_active_insn, last_active_insn,
	cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block,
	merge_if_block, block_jumps_and_fallthru_p, find_if_block,
	dead_or_predicable): Likewise.
	* integrate.c (try_constants): Likewise.
	* jump.c (rebuild_jump_labels, cleanup_barriers,
	purge_line_number_notes, init_label_info, mark_all_labels,
	squeeze_notes, get_label_before, get_label_after,
	reversed_comparison_code_parts, simplejump_p, pc_set,
	returnjump_p, onlyjump_p, follow_jumps, mark_jump_label,
	delete_barrier, delete_prior_computation, delete_computation,
	delete_related_insns, delete_for_peephole, redirect_jump):
	Likewise.
	* lcm.c (optimize_mode_switching): Likewise.
	* local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc):
	Likewise.
	* loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise.
	* loop-invariant.c (find_exits, find_invariants_bb): Likewise.
	* loop-iv.c (simplify_using_assignment): Likewise.
	* loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg,
	libcall_benefit, skip_consec_insns, move_movables, prescan_loop,
	find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop,
	loop_bivs_init_find, strength_reduce, check_insn_for_bivs,
	check_insn_for_givs, check_final_value, update_giv_derive,
	basic_induction_var, product_cheap_p, check_dbra_loop,
	loop_insn_first_p, last_use_this_basic_block,
	canonicalize_condition, get_condition, loop_regs_scan, load_mems,
	try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise.
	* modulo-sched.c (doloop_register_get, find_line_note, sms_schedule,
	sms_schedule_by_order): Likewise.
	* optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise.
	* postreload.c (reload_cse_simplify_operands, reload_combine,
	reload_cse_move2add): Likewise.
	* predict.c (can_predict_insn_p, estimate_probability,
	expected_value_to_br_prob, process_note_predictions): Likewise.
	* print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise.
	* profile.c (branch_prob): Likewise.
	* ra-build.c (live_out_1, livethrough_conflicts_bb,
	detect_webs_set_in_cond_jump): Likewise.
	* ra-debug.c (ra_print_rtx_object, ra_debug_insns,
	ra_print_rtl_with_bb): Likewise.
	* ra-rewrite.c (insert_stores, rewrite_program2): Likewise.
	* recog.c (next_insn_tests_no_inequality, find_single_use,
	split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise.
	* reg-stack.c (next_flags_user, record_label_references,
	emit_swap_insn, swap_rtx_condition, subst_stack_regs,
	compensate_edge, convert_regs_1): Likewise.
	* regclass.c (scan_one_insn): Likewise.
	* regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2,
	regmove_optimize, fixup_match_1, single_set_for_csa,
	combine_stack_adjustments_for_block): Likewise.
	* regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise.
	* reload.c (find_reloads, find_reloads_address_1, subst_reloads,
	find_equiv_reg): Likewise.
	* reload1.c (reload, calculate_needs_all_insns, set_label_offsets,
	reload_as_needed, emit_input_reload_insns, do_output_reload,
	delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges):
	Likewise.
	* reorg.c (find_end_label, emit_delay_sequence,
	delete_from_delay_slot, delete_scheduled_jump, optimize_skip,
	get_jump_flags, rare_destination, mostly_true_jump,
	try_merge_delay_insns, redundant_insn, own_thread_p,
	fill_simple_delay_slots, fill_slots_from_thread,
	fill_eager_delay_slots, relax_delay_slots, make_return_insns,
	dbr_schedule): Likewise.
	* resource.c (find_basic_block, next_insn_no_annul,
	find_dead_or_set_registers, mark_target_live_regs): Likewise.
	* rtl.h (RTX_PREV): Likewise.
	* rtlanal.c (global_reg_mentioned_p, no_labels_between_p,
	no_jumps_between_p, reg_used_between_p, reg_referenced_between_p,
	reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage,
	find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1,
	tablejump_p, computed_jump_p, insns_safe_to_move_p,
	find_first_parameter_load, can_hoist_insn_p): Likewise.
	* sched-deps.c (get_condition, add_dependence, sched_analyze_2,
	sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise.
	* sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns,
	schedule_ebbs): Likewise.
	* sched-rgn.c (is_cfg_nonregular, find_conditional_protection,
	is_conditionally_protected, can_schedule_ready_p,
	add_branch_dependences, debug_dependencies): Likewise.
	* stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable):
	Likewise.
	* unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p,
	reg_dead_after_loop, loop_find_equiv_value, loop_iterations,
	set_dominates_use, ujump_to_loop_cont): Likewise.
	* var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise.
	* varasm.c (output_constant_pool_1): Likewise.

From-SVN: r84341
2004-07-09 03:29:35 +00:00
Jerry Quinn 3c0cb5de6a alias.c (get_alias_set, [...]): Use MEM_P.
2004-07-01  Jerry Quinn  <jlquinn@optonline.net>

	* alias.c (get_alias_set, canon_rtx, get_addr,
	nonoverlapping_memrefs_p, nonlocal_referenced_p_1, memory_modified_1):
	Use MEM_P.
	* builtins.c (expand_builtin_prefetch, expand_builtin_profile_func,
	expand_builtin): Likewise.
	* calls.c (expand_call, emit_library_call_value_1, store_one_arg):
	Likewise.
	* combine.c (can_combine_p, combinable_i3pat, try_combine,
	find_split_point, combine_simplify_rtx, simplify_set, make_extraction,
	rtx_equal_for_field_assignment_p, gen_lowpart_for_combine,
	record_dead_and_set_regs_1, get_last_value_validate,
	mark_used_regs_combine, move_deaths, unmentioned_reg_p_1): Likewise.
	* cse.c (check_dependence, canon_hash, equiv_constant,
	gen_lowpart_if_possible, cse_insn, invalidate_from_clobbers,
	cse_around_loop, cse_check_loop_start, cse_set_around_loop,
	count_reg_usage): Likewise.
	* cselib.c (rtx_equal_for_cselib_p, add_mem_for_addr, cselib_lookup,
	cselib_invalidate_mem, cselib_invalidate_rtx, cselib_record_set,
	cselib_record_sets): Likewise.
	* dbxout.c (PARM_PASSED_IN_MEMORY, dbxout_symbol,
	dbxout_symbol_location, dbxout_parms, dbxout_reg_parms): Likewise.
	* ddg.c (mark_mem_use, mark_mem_store, rtx_mem_access_p): Likewise.
	* df.c (df_uses_record): Likewise.
	* dojump (do_jump): Likewise.
	* dwarf2out.c (stack_adjust_offset, mem_loc_descriptor,
	loc_descriptor_from_tree, rtl_for_decl_location, add_bound_info,
	decl_start_label): Likewise.
	* emit-rtl.c (gen_complex_constant_part, gen_highpart,
	operand_subword, change_address_1, make_safe_from): Likewise.
	* explow.c (break_out_memory_refs, copy_all_regs, validize_mem,
	stabilize, force_not_mem): Likewise.
	* expmed.c (store_bit_field, store_split_bit_field, extract_bit_field,
	expand_mult_const, expand_divmod, emit_store_flag): Likewise.
	* expr.c (convert_move, convert_modes, emit_block_move,
	emit_group_load, emit_group_store, clear_storage, emit_move_insn,
	emit_move_insn_1, expand_assignment, store_expr,
	store_constructor_field, store_constructor, store_field,
	force_operand, safe_from_p, expand_expr_real_1, expand_increment):
	Likewise.
	* final.c (cleanup_subreg_operands, alter_subreg,
	get_mem_expr_from_op): Likewise.
	* flow.c (notice_stack_pointer_modification_1,
	init_propagate_block_info, insn_dead_p, mark_set_1, mark_used_regs):
	Likewise.
	* function.c (mark_temp_addr_taken, preserve_temp_slots,
	preserve_rtl_expr_result, put_var_into_stack, fixup_var_refs_1,
	optimize_bit_field, flush_addressof, purge_addressof_1,
	instantiate_decl, instantiate_virtual_regs_1, assign_parms,
	setjmp_protect, setjmp_protect_args, fix_lexical_addr,
	keep_stack_depressed): Likewise.
	* ifcvt.c (noce_try_cmove_arith, noce_try_abs, noce_operand_ok,
	noce_process_if_block, find_memory): Likewise.
	* integrate.c (subst_constants, allocate_initial_values): Likewise.
	* local-alloc.c (validate_equiv_mem_from_store, memref_referenced_p,
	update_equiv_regs): Likewise.
	* loop.c (scan_loop, prescan_loop, note_addr_stored, check_store,
	maybe_eliminate_biv_1, find_mem_in_note_1): Likewise.
	* optabs.c (expand_abs, emit_unop_insn): Likewise.
	* passes.c (rest_of_handle_final): Likewise.
	* postreload.c (reload_cse_simplify_set, reload_cse_simplify_operands,
	move2add_note_store): Likewise.
	* ra-build.c (detect_remat_webs): Likewise.
	* ra-debug.c (dump_static_insn_cost): Likewise.
	* ra-rewrite.c (slots_overlap_p, insert_stores): Likewise.
	* recog.c (validate_change, apply_change_group, cancel_changes,
	validate_replace_rtx_1, general_operand, register_operand,
	nonmemory_operand, push_operand, pop_operand, memory_operand,
	indirect_operand, asm_operand_ok, offsettable_memref_p,
	offsettable_nonstrict_memref_p, constrain_operands,
	store_data_bypass_p): Likewise.
	* reg-stack.c (subst_stack_regs_pat): Likewise.
	* regclass.c (record_operand_costs, scan_one_insn, record_reg_classes,
	copy_cost, reg_scan_mark_refs): Likewise.
	* regmove.c (optimize_reg_copy_3, stack_memref_p,
	combine_stack_adjustments_for_block): Likewise.
	* regrename.c (copyprop_hardreg_forward_1): Likewise.
	* reload.c (can_reload_into, push_reload, decompose, immune_p,
	find_reloads, find_reloads_address, find_reloads_address_1,
	reg_overlap_mentioned_for_reload_p, refers_to_mem_for_reload_p,
	find_equiv_reg): Likewise.
	* reload1.c (reload, eliminate_regs, eliminate_regs_in_insn,
	reload_as_needed, choose_reload_regs, emit_input_reload_insns,
	do_input_reload, emit_reload_insns, gen_reload, delete_output_reload,
	delete_address_reloads): Likewise.
	* resource.c (mark_referenced_resources): Likewise.
	* rtlanal.c (get_jump_table_offset, count_occurrences,
	reg_referenced_p, reg_set_p, set_of_1, set_noop_p,
	reg_overlap_mentioned_p, note_uses, replace_regs, nonzero_bits1,
	num_sign_bit_copies1): Likewise.
	* rtlhooks.c (gen_lowpart_general): Likewise.
	* sched-deps.c (sched_analyze_1, sched_analyze_2): Likewise.
	* sdbout.c (PARM_PASSED_IN_MEMORY, sdbout_symbol,
	sdbout_toplevel_data, sdbout_parms, sdbout_reg_parms,
	sdbout_global_decl): Likewise.
	* simplify-rtx.c (simplify_subreg): Likewise.
	* stmt.c (expand_asm_operands, expand_expr_stmt_value, expand_decl,
	expand_anon_union_decl, expand_end_case_type): Likewise.
	* unroll.c (calculate_giv_inc): Likewise.
	* var-tracking.c (stack_adjust_offset_pre_post,
	bb_stack_adjust_offset, track_expr_p, count_uses, add_uses,
	add_stores, compute_bb_dataflow, vt_get_decl_and_offset,
	vt_add_function_parameters): Likewise.
	* varasm.c (make_var_volatile, notice_global_symbol,
	assemble_external, decode_addr_const, mark_weak,
	default_encode_section_info): Likewise.

From-SVN: r83980
2004-07-01 12:52:53 +00:00
Jerry Quinn f8cfc6aa07 alias.c (record_set, [...]): Use REG_P.
2004-06-15  Jerry Quinn  <jlquinn@optonline.net>

	* alias.c (record_set, record_base_value, canon_rtx, get_addr,
	nonlocal_mentioned_p_1, init_alias_analysis): Use REG_P.
	* bt-load.c (find_btr_reference, insn_sets_btr_p, note_btr_set):
	Likewise.
	* builtins.c (expand_builtin_setjmp, expand_builtin_apply,
	expand_builtin_mathfn, expand_builtin_strlen, expand_builtin_memcmp,
	expand_builtin_strcmp, expand_builtin_strncmp,
	expand_builtin_frame_address): Likewise.
	* caller-save.c (mark_set_regs, add_stored_regs, mark_referenced_regs,
	insert_one_insn): Likewise.
	* calls.c (prepare_call_address, precompute_register_parameters,
	precompute_arguments, expand_call, emit_library_call_value_1): Likewise.
	* cfganal.c (flow_active_insn_p): Likewise.
	* combine.c (set_nonzero_bits_and_sign_copies, can_combine_p,
	combinable_i3pat, try_combine, find_split_point, COMBINE_RTX_EQUAL_P,
	subst, combine_simplify_rtx, simplify_if_then_else, simplify_set,
	make_extraction, recog_for_combine, gen_lowpart_for_combine,
	simplify_comparison, record_dead_and_set_regs_1,
	record_dead_and_set_regs, record_promoted_value,
	check_promoted_subreg, get_last_value_validate, get_last_value,
	reg_dead_at_p_1, reg_bitfield_target_p, distribute_notes,
	unmentioned_reg_p_1): Likewise.
	* conflict.c (mark_reg): Likewise.
	* cse.c (HASH, COST, COST_IN, approx_reg_cost_1, notreg_cost,
	mention_regs, insert_regs, lookup, lookup_for_remove, insert,
	merge_equiv_classes, flush_hash_table, invalidate,
	remove_invalid_refs, remove_invalid_subreg_refs, rehash_using_reg,
	invalidate_for_call, use_related_value, canon_hash, exp_equiv_p,
	cse_rtx_varies_p, canon_reg, find_best_addr, fold_rtx, equiv_constant,
	record_jump_cond, cse_insn, addr_affects_sp_p,
	invalidate_from_clobbers, cse_process_notes, cse_around_loop,
	cse_set_around_loop, count_reg_usage, set_live_p, cse_change_cc_mode,
	cse_cc_succs, cse_condition_code_reg): Likewise.
	* cselib.c (cselib_reg_set_mode, rtx_equal_for_cselib_p,
	cselib_lookup, cselib_invalidate_regno, cselib_invalidate_rtx,
	cselib_record_set, cselib_record_sets): Likewise.
	* dbxout.c (dbxout_symbol_location, dbxout_parms, dbxout_reg_parms,
	dbxout_block): Likewise.
	* df.c (df_ref_record, df_def_record_1, df_uses_record): Likewise.
	* dojump.c (do_jump): Likewise.
	* dwarf2out.c (dwarf2out_frame_debug_expr, is_pseudo_reg,
	is_based_loc, rtl_for_decl_location): Likewise.
	* emit-rtl.c (set_reg_attrs_for_parm, set_decl_rtl,
	set_decl_incoming_rtl, mark_user_reg): Likewise.
	* explow.c (copy_all_regs, copy_all_regs, memory_address, force_reg,
	copy_to_suggested_reg, allocate_dynamic_stack_space,
	probe_stack_range, hard_function_value): Likewise.
	* expmed.c (store_bit_field, store_fixed_bit_field,
	store_split_bit_field, extract_bit_field, extract_fixed_bit_field,
	extract_split_bit_field, expand_divmod, emit_store_flag_force):
	Likewise.
	* expr.c (convert_move, convert_modes,
	block_move_libcall_safe_for_call_parm, emit_group_load, use_reg,
	use_group_regs, emit_move_insn, emit_move_insn_1,
	compress_float_constant, push_block, emit_single_push_insn,
	emit_push_insn, get_subtarget, expand_assignment, store_expr,
	store_constructor, store_field, force_operand, safe_from_p,
	expand_expr_real_1, expand_increment, do_store_flag, do_tablejump):
	Likewise.
	* final.c (profile_function, final_scan_insn, alter_subreg,
	get_mem_expr_from_op, output_asm_operand_names, output_operand,
	only_leaf_regs_used, leaf_renumber_regs_insn): Likewise.
	* flow.c (verify_wide_reg_1, mark_regs_live_at_end,
	find_regno_partial, propagate_one_insn, init_propagate_block_info,
	insn_dead_p, libcall_dead_p, mark_set_1, not_reg_cond,
	attempt_auto_inc, find_auto_inc, mark_used_regs,
	count_or_remove_death_notes_bb): Likewise.
	* function.c (find_temp_slot_from_address, update_temp_slot_address,
	preserve_temp_slots, put_var_into_stack, fixup_var_refs_insn,
	fixup_var_refs_1, fixup_stack_1, optimize_bit_field, flush_addressof,
	put_addressof_into_stack, purge_addressof_1, insns_for_mem_walk,
	purge_single_hard_subreg_set, instantiate_decl,
	instantiate_virtual_regs_1, aggregate_value_p, assign_parms,
	promoted_input_arg, setjmp_vars_warning, setjmp_args_warning,
	setjmp_protect, setjmp_protect_args, fix_lexical_addr,
	expand_function_start, diddle_return_value, clobber_return_register,
	expand_function_end, keep_stack_depressed, handle_epilogue_set,
	update_epilogue_consts): Likewise.
	* genemit.c (gen_exp, gen_insn): Likewise.
	* genrecog.c (make_insn_sequence): Likewise.
	* global.c (global_conflicts, expand_preferences, mark_reg_store,
	mark_reg_conflicts, set_preference, reg_becomes_live,
	build_insn_chain, mark_reg_change): Likewise.
	* haifa_sched.c (CONST_BASED_ADDRESS_P, find_set_reg_weight):
	Likewise.
	* ifcvt.c (noce_try_abs, noce_get_condition, noce_process_if_block):
	Likewise.
	* integrate.c (copy_rtx_and_substitute, try_constants,
	subst_constants, mark_stores, allocate_initial_values): Likewise.
	* jump.c (reversed_comparison_code_parts, delete_prior_computation,
	delete_computation, rtx_renumbered_equal_p, true_regnum,
	reg_or_subregno): Likewise.
	* lcm.c (reg_dies, reg_becomes_live): Likewise.
	* local-alloc.c (validate_equiv_mem_from_store, validate_equiv_mem,
	update_equiv_regs, no_equiv, block_alloc, combine_regs, reg_is_set,
	wipe_dead_reg, no_conflict_p): Likewise.
	* loop-iv.c (simple_reg_p, simple_set_p, kill_sets,
	iv_get_reaching_def, iv_analyze_biv, altered_reg_used, mark_altered,
	simple_rhs_p, simplify_using_assignment, implies_p): Likewise.
	* loop.c (scan_loop, combine_movables, rtx_equal_for_loop_p,
	move_movables, note_set_pseudo_multiple_uses, consec_sets_invariant_p,
	find_single_use_in_loop, count_one_set, loop_bivs_init_find,
	loop_givs_rescan, check_insn_for_bivs, check_insn_for_givs,
	valid_initial_value_p, simplify_giv_expr, consec_sets_giv,
	loop_regs_update, check_dbra_loop, maybe_eliminate_biv,
	maybe_eliminate_biv_1, record_initial, update_reg_last_use,
	canonicalize_condition, loop_regs_scan, load_mems, try_copy_prop,
	try_swap_copy_prop): Likewise.
	* optabs.c (expand_binop, expand_vector_binop, expand_vector_unop,
	expand_abs, emit_no_conflict_block, emit_libcall_block, expand_float):
	Likewise.
	* postreload.c (reload_cse_simplify, reload_cse_simplify_set,
	reload_cse_simplify_operands, reload_combine,
	reload_combine_note_store, reload_combine_note_use,
	reload_cse_move2add, move2add_note_store): Likewise.
	* print-rtl.c (print_rtx): Likewise.
	* ra-build.c (copy_insn_p, remember_move, init_one_web_common,
	contains_pseudo, handle_asm_insn): Likewise.
	* ra-debug.c (ra_print_rtx_object, dump_constraints,
	dump_static_insn_cost): Likewise.
	* ra-rewrite.c (slots_overlap_p, emit_colors,
	remove_suspicious_death_notes): Likewise.
	* recog.c (validate_replace_rtx_1, find_single_use_1, find_single_use,
	register_operand, scratch_operand, nonmemory_operand,
	constrain_operands): Likewise.
	* reg-stack (check_asm_stack_operands, remove_regno_note,
	emit_swap_insn, swap_rtx_condition, subst_stack_regs_pat,
	subst_asm_stack_regs): Likewise.
	* regclass.c (scan_one_insn, record_reg_classes, copy_cost,
	record_address_regs, reg_scan_mark_refs): Likewise.
	* regmove.c (discover_flags_reg, replacement_quality,
	copy_src_to_dest, reg_is_remote_constant_p, regmove_optimize,
	fixup_match_1): Likewise.
	* regrename.c (note_sets, clear_dead_regs, build_def_use, kill_value,
	kill_set_value, copyprop_hardreg_forward_1): Likewise.
	* reload.c (MATCHES, push_secondary_reload, find_reusable_reload,
	reload_inner_reg_of_subreg, can_reload_into, push_reload,
	combine_reloads, find_dummy_reload, hard_reg_set_here_p,
	operands_match_p, decompose, find_reloads, find_reloads_toplev,
	find_reloads_address, subst_indexed_address, find_reloads_address_1,
	find_reloads_subreg_address, find_replacement,
	refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p,
	refers_to_mem_for_reload_p, find_equiv_reg, regno_clobbered_p): Likewise.
	* reload1.c (replace_pseudos_in, reload, calculate_needs_all_insns,
	find_reg, delete_dead_insn, alter_reg, eliminate_regs,
	elimination_effects, eliminate_regs_in_insn, scan_paradoxical_subregs,
	forget_old_reloads_1, reload_reg_free_for_value_p, choose_reload_regs,
	emit_input_reload_insns, emit_output_reload_insns, do_input_reload,
	do_output_reload, emit_reload_insns, gen_reload,
	delete_address_reloads_1, inc_for_reload): Likewise.
	* reorg.c (update_reg_dead_notes, fix_reg_dead_note,
	update_reg_unused_notes, fill_slots_from_thread): Likewise.
	* resource.c (update_live_status, mark_referenced_resources,
	mark_set_resources, mark_target_live_regs): Likewise.
	* rtlanal.c (nonzero_address_p, get_jump_table_offset,
	global_reg_mentioned_p_1, reg_mentioned_p, reg_referenced_p,
	reg_set_p, set_noop_p, find_last_value, refers_to_regno_p,
	note_stores, dead_or_set_p, dead_or_set_regno_p, find_regno_note,
	find_reg_fusage, find_regno_fusage, replace_regs, regno_use_in,
	parms_set, find_first_parameter_load, keep_with_call_p,
	hoist_test_store, hoist_update_store, address_cost, nonzero_bits1,
	num_sign_bit_copies1): Likewise.
	* rtlhooks.c (gen_lowpart_general): Likewise.
	* sched-deps.c (deps_may_trap_p, sched_analyze_1, sched_analyze_insn,
	sched_analyze): Likewise.
	* sched-rgn.c (check_live_1, update_live_1, sets_likely_spilled_1):
	Likewise.
	* sdbout.c (sdbout_symbol, sdbout_parms, sdbout_reg_parms): Likewise.
	* simplify-rtx.c (simplify_replace_rtx, simplify_unary_operation,
	simplify_binary_operation, simplify_const_relational_operation,
	simplify_subreg): Likewise.
	* stmt.c (decl_conflicts_with_clobbers_p, expand_asm_operands,
	expand_end_stmt_expr, expand_return, expand_decl,
	expand_anon_union_decl): Likewise.
	* unroll.c (precondition_loop_p, calculate_giv_inc, copy_loop_body,
	find_splittable_regs, find_splittable_givs, find_common_reg_term,
	loop_iterations): Likewise.
	* var-tracking.c (variable_union, variable_part_different_p,
	variable_different_p, count_uses, add_uses, add_stores,
	compute_bb_dataflow, set_variable_part, delete_variable_part,
	emit_notes_in_bb, vt_get_decl_and_offset, vt_add_function_parameters):
	Likewise.
	* varasm.c (assemble_variable): Likewise.

From-SVN: r83195
2004-06-15 18:02:40 +00:00
Jerry Quinn 785287145e Makefile.in (EXPR_H): Add insn-config.h...
2004-06-01  Jerry Quinn  <jlquinn@optonline.net>

	* Makefile.in (EXPR_H): Add insn-config.h, function.h,
	$(RTL_H), flags.h, $(TREE_H), $(MACHMODE_H), $(EXPR_H).
	(ALIAS_H, EMIT_RTL_H): New.
	(cselib.o): Replace EXPR_H with EMIT_RTL_H.
	(cfgcleanup.o): Add EMIT_RTL_H.
	(alias.o): Replace EXPR_H with EMIT_RTL_H and ALIAS_H.
	* alias.c: Replace expr.h with emit-rtl.h and alias.h.
	* attribs.c, c-lex.c, c-obj-common.c, c-semantics.c: Remove expr.h.
	* cfgcleanup.c, cselib.c: Replace expr.h with emit-rtl.h.
	* expr.h: Add include guard.  Include function.h, rtl.h, flags.h,
	tree.h, machmode.h, insn-config.h, alias.h, emit-rtl.h.
	(get_varargs_alias_set, get_frame_alias_set, record_base_value,
	record_alias_subset, new_alias_set, can_address_p): Move to alias.h.
	(set_mem_alias_set, set_mem_align, set_mem_expr, set_mem_offset,
	set_mem_size): Move to emit-rtl.h.
	* emit-rtl.h: New.
	* alias.h: New.

From-SVN: r82568
2004-06-02 02:09:45 +00:00
Jakub Jelinek fb5d4a68e5 cselib.h (struct elt_loc_list): Remove canon_loc field.
* cselib.h (struct elt_loc_list): Remove canon_loc field.
	* cselib.c (new_elt_loc_list): Remove canon_loc initialization.
	(cselib_invalidate_mem): Remove all canon_loc and canon_x
	traces.

From-SVN: r81037
2004-04-22 19:47:47 +02:00
Jan Hubicka 463301c30e cfgcleanup.c (thread_jump): Update call of cselib_init.
* cfgcleanup.c (thread_jump): Update call of cselib_init.
	* cselib.c (cselib_record_memory): New static variable.
	(cselib_lookup_mem, cselib_record_set, cselib_record_sets):
	Give up on memories when asked for.
	(cselib_init): Accept new argument.
	* cselib.h (cselib_init): Update prototype.
	* gcse.c (local_cprop_pass): Update call of cselib_init.
	* loop.c (load_mems): Update call of cselib_init.
	* postreload.c (reload_cse_regs_1): Update call of cselib_init.
	* sched-deps.c (sched_analyze): Update call of cselib_init.

From-SVN: r78917
2004-03-04 16:28:50 +00:00
Jan Hubicka 370d11ad13 Undo accidentally commited garbage.
From-SVN: r78877
2004-03-04 02:05:56 +00:00
Jan Hubicka e654c19ec1 cselib.c (cselib_finish): Fix another miss-application of my previous patch.
* cselib.c (cselib_finish): Fix another miss-application of my previous
	patch.

From-SVN: r78876
2004-03-04 02:04:15 +00:00
Jan Hubicka 0fc0c4c997 cselib.c (cselib_finish): Fix miss-application of my previous patch.
* cselib.c (cselib_finish): Fix miss-application of my previous
	patch.

From-SVN: r78869
2004-03-04 00:04:38 +00:00
Richard Henderson b7048ab7b2 re PR rtl-optimization/13862 (ICE while optimizing asm)
PR opt/13862
        * cselib.c (cselib_record_sets): Don't record multiple sets in
        asm insns.

From-SVN: r78845
2004-03-03 10:31:36 -08:00
Jan Hubicka 6790d1abcc cselib.c (hash_table): Remove GTY marker.
* cselib.c (hash_table):  Remove GTY marker.
	(reg_values): Turn into array.
	(used_regs): Likewise.
	(n_used_regs): New static variable.
	(reg_values_old): Kill.
	(clear_table): Update uses of arrays.
	(cselib_lookup): Likewise.
	(cselib_record_set): Likewise.
	(cselib_init): Likewise.
	(cselib_finish): Likewise.
	(cselib_udpate_varray_sizes): Kill.
	* cselib.h (cselib_update_varray_sizes): Kill.

From-SVN: r78830
2004-03-03 14:02:43 +00:00