Commit Graph

207 Commits

Author SHA1 Message Date
Richard Guenther e9d85fa6a7 re PR tree-optimization/23821 (DOM and VRP creating harder to optimize code)
2009-10-05  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/23821
	* tree-vrp.c (vrp_finalize): Do not perform copy propagation.
	* tree-ssa-dom.c (cprop_operand): Do not propagate copies into
	simple IV increments.

	* gcc.dg/torture/pr23821.c: New testcase.

From-SVN: r152449
2009-10-05 13:18:09 +00:00
Michael Matz 44e10129de builtins.c (interclass_mathfn_icode): New helper.
* builtins.c (interclass_mathfn_icode): New helper.
	(expand_builtin_interclass_mathfn): Use it here, and split folding
	into ...
	(fold_builtin_interclass_mathfn): ... this new folder.
	(build_call_nofold_loc): New static helper.
	(build_call_nofold): New wrapper macro for above.
	(expand_builtin_int_roundingfn): Use it instead of build_call_expr.
	(expand_builtin_pow): Ditto.
	(expand_builtin_memset_args): Ditto.
	(expand_builtin_printf): Ditto.
	(expand_builtin_fprintf): Ditto.
	(expand_builtin_sprintf): Ditto.
	(expand_builtin_memory_chk): Ditto.
	(expand_builtin_mempcpy_args): Ditto and don't call folders.
	(expand_builtin_stpcpy): Ditto.
	(expand_builtin_strcmp): Ditto.
	(expand_builtin_strncmp): Ditto.
	(expand_builtin_strcpy): Remove FNDECL and MODE arguments.
	(expand_builtin_strcpy_args): Don't call folders.
	(expand_builtin_memcmp): Ditto.
	(expand_builtin_strncpy): Ditto, and use target.
	(expand_builtin_memcpy): Ditto.
	(expand_builtin_strstr, expand_builtin_strchr, expand_builtin_strrchr,
	expand_builtin_strpbrk, expand_builtin_memmove,
	expand_builtin_memmove_args, expand_builtin_bcopy,
	expand_builtin_memchr, expand_builtin_strcat, expand_builtin_strncat,
	expand_builtin_strspn, expand_builtin_strcspn,
	expand_builtin_fputs): Remove these.
	(expand_builtin): Don't call the above, change calls to other
	expanders that changed prototype.
	(fold_builtin_stpcpy): New folder split out from expand_builtin_stpcpy.
	(fold_builtin_1 <ISFINITE, ISINF, ISNORMAL>): Call
	fold_builtin_interclass_mathfn.
	(fold_builtin_2 <STPCPY>): Call fold_builtin_stpcpy.
	(fold_builtin_strcat): Add folding split from expand_builtin_strcat.

	* fold-const.c (fold_binary_loc <NE_EXPR>): Add !exp != 0 -> !exp.
	* passes.c (init_optimization_passes): Move pass_fold_builtins
	after last phiopt pass.
	* tree-inline.c (fold_marked_statements): When folding builtins
	iterate over all instruction potentially generated.
	* tree-ssa-ccp.c (gimplify_and_update_call_from_tree): Declare
	earlier.
	(fold_gimple_call): Use it to always fold calls (into potentially
	multiple instructions).
	* tree-ssa-dom.c (optimize_stmt): Resolve __builtin_constant_p
	calls into zero at this time.
	* tree-ssa-propagate.c (substitute_and_fold): Ignore multiple 
	statements generated by builtin folding.

testsuite/
	* gcc.dg/builtins-44.c: Use __builtin_isinf_sign when checking
	for sign of -Inf.

From-SVN: r152236
2009-09-28 12:54:23 +00:00
Michael Matz 87c93592d0 re PR tree-optimization/41454 (DOM miscompiles gcc.c-torture/execute/990513-1.c at -O2 -fno-tree-vrp)
PR tree-optimization/41454
	* tree-ssa-dom (stmts_to_rescan): Remove variable.
	(tree_ssa_dominator_optimize): Don't allocate and free it.
	(dom_opt_leave_block): Don't iterate over it.
	(eliminate_redundant_computations): Don't return a value.
	(cprop_operand, cprop_into_stmt): Ditto.
	(optimize_stmt): Don't defer updating stmts.

testsuite/
	* gcc.dg/pr41454.c: New test.

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

From-SVN: r151312
2009-09-02 02:42:21 +00:00
Aldy Hernandez db3927fb49 re PR c/40435 (Revision 148442 caused many regressions on trunk)
2009-07-17  Aldy Hernandez  <aldyh@redhat.com>
	    Manuel López-Ibáñez  <manu@gcc.gnu.org>

	PR 40435 
	* tree-complex.c, tree-loop-distribution.c,
	tree.c, tree.h, builtins.c, fold-const.c, omp-low.c,
	cgraphunit.c, tree-ssa-ccp.c, tree-ssa-dom.c,
	gimple-low.c, expr.c, tree-ssa-ifcombine.c, c-decl.c,
	stor-layout.c, tree-if-conv.c, c-typeck.c,
	gimplify.c, calls.c, tree-sra.c, tree-mudflap.c,
	tree-ssa-copy.c, tree-ssa-forwprop.c, c-convert.c, c-omp.c,
	varasm.c, tree-inline.c, c-common.c,
	c-common.h, gimple.c, tree-switch-conversion.c, gimple.h,
	tree-cfg.c, c-parser.c, convert.c: Add location
	argument to fold_{unary,binary,ternary}, fold_build[123],
	build_call_expr, build_size_arg, build_fold_addr_expr,
	build_call_array, non_lvalue, size_diffop,
	fold_build1_initializer, fold_build2_initializer,
	fold_build3_initializer, fold_build_call_array,
	fold_build_call_array_initializer, fold_single_bit_test,
	omit_one_operand, omit_two_operands, invert_truthvalue,
	fold_truth_not_expr, build_fold_indirect_ref, fold_indirect_ref,
	combine_comparisons, fold_builtin_*, fold_call_expr,
	build_range_check, maybe_fold_offset_to_address, round_up,
	round_down.
objc/
	* objc-act.c: Add location argument to all calls to
	build_fold_addr_expr.
testsuite/
	* gcc.dg/pr36902.c: Add column info.
	* g++.dg/gcov/gcov-2.C: Change count for definition.
cp/
	* typeck.c, init.c, class.c, method.c, rtti.c, except.c, error.c,
	tree.c, cp-gimplify.c, cxx-pretty-print.c, pt.c, semantics.c,
	call.c, cvt.c, mangle.c: Add location argument to
	fold_{unary,binary,ternary}, fold_build[123], build_call_expr,
	build_size_arg, build_fold_addr_expr, build_call_array,
	non_lvalue, size_diffop, fold_build1_initializer,
	fold_build2_initializer, fold_build3_initializer,
	fold_build_call_array, fold_build_call_array_initializer,
	fold_single_bit_test, omit_one_operand, omit_two_operands,
	invert_truthvalue, fold_truth_not_expr, build_fold_indirect_ref,
	fold_indirect_ref, combine_comparisons, fold_builtin_*,
	fold_call_expr, build_range_check, maybe_fold_offset_to_address,
	round_up, round_down.
fortran/
	* trans-expr.c, trans-array.c, trans-openmp.c, trans-stmt.c,
	trans.c, trans-io.c, trans-decl.c, trans-intrinsic.c: Add location
	argument to fold_{unary,binary,ternary}, fold_build[123],
	build_call_expr, build_size_arg, build_fold_addr_expr,
	build_call_array, non_lvalue, size_diffop,
	fold_build1_initializer, fold_build2_initializer,
	fold_build3_initializer, fold_build_call_array,
	fold_build_call_array_initializer, fold_single_bit_test,
	omit_one_operand, omit_two_operands, invert_truthvalue,
	fold_truth_not_expr, build_fold_indirect_ref, fold_indirect_ref,
	combine_comparisons, fold_builtin_*, fold_call_expr,
	build_range_check, maybe_fold_offset_to_address, round_up,
	round_down.

Co-Authored-By: Manuel López-Ibáñez <manu@gcc.gnu.org>

From-SVN: r149722
2009-07-16 22:29:52 +00:00
Paolo Bonzini ccf5c864c9 domwalk.h (struct dom_walk_data): Remove all callbacks except before_dom_children_before_stmts and...
2009-06-27  Paolo Bonzini  <bonzini@gnu.org>

        * domwalk.h (struct dom_walk_data): Remove all callbacks except
        before_dom_children_before_stmts and after_dom_children_after_stmts.
        Rename the two remaining callbacks to just before_dom_children and 
        after_dom_children. Remove other GIMPLE statement walking bits.
        * domwalk.c (walk_dominator_tree): Remove now unsupported features.
        * graphite.c: Do not include domwalk.h.
        * tree-into-ssa.c (interesting_blocks): New global.
        (struct mark_def_sites_global_data): Remove it and names_to_rename.
        (mark_def_sites, rewrite_stmt, rewrite_add_phi_arguments,
        rewrite_update_stmt, rewrite_update_phi_arguments): Simplify
        now that they're not domwalk callbacks.
        (rewrite_initialize_block): Rename to...
        (rewrite_enter_block): ... this, place after called functions.  Test
        interesting_blocks, call rewrite_stmt and rewrite_add_phi_arguments.
        (rewrite_finalize_block): Rename to...
        (rewrite_leave_block): ... this, place after called functions.
        (rewrite_update_init_block): Rename to...
        (rewrite_update_enter_block): ... this, place after called functions.
        Test interesting_blocks, call rewrite_update_stmt and 
        rewrite_update_phi_arguments.
        (rewrite_update_fini_block): Rename to...
        (rewrite_leave_block): ... this, place after called functions.
        (rewrite_blocks): Remove last argument, simplify initialization of
        walk_data.
        (mark_def_sites_initialize_block): Rename to...
        (mark_def_sites_block): ... this, call mark_def_sites.
        (mark_def_sites_blocks): Remove argument, simplify initialization of
        walk_data.
        (rewrite_into_ssa): Adjust for interesting_blocks_being a global.
        (update_ssa): Likewise.
        * tree-ssa-dom.c (optimize_stmt): Simplify now that it's not a domwalk
        callback.
        (tree_ssa_dominator_optimize): Simplify initialization of walk_data.
        (dom_opt_initialize_block): Rename to...
        (dom_opt_enter_block): ... this, place after called functions.  Walk
        statements here, inline propagate_to_outgoing_edges.
        (dom_opt_finalize_block): Rename to...
        (dom_opt_leave_block): ... this, place after called functions.
        * tree-ssa-dse.c (dse_optimize_stmt): Simplify now that it's not a
        domwalk callback.
        (dse_enter_block, dse_record_phi): New.
        (dse_record_phis): Delete.
        (dse_finalize_block): Rename to...
        (dse_leave_block): ... this.
        (tree_ssa_dse): Simplify initialization of walk_data.
        * tree-ssa-loop-im.c (determine_invariantness, move_computations):
        Adjust initialization of walk_data.
        * tree-ssa-loop-unswitch.c: Do not include domwalk.h.
        * tree-ssa-loop-phiopt.c (get_non_trapping):
        Adjust initialization of walk_data.
        * tree-ssa-loop-threadedge.c: Do not include domwalk.h.
        * tree-ssa-uncprop.c (uncprop_into_successor_phis): Simplify now that
        it's not a domwalk callback.
        (uncprop_initialize_block): Rename to...
        (dse_enter_block): ... this, call uncprop_into_successor_phis.
        (dse_finalize_block): Rename to...
        (dse_leave_block): ... this.
        (tree_ssa_uncprop): Simplify initialization of walk_data.
        * Makefile.in: Adjust dependencies.

From-SVN: r149008
2009-06-27 14:45:51 +00:00
Paolo Bonzini cff4e50d67 tree-ssa-operands.h (push_stmt_changes, [...]): Delete.
2009-05-24  Paolo Bonzini  <bonzini@gnu.org>

	* tree-ssa-operands.h (push_stmt_changes, pop_stmt_changes,
	discard_stmt_changes): Delete.
	* tree-ssa-operands.c (scb_stack): Delete.
	(init_ssa_operands): Do not initialize it.
	(fini_ssa_operands): Do not free it.
	(push_stmt_changes, pop_stmt_changes, discard_stmt_changes): Delete.

	* tree-cfg.c (replace_uses_by): Replace pop_stmt_changes with 
	update_stmt, remove the others.  Fix comments.
	* tree-dfa.c (optimize_stack_restore): Likewise.
	* tree-ssa-forwprop.c (forward_propagate_addr_expr): Likewise.
	* tree-ssa-loop-ivopts.c (rewrite_use): Likewise.
	* tree-ssa-dce.c (eliminate_unnecessary_stmts): Likewise.
	* tree-ssa-ccp.c (optimize_stack_restore, execute_fold_all_builtins):
	Likewise.
	* tree-ssa-propagate.c (substitute_and_fold): Likewise.
	* tree-ssa-dom.c (propagate_rhs_into_lhs): Likewise.
	(dom_opt_finalize_block): Likewise, adjusting access to stmts_to_rescan.
	(optimize_stmt): Likewise, adjusting access to stmts_to_rescan.
	(stmts_to_rescan): Change item type to gimple.
	(tree_ssa_dominator_optimize): Change type of stmts_to_rescan.

From-SVN: r147831
2009-05-24 11:20:29 +00:00
Richard Guenther 4effdf02d4 passes.c (init_optimization_passes): Strip now incorrect comment.
2009-05-11  Richard Guenther  <rguenther@suse.de>

	* passes.c (init_optimization_passes): Strip now incorrect comment.
	(execute_function_todo): Do not set PROP_alias.
	* tree-pass.h (PROP_alias): Remove.
	* tree-ssa-structalias.c (pass_build_alias): Do not provide PROP_alias.
	* tree-if-conv.c (pass_if_conversion): Do not require PROP_alias.
	* tree-nrv.c (pass_return_slot): Likewise.
	* tree-object-size.c (pass_object_sizes): Likewise.
	* tree-ssa-dom.c (pass_dominator): Likewise.
	(pass_phi_only_cprop): Likewise.
	* tree-ssa-dse.c (pass_dse): Likewise.
	* tree-ssa-phiopt.c (pass_phiopt): Likewise.
	(pass_cselim): Likewise.
	* tree-ssa-pre.c (pass_pre): Likewise.
	(pass_fre): Likewise.
	* tree-ssa-reassoc.c (pass_reassoc): Likewise.
	* tree-ssa-sink.c (pass_sink_code): Likewise.
	* tree-stdarg.c (pass_stdarg): Likewise.
	* tree-tailcall.c (pass_tail_calls): Likewise.
	* tree-vrp.c (pass_vrp): Likewise.

From-SVN: r147371
2009-05-11 12:19:00 +00:00
Richard Guenther 448ee6624d tree.h (SSA_NAME_VALUE): Remove.
2009-04-28  Richard Guenther  <rguenther@suse.de>

	* tree.h (SSA_NAME_VALUE): Remove.
	(struct tree_ssa_name): Remove value_handle member.
	* tree-vrp.c (execute_vrp): Initialize/free the value-handle
	array for jump threading.
	* tree-ssa-propagate.c (ssa_prop_init): Do not initialize
	SSA_NAME_VALUEs.
	* print-tree.c (print_node): Do not dump SSA_NAME_VALUEs.
	* tree-flow.h (threadedge_initialize_values): Declare.
	(threadedge_finalize_values): Likewise.
	* tree-ssa-threadedge.c (ssa_name_values): New global variable.
	(SSA_NAME_VALUE): Define.
	(threadedge_initialize_values): New function.
	(threadedge_finalize_values): Likewise.
	* tree-ssa-dom.c (ssa_name_values): New global variable.
	(SSA_NAME_VALUE): Define.
	(tree_ssa_dominator_optimize): Initialize/free the value-handle
	array.

From-SVN: r146877
2009-04-28 08:50:19 +00:00
Richard Guenther 7e67327329 tree-ssa-dom.c (gimple_assign_unary_useless_conversion_p): Remove.
2009-04-17  Richard Guenther  <rguenther@suse.de>

	* tree-ssa-dom.c (gimple_assign_unary_useless_conversion_p): Remove.
	(record_equivalences_from_stmt): Remove useless checks and
	simplifications.
	* tree-ssa-pre.c (eliminate): Avoid converting a constant if
	the type is already suitable.

From-SVN: r146260
2009-04-17 12:43:02 +00:00
Richard Guenther 5006671f1a re PR middle-end/13146 (inheritance for nonoverlapping_component_refs_p)
2009-04-03  Richard Guenther  <rguenther@suse.de>

	PR middle-end/13146
	PR tree-optimization/23940
	PR tree-optimization/33237
	PR middle-end/33974
	PR middle-end/34093
	PR tree-optimization/36201
	PR tree-optimization/36230
	PR tree-optimization/38049
	PR tree-optimization/38207
	PR tree-optimization/38230
	PR tree-optimization/38301
	PR tree-optimization/38585
	PR middle-end/38895
	PR tree-optimization/38985
	PR tree-optimization/39299
	* tree-ssa-structalias.h: Remove.
	* tree-ssa-operands.h (NULL_USE_OPERAND_P): Make of type use_operand_p.
	(NULL_DEF_OPERAND_P): Make of type def_operand_p.
	(struct vuse_element_d): Remove.
	(struct vuse_vec_d): Likewise.
	(VUSE_VECT_NUM_ELEM, VUSE_VECT_ELEMENT_NC, VUSE_ELEMENT_PTR_NC,
	VUSE_ELEMENT_VAR_NC, VUSE_VECT_ELEMENT, VUSE_ELEMENT_PTR,
	SET_VUSE_VECT_ELEMENT, SET_VUSE_ELEMENT_VAR, SET_VUSE_ELEMENT_PTR,
	VUSE_ELEMENT_VAR): Likewise.
	(struct voptype_d): Likewise.
	(NUM_VOP_FREE_BUCKETS): Likewise.
	(struct ssa_operands): Remove vop_free_buckets and mpt_table fields.
	(struct stmt_operands_d): Remove.
	(VUSE_OP_PTR, VUSE_OP, SET_VUSE_OP, VUSE_NUM, VUSE_VECT,
	VDEF_RESULT_PTR, VDEF_RESULT, VDEF_OP_PTR, VDEF_OP, SET_VDEF_OP,
	VDEF_NUM, VDEF_VECT): Likewise.
	(copy_virtual_operands): Remove.
	(operand_build_cmp): Likewise.
	(create_ssa_artificial_load_stmt): Likewise.
	(enum ssa_op_iter_type): Remove ssa_op_iter_vdef.
	(struct ssa_operand_iterator_d): Remove vuses, vdefs, mayusesm
	vuse_index and mayuse_index members.  Pack and move done and iter_type
	members to the front.
	(SSA_OP_VMAYUSE): Remove.
	(SSA_OP_VIRTUAL_USES): Adjust.
	(FOR_EACH_SSA_VDEF_OPERAND): Remove.
	(unlink_stmt_vdef): Declare.
	(add_to_addressable_set): Remove.
	* tree-vrp.c (stmt_interesting_for_vrp): Adjust.
	(vrp_visit_stmt): Likewise.
	* doc/tree-ssa.texi (Alias analysis): Update.
	* doc/invoke.texi (max-aliased-vops): Remove docs.
	(avg-aliased-vops): Likewise.
	* tree-into-ssa.c (syms_to_rename): Remove.
	(need_to_update_vops_p): Likewise.
	(need_to_initialize_update_ssa_p): Rename to ...
	(update_ssa_initialized_fn): ... this.  Track function we are
	initialized for.
	(symbol_marked_for_renaming): Simplify.
	(add_new_name_mapping): Do not set need_to_update_vops_p.
	(dump_currdefs): Use SYMS_TO_RENAME.
	(rewrite_update_stmt): Always walk all uses/defs.
	(dump_update_ssa): Adjust.
	(init_update_ssa): Take function argument.  Track what we are
	initialized for.
	(delete_update_ssa): Reset SYMS_TO_RENAME and update_ssa_initialized_fn.
	(create_new_def_for): Initialize for cfun, assert we are initialized
	for cfun.
	(mark_sym_for_renaming): Simplify.
	(mark_set_for_renaming): Do not initialize update-ssa.
	(need_ssa_update_p): Simplify.  Take function argument.
	(name_mappings_registered_p): Assert we ask for the correct function.
	(name_registered_for_update_p): Likewise.
	(ssa_names_to_replace): Likewise.
	(release_ssa_name_after_update_ssa): Likewise.
	(update_ssa): Likewise.  Use SYMS_TO_RENAME.
	(dump_decl_set): Do not print a newline.
	(debug_decl_set): Do it here.
	(dump_update_ssa): And here.
	* tree-ssa-loop-im.c (move_computations): Adjust.
	(movement_possibility): Likewise.
	(determine_max_movement): Likewise.
	(gather_mem_refs_stmt): Likewise.
	* tree-dump.c (dequeue_and_dump): Do not handle SYMBOL_MEMORY_TAG
	or NAME_MEMORY_TAG.
	* tree-complex.c (update_all_vops): Remove.
	(expand_complex_move): Adjust.
	* tree-ssa-loop-niter.c (chain_of_csts_start): Use NULL_TREE.
	Simplify test for memory referencing statement.  Exclude
	non-invariant ADDR_EXPRs.
	* tree-pretty-print.c (dump_generic_node): Do not handle memory tags.
	* tree-loop-distribution.c (generate_memset_zero): Adjust.
	(rdg_flag_uses): Likewise.
	* tree-tailcall.c (suitable_for_tail_opt_p): Remove memory-tag
	related code.
	(tree_optimize_tail_calls_1): Also split the
	edge from the entry block if we have degenerate PHI nodes in
	the first basic block.
	* tree.c (init_ttree): Remove memory-tag related code.
	(tree_code_size): Likewise.
	(tree_node_structure): Likewise.
	(build7_stat): Re-write to be build6_stat.
	* tree.h (MTAG_P, TREE_MEMORY_TAG_CHECK, TMR_TAG): Remove.
	(SSA_VAR_P): Adjust.
	(struct tree_memory_tag): Remove.
	(struct tree_memory_partition_tag): Likewise.
	(union tree_node): Adjust.
	(build7): Re-write to be build6.
	* tree-pass.h (pass_reset_cc_flags): Remove.
	(TODO_update_address_taken): New flag.
	(pass_simple_dse): Remove.
	* ipa-cp.c (ipcp_update_callgraph): Update SSA form.
	* params.h (MAX_ALIASED_VOPS): Remove.
	(AVG_ALIASED_VOPS): Likewise.
	* omp-low.c (expand_omp_taskreg): Update SSA form.
	* tree-ssa-dse.c (dse_optimize_stmt): Properly query if the rhs
	aliases the lhs in a copy stmt.
	* tree-ssa-dse.c (struct address_walk_data): Remove.
	(memory_ssa_name_same): Likewise.
	(memory_address_same): Likewise.
	(get_kill_of_stmt_lhs): Likewise.
	(dse_possible_dead_store_p): Simplify, use the oracle.  Handle
	unused stores.  Look through PHI nodes into post-dominated regions.
	(dse_optimize_stmt): Simplify.  Properly remove stores.
	(tree_ssa_dse): Compute dominators.
	(execute_simple_dse): Remove.
	(pass_simple_dse): Likewise.
	* ipa-reference.c (scan_stmt_for_static_refs): Open-code
	gimple_loaded_syms and gimple_stored_syms computation.
	* toplev.c (dump_memory_report): Dump alias and pta stats.
	* tree-ssa-sccvn.c (vn_reference_compute_hash): Simplify.
	(vn_reference_eq): Likewise.
	(vuses_to_vec, copy_vuses_from_stmt, vdefs_to_vec,
	copy_vdefs_from_stmt, shared_lookup_vops, shared_vuses_from_stmt,
	valueize_vuses): Remove.
	(get_def_ref_stmt_vuses): Simplify.  Rename to ...
	(get_def_ref_stmt_vuse): ... this.
	(vn_reference_lookup_2): New function.
	(vn_reference_lookup_pieces): Use walk_non_aliased_vuses for
	walking equivalent vuses.  Simplify.
	(vn_reference_lookup): Likewise.
	(vn_reference_insert): Likewise.
	(vn_reference_insert_pieces): Likewise.
	(visit_reference_op_call): Simplify.
	(visit_reference_op_load): Likewise.
	(visit_reference_op_store): Likewise.
	(init_scc_vn): Remove shared_lookup_vuses initialization.
	(free_scc_vn): Remove shared_lookup_vuses freeing.
	(sort_vuses, sort_vuses_heap): Remove.
	(get_ref_from_reference_ops): Export.
	* tree-ssa-sccvn.h (struct vn_reference_s): Replace vuses
	vector with single vuse pointer.
	(vn_reference_lookup_pieces, vn_reference_lookup,
	vn_reference_insert, vn_reference_insert_pieces): Adjust prototypes.
	(shared_vuses_from_stmt): Remove.
	(get_ref_from_reference_ops): Declare.
	* tree-ssa-loop-manip.c (slpeel_can_duplicate_loop_p): Adjust.
	* tree-ssa-copyrename.c (copy_rename_partition_coalesce): Remove
	memory-tag related code.
	* tree-ssa-ccp.c (get_symbol_constant_value): Remove memory-tag code.
	(likely_value): Add comment, skip static-chain of call statements.
	(surely_varying_stmt_p): Adjust.
	(gimplify_and_update_call_from_tree): Likewise.
	(execute_fold_all_builtins): Do not rebuild alias info.
	(gimplify_and_update_call_from_tree): Properly update VOPs.
	* tree-ssa-loop-ivopts.c (get_ref_tag): Remove.
	(copy_ref_info): Remove memory-tag related code.
	* tree-call-cdce.c (tree_call_cdce): Rename the VOP.
	* ipa-pure-const.c (check_decl): Remove memory-tag related code.
	(check_stmt): Open-code gimple_loaded_syms and gimple_stored_syms
	computation.
	* tree-ssa-dom.c (gimple_p): Remove typedef.
	(eliminate_redundant_computations): Adjust.
	(record_equivalences_from_stmt): Likewise.
	(avail_expr_hash): Likewise.
	(avail_expr_eq): Likewise.
	* tree-ssa-propagate.c (update_call_from_tree): Properly
	update VOPs.
	(stmt_makes_single_load): Likewise.
	(stmt_makes_single_store): Likewise.
	* tree-ssa-alias.c: Rewrite completely.
	(debug_memory_partitions, dump_mem_ref_stats, debug_mem_ref_stats,
	debug_mem_sym_stats, dump_mem_sym_stats_for_var,
	debug_all_mem_sym_stats, debug_mp_info, update_mem_sym_stats_from_stmt,
	delete_mem_ref_stats, create_tag_raw, dump_points_to_info,
	dump_may_aliases_for, debug_may_aliases_for, new_type_alias):
	Remove public functions.
	(pass_reset_cc_flags): Remove.
	(pass_build_alias): Move ...
	* tree-ssa-structalias.c (pass_build_alias): ... here.
	* tree-ssa-alias.c (may_be_aliased): Move ...
	* tree-flow-inline.h (may_be_aliased): ... here.
	tree-ssa-alias.c (struct count_ptr_d, count_ptr_derefs,
	count_uses_and_derefs): Move ...
	* gimple.c: ... here.
	* gimple.h (count_uses_and_derefs): Declare.
	* tree-ssa-alias.c (dump_alias_stats, ptr_deref_may_alias_global_p,
	ptr_deref_may_alias_decl_p, ptr_derefs_may_alias_p,
	same_type_for_tbaa, nonaliasing_component_refs_p, decl_refs_may_alias_p,
	indirect_ref_may_alias_decl_p, indirect_refs_may_alias_p,
	ref_maybe_used_by_call_p, ref_maybe_used_by_stmt_p,
	call_may_clobber_ref_p, stmt_may_clobber_ref_p, maybe_skip_until,
	get_continuation_for_phi, walk_non_aliased_vuses, walk_aliased_vdefs):
	New functions.
	* tree-dfa.c (refs_may_alias_p): Move ...
	* tree-ssa-alias.c (refs_may_alias_p): ... here.  Extend.
	* tree-ssa-alias.h: New file.
	* tree-ssa-sink.c (is_hidden_global_store): Adjust.
	(statement_sink_location): Likewise.
	* opts.c (decode_options): Do not adjust max-aliased-vops or
	avg-aliased-vops values.
	* timevar.def (TV_TREE_MAY_ALIAS): Remove.
	(TV_CALL_CLOBBER): Likewise.
	(TV_FLOW_SENSITIVE): Likewise.
	(TV_FLOW_INSENSITIVE): Likewise.
	(TV_MEMORY_PARTITIONING): Likewise.
	(TV_ALIAS_STMT_WALK): New timevar.
	* tree-ssa-loop-ivcanon.c (empty_loop_p): Adjust.
	* tree-ssa-address.c (create_mem_ref_raw): Use build6.
	(get_address_description): Remove memory-tag related code.
	* tree-ssa-ifcombine.c (bb_no_side_effects_p): Adjust.
	* treestruct.def (TS_MEMORY_TAG, TS_MEMORY_PARTITION_TAG): Remove.
	* tree-eh.c (cleanup_empty_eh): Do not leave stale SSA_NAMEs
	and immediate uses in statements.  Document.
	* gimple-pretty-print.c (dump_gimple_mem_ops): Adjust.
	(dump_symbols): Remove.
	(dump_gimple_mem_ops): Do not dump loaded or stored syms.
	* alias.c (get_deref_alias_set): New function split out from ...
	(get_alias_set): ... here.
	* alias.h (get_deref_alias_set): Declare.
	* tree-vect-data-refs.c (vect_create_data_ref_ptr): Remove unused
	type parameter.  Remove restrict pointer handling.  Create a
	ref-all pointer in case type-based alias sets do not conflict.
	(vect_analyze_data_refs): Remove SMT related code.
	* tree-vect-stmts.c (vectorizable_store): Re-instantiate TBAA assert.
	(vectorizable_load): Likewise.
	* tree-data-ref.h (struct dr_alias): Remove symbol_tag field.
	(DR_SYMBOL_TAG, DR_VOPS): Remove.
	* tree-data-ref.c (dr_may_alias_p): Use the alias-oracle.
	Ignore vops and SMTs.
	(dr_analyze_alias): Likewise..
	(free_data_ref): Likewise.
	(create_data_ref): Likewise.
	(analyze_all_data_dependences): Likewise.
	(get_references_in_stmt): Adjust.
	* tree-flow-inline.h (gimple_aliases_computed_p,
	gimple_addressable_vars, gimple_call_clobbered_vars,
	gimple_call_used_vars, gimple_global_var, may_aliases, memory_partition,
	factoring_name_p, mark_call_clobbered, clear_call_clobbered,
	compare_ssa_operands_equal, symbol_mem_tag, set_symbol_mem_tag,
	gimple_mem_ref_stats): Remove.
	(gimple_vop): New function.
	(op_iter_next_use): Remove vuses and mayuses cases.
	(op_iter_next_def): Remove vdefs case.
	(op_iter_next_tree): Remove vuses, mayuses and vdefs cases.
	(clear_and_done_ssa_iter): Do not set removed fields.
	(op_iter_init): Likewise.  Skip vuse and/or vdef if requested.
	Assert we are not iterating over vuses or vdefs if not also
	iterating over uses or defs.
	(op_iter_init_use): Likewise.
	(op_iter_init_def): Likewise.
	(op_iter_next_vdef): Remove.
	(op_iter_next_mustdef): Likewise.
	(op_iter_init_vdef): Likewise.
	(compare_ssa_operands_equal): Likewise.
	(link_use_stmts_after): Handle vuse operand.
	(is_call_used): Use is_call_clobbered.
	(is_call_clobbered): Global variables are always call clobbered,
	query the call-clobbers bitmap.
	(mark_call_clobbered): Ignore global variables.
	(clear_call_clobbered): Likewise.
	* tree-ssa-coalesce.c (create_outofssa_var_map): Adjust
	virtual operands sanity check.
	* tree.def (NAME_MEMORY_TAG, SYMBOL_MEMORY_TAG, MEMORY_PARTITION_TAG):
	Remove.
	(TARGET_MEM_REF): Remove TMR_TAG operand.
	* tree-dfa.c (add_referenced_var): Initialize call-clobber state.
	Remove call-clobber related code.
	(remove_referenced_var): Likewise.  Do not clear mpt or symbol_mem_tag.
	(dump_variable): Do not dump SMTs, memory stats, may-aliases or
	partitions or escape reason.
	(get_single_def_stmt, get_single_def_stmt_from_phi,
	get_single_def_stmt_with_phi): Remove.
	(dump_referenced_vars): Tidy.
	(get_ref_base_and_extent): Allow bare decls.
	(collect_dfa_stats): Adjust.
	* graphite.c (rename_variables_in_stmt): Adjust.
	(graphite_copy_stmts_from_block): Likewise.
	(translate_clast): Likewise.
	* tree-ssa-pre.c (struct bb_bitmap_sets): Add expr_dies bitmap.
	(EXPR_DIES): New.
	(translate_vuse_through_block): Use the oracle.
	(phi_translate_1): Adjust.
	(value_dies_in_block_x): Use the oracle.  Cache the outcome
	in EXPR_DIES.
	(valid_in_sets): Check if the VUSE for
	a REFERENCE is available.
	(eliminate): Do not remove stmts during elimination,
	instead queue and remove them afterwards.
	(do_pre): Do not rebuild alias info.
	(pass_pre): Run TODO_rebuild_alias before PRE.
	* tree-ssa-live.c (remove_unused_locals): Remove memory-tag code.
	* tree-sra.c (sra_walk_function): Use gimple_references_memory_p.
	(mark_all_v_defs_stmt): Remove.
	(mark_all_v_defs_seq): Adjust.
	(sra_replace): Likewise.
	(scalarize_use): Likewise.
	(scalarize_copy): Likewise.
	(scalarize_init): Likewise.
	(scalarize_ldst): Likewise.
	(todoflags): Remove.
	(tree_sra): Do not rebuild alias info.
	(tree_sra_early): Adjust.
	(pass_sra): Run TODO_update_address_taken before SRA.
	* tree-predcom.c (set_alias_info): Remove.
	(prepare_initializers_chain): Do not call it.
	(mark_virtual_ops_for_renaming): Adjust.
	(mark_virtual_ops_for_renaming_list): Remove.
	(initialize_root_vars): Adjust.
	(initialize_root_vars_lm): Likewise.
	(prepare_initializers_chain): Likewise.
	* tree-ssa-copy.c (may_propagate_copy): Remove memory-tag related code.
	(may_propagate_copy_into_stmt): Likewise.
	(merge_alias_info): Do nothing for now.
	(propagate_tree_value_into_stmt): Adjust.
	(stmt_may_generate_copy): Likewise.
	* tree-ssa-forwprop.c (tidy_after_forward_propagate_addr): Do
	not mark symbols for renaming.
	(forward_propagate_addr_expr): Match up push/pop_stmt_changes
	with the same statement, make sure to update the new pointed-to one.
	* tree-ssa-dce.c (eliminate_unnecessary_stmts): Do not copy
	call statements, do not mark symbols for renaming.
	(mark_operand_necessary): Dump something.
	(ref_may_be_aliased): New function.
	(mark_aliased_reaching_defs_necessary_1): New helper function.
	(mark_aliased_reaching_defs_necessary): Likewise.
	(mark_all_reaching_defs_necessary_1): Likewise.
	(mark_all_reaching_defs_necessary): Likewise.
	(propagate_necessity): Do not process virtual PHIs.  For
	non-aliased loads mark all reaching definitions as necessary.
	For aliased loads and stores mark the immediate dominating
	aliased clobbers as necessary.
	(visited): New global static.
	(perform_tree_ssa_dce): Free visited bitmap after propagating
	necessity.
	(remove_dead_phis): Perform simple dead virtual PHI removal.
	(remove_dead_stmt): Properly unlink virtual operands when
	removing stores.
	(eliminate_unnecessary_stmts): Schedule PHI removal after
	stmt removal.
	* tree-ssa-ter.c (is_replaceable_p): Adjust.
	(process_replaceable): Likewise.
	(find_replaceable_in_bb): Likewise.
	* tree-ssa.c (verify_ssa_name): Verify all VOPs are
	based on the single gimple vop.
	(verify_flow_insensitive_alias_info): Remove.
	(verify_flow_sensitive_alias_info): Likewise.
	(verify_call_clobbering): Likewise.
	(verify_memory_partitions): Likewise.
	(verify_alias_info): Likewise.
	(verify_ssa): Adjust..
	(execute_update_addresses_taken): Export.  Update SSA
	manually.  Optimize only when optimizing.  Use a local bitmap.
	(pass_update_address_taken): Remove TODO_update_ssa, add
	TODO_dump_func.
	(pass_update_address_taken): Just use TODO_update_address_taken.
	(init_tree_ssa): Do not initialize addressable_vars.
	(verify_ssa): Verify new VUSE / VDEF properties.
	Verify that all stmts definitions have the stmt as SSA_NAME_DEF_STMT.
	Do not call verify_alias_info.
	(delete_tree_ssa): Clear the VUSE, VDEF operands.
	Do not free the loaded and stored syms bitmaps.  Reset the escaped
	and callused solutions.  Do not free addressable_vars.
	Remove memory-tag related code.
	(warn_uninitialized_var): Aliases are always available.
	* tree-ssa-loop-prefetch.c (gather_memory_references): Adjust.
	* lambda-code.c (can_put_in_inner_loop): Adjust.
	(can_put_after_inner_loop): Likewise.
	(perfect_nestify): Likewise.
	* tree-vect-stmts.c (vect_stmt_relevant_p): Adjust.
	(vect_gen_widened_results_half): Remove CALL_EXPR handling.
	(vectorizable_conversion): Do not mark symbols for renaming.
	* tree-inline.c (remap_gimple_stmt): Clear VUSE/VDEF.
	(expand_call_inline): Unlink the calls virtual operands before
	replacing it.
	(tree_function_versioning): Do not call update_ssa if we are not
	updating clones.  Simplify.
	* tree-ssa-phiprop.c (phivn_valid_p): Adjust.
	(propagate_with_phi): Likewise..
	* tree-outof-ssa.c (create_temp): Remove memory tag and call
	clobber code.  Assert we are not aliased or global.
	* tree-flow.h: Include tree-ssa-alias.h
	(enum escape_type): Remove.
	(struct mem_sym_stats_d): Likewise.
	(struct mem_ref_stats_d): Likewise.
	(struct gimple_df): Add vop member.  Remove global_var,
	call_clobbered_vars, call_used_vars, addressable_vars,
	aliases_compted_p and mem_ref_stats members.  Add syms_to_rename,
	escaped and callused members.
	(struct ptr_info_def): Remove all members, add points-to solution
	member pt.
	(struct var_ann_d): Remove in_vuse_list, in_vdef_list,
	call_clobbered, escape_mask, mpt and symbol_mem_tag members.
	* Makefile.in (TREE_FLOW_H): Add tree-ssa-alias.h.
	(tree-ssa-structalias.o): Remove tree-ssa-structalias.h.
	(tree-ssa-alias.o): Likewise.
	(toplev.o): Add tree-ssa-alias.h
	(GTFILES): Remove tree-ssa-structalias.h, add tree-ssa-alias.h.
	* gimple.c (gimple_set_bb): Fix off-by-one error.
	(is_gimple_reg): Do not handle memory tags.
	(gimple_copy): Also copy virtual operands.
	Delay updating the statement.  Do not reset loaded and stored syms.
	(gimple_set_stored_syms): Remove.
	(gimple_set_loaded_syms): Likewise.
	(gimple_call_copy_skip_args): Copy the virtual operands
	and mark the new statement modified.
	* tree-ssa-structalias.c (may_alias_p): Remove.
	(set_uids_in_ptset): Take the alias set to prune with as
	parameter.  Fold in the alias test of may_alias_p.
	(compute_points_to_sets): Compute whether a ptr is dereferenced
	in a local sbitmap.
	(process_constraint): Deal with &ANYTHING on the lhs, reject all
	other ADDRESSOF constraints on the lhs.
	(get_constraint_for_component_ref): Assert that we don't get
	ADDRESSOF constraints from the base of the reference.
	Properly generate UNKNOWN_OFFSET for DEREF if needed.
	(struct variable_info): Remove collapsed_to member.
	(get_varinfo_fc): Remove.
	(new_var_info): Do not set collapsed_to.
	(dump_constraint): Do not follow cycles.
	(dump_constraint_graph): Likewise.
	(build_pred_graph): Likewise.
	(build_succ_graph): Likewise.
	(rewrite_constraints): Likewise.
	(do_simple_structure_copy): Remove.
	(do_rhs_deref_structure_copy): Remove.
	(do_lhs_deref_structure_copy): Remove.
	(collapse_rest_of_var): Remove.
	(do_structure_copy): Re-implement.
	(pta_stats): New global variable.
	(dump_pta_stats): New function.
	(struct constraint_expr): Make offset signed.
	(UNKNOWN_OFFSET): Define special value.
	(dump_constraint): Dump UNKNOWN_OFFSET as UNKNOWN.
	(solution_set_expand): New helper function split out from ...
	(do_sd_constraint): ... here.
	(solution_set_add): Handle UNKNOWN_OFFSET.  Handle negative offsets.
	(do_ds_constraint): Likewise.
	(do_sd_constraint): Likewise.  Do not special-case ESCAPED = *ESCAPED
	and CALLUSED = *CALLUSED.
	(set_union_with_increment): Make inc argument signed.
	(type_safe): Remove.
	(get_constraint_for_ptr_offset): Handle unknown and negative
	constant offsets.
	(first_vi_for_offset): Handle offsets before start.  Bail
	out early for offsets beyond the variable extent.
	(first_or_preceding_vi_for_offset): New function.
	(init_base_vars): Add ESCAPED = ESCAPED + UNKNOWN_OFFSET constraint.
	Together with ESCAPED = *ESCAPED this properly computes reachability.
	(find_what_var_points_to): New function.
	(find_what_p_points_to): Implement in terms of find_what_var_points_to.
	(pt_solution_reset, pt_solution_empty_p, pt_solution_includes_global,
	pt_solution_includes_1, pt_solution_includes, pt_solutions_intersect_1,
	pt_solutions_intersect): New functions.
	(compute_call_used_vars): Remove.
	(compute_may_aliases): New main entry into PTA computation.
	* gimple.h (gimple_p): New typedef.
	(struct gimple_statement_base): Remove references_memory_p.
	(struct gimple_statement_with_memory_ops_base): Remove
	vdef_ops, vuse_ops, stores and loads members.  Add vdef and vuse
	members.
	(gimple_vuse_ops, gimple_set_vuse_ops, gimple_vdef_ops,
	gimple_set_vdef_ops, gimple_loaded_syms, gimple_stored_syms,
	gimple_set_references_memory): Remove.
	(gimple_vuse_op, gimple_vdef_op, gimple_vuse, gimple_vdef,
	gimple_vuse_ptr, gimple_vdef_ptri, gimple_set_vuse, gimple_set_vdef):
	New functions.
	* tree-cfg.c (move_block_to_fn): Fix off-by-one error.
	(verify_expr): Allow RESULT_DECL.
	(gimple_duplicate_bb): Do not copy virtual operands.
	(gimple_duplicate_sese_region): Adjust.
	(gimple_duplicate_sese_tail): Likewise.
	(mark_virtual_ops_in_region): Remove.
	(move_sese_region_to_fn): Do not call it.
	* passes.c (init_optimization_passes): Remove pass_reset_cc_flags
	and pass_simple_dse.
	(execute_function_todo): Handle TODO_update_address_taken,
	call execute_update_addresses_taken for TODO_rebuild_alias.
	(execute_todo): Adjust.
	(execute_one_pass): Init dump files early.
	* ipa-struct-reorg.c (finalize_var_creation): Do not mark vars
	call-clobbered.
	(create_general_new_stmt): Clear vops.
	* tree-ssa-reassoc.c (get_rank): Adjust.
	* tree-vect-slp.c (vect_create_mask_and_perm): Do not mark
	symbols for renaming.
	* params.def (PARAM_MAX_ALIASED_VOPS): Remove.
	(PARAM_AVG_ALIASED_VOPS): Likewise.
	* tree-ssanames.c (init_ssanames): Allocate SYMS_TO_RENAME.
	(duplicate_ssa_name_ptr_info): No need to copy the shared bitmaps.
	* tree-ssa-operands.c: Simplify for new virtual operand
	representation.
	(operand_build_cmp, copy_virtual_operands,
	create_ssa_artificial_load_stmt, add_to_addressable_set,
	gimple_add_to_addresses_taken): Remove public functions.
	(unlink_stmt_vdef): New function.

	* gcc.dg/pr19633-1.c: Adjust.
	* gcc.dg/torture/pta-callused-1.c: Likewise.
	* gcc.dg/torture/pr39074-2.c: Likewise.
	* gcc.dg/torture/pr39074.c: Likewise.
	* gcc.dg/torture/pta-ptrarith-3.c: New testcase.
	* gcc.dg/torture/pr30375.c: Adjust.
	* gcc.dg/torture/pr33563.c: Likewise.
	* gcc.dg/torture/pr33870.c: Likewise.
	* gcc.dg/torture/pr33560.c: Likewise.
	* gcc.dg/torture/pta-structcopy-1.c: New testcase.
	* gcc.dg/torture/ssa-pta-fn-1.c: Likewise.
	* gcc.dg/tree-ssa/alias-15.c: Remove.
	* gcc.dg/tree-ssa/ssa-dce-4.c: New testcase.
	* gcc.dg/tree-ssa/pr26421.c: Adjust.
	* gcc.dg/tree-ssa/ssa-fre-10.c: XFAIL.
	* gcc.dg/tree-ssa/ssa-dce-5.c: New testcase.
	* gcc.dg/tree-ssa/pr23382.c: Adjust.
	* gcc.dg/tree-ssa/ssa-fre-20.c: New testcase.
	* gcc.dg/tree-ssa/alias-16.c: Adjust.
	* gcc.dg/tree-ssa/ssa-fre-13.c: Likewise.
	* gcc.dg/tree-ssa/ssa-fre-14.c: Likewise.
	* gcc.dg/tree-ssa/alias-18.c: Likewise.
	* gcc.dg/tree-ssa/ssa-fre-15.c: Likewise.
	* gcc.dg/tree-ssa/ssa-lim-3.c: Likewise.
	* gcc.dg/tree-ssa/alias-19.c: Likewise.
	* gcc.dg/tree-ssa/pta-ptrarith-1.c: New testcase.
	* gcc.dg/tree-ssa/pr13146.c: Likewise.
	* gcc.dg/tree-ssa/ssa-pre-23.c: Likewise.
	* gcc.dg/tree-ssa/pta-ptrarith-2.c: Likewise.
	* gcc.dg/tree-ssa/ssa-fre-18.c: Likewise.
	* gcc.dg/tree-ssa/ssa-pre-24.c: New XFAILed testcase.
	* gcc.dg/tree-ssa/ssa-fre-19.c: New testcase.
	* gcc.dg/tree-ssa/alias-20.c: Likewise.
	* gcc.dg/tree-ssa/ssa-dse-12.c: Likewise.
	* gcc.dg/tree-ssa/pr38895.c: Likewise.
	* gcc.dg/uninit-B.c: XFAIL.
	* gcc.dg/vect/no-vfa-vect-43.c: Adjust.
	* gcc.dg/uninit-pr19430.c: XFAIL.
	* g++.dg/tree-ssa/pr13146.C: New testcase.
	* g++.dg/opt/pr36187.C: Adjust.
	* g++.dg/torture/20090329-1.C: New testcase.

From-SVN: r145494
2009-04-03 10:24:28 +00:00
Richard Guenther bf1cbdc6e4 re PR middle-end/37221 (Missed early loop-unroll optimization - causes 40% degradation on SPU)
2009-04-02  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/37221
	* tree-flow.h (degenerate_phi_result): Declare.
	* tree-ssa-dom.c (degenerate_phi_result): Export.
	* tree-scalar-evolution.c (analyze_initial_condition): If
	the initial condition is defined by a degenerate PHI node
	use the degenerate value.

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

From-SVN: r145439
2009-04-02 09:10:53 +00:00
Richard Guenther 66e8b99c2a re PR tree-optimization/38645 (ICE with volatile)
2008-12-30  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/38645
	* tree-ssa-ccp.c (fold_gimple_assign): Use the correct pointer
	type.
	* tree-ssa-dom.c (cprop_operand): Simplify.  Do not propagate
	volatileness changing operands.

	* gcc.dg/pr38645.c: New testcase.

From-SVN: r142967
2008-12-30 21:20:08 +00:00
Jakub Jelinek c5cac099b7 re PR middle-end/37337 (ICE: verify_flow_info failed)
PR middle-end/37337
	* tree-ssa-dom.c (optimize_stmt): Call maybe_clean_or_replace_eh_stmt
	even when a stmt has been gimple_modified_p, but after fold_stmt is
	not any longer.  Remove unneeded may_have_exposed_new_symbols
	initializations.

	* g++.dg/tree-ssa/pr37337.C: New test.

From-SVN: r140117
2008-09-08 21:31:18 +02:00
Tomas Bily 1a87cf0c4c tree.h (IS_CONVERT_EXPR_CODE_P): Renamed to
* tree.h (IS_CONVERT_EXPR_CODE_P): Renamed to
        * CONVERT_EXPR_CODE_P.
        * tree-ssa-threadedge.c (simplify_control_stmt_condition): Use
        CONVERT_EXPR_P.
        * tree-data-ref.c (split_constant_offset_1): Likewise.
        * tree-inline.c (estimate_operator_cost): Use CASE_CONVERT.
        * tree-sra.c (sra_walk_expr): Likewise.
        * matrix-reorg.c (ssa_accessed_in_assign_rhs): Likewise.
        * tree-ssa-loop-niter.c (expand_simple_operations): Likewise.
        * gimple.h (gimple_assign_cast_p): Use CONVERT_EXPR_CODE_P.
        * tree-ssa-structalias.c (find_func_aliases, find_func_aliases):
        * Likewise.
        * gimple.c (gimple_assign_unary_nop_p): Likewise.
        * tree-vect-transform.c (vectorizable_type_demotion)
        (vectorizable_type_promotion): Likewise.
        * tree-inline.c (expand_call_inline): 
        * tree-ssa-forwprop.c (get_prop_source_stmt, can_propagate_from)
        (forward_propagate_addr_expr_1, forward_propagate_comparison)
        (tree_ssa_forward_propagate_single_use_vars): Likewise.
        * expr.c (expand_expr_real_1): Likewise.
        * tree-ssa-dom.c (hashable_expr_equal_p,
        * iterative_hash_hashable_expr)
        (gimple_assign_unary_useless_conversion_p): Likewise.
        * tree-stdarg.c (execute_optimize_stdarg): Likewise.
        * tree-ssa-ccp.c (ccp_fold, fold_gimple_assign): Likewise.
        * fold-const.c (fold_unary): Likewise.
        * tree.h (CONVERT_EXPR_P): Likewise.
        * tree.c (simple_cst_equal, iterative_hash_expr): Likewise.
        * tree-ssa-loop-im.c (rewrite_bittest): Likewise.
        * tree-vrp.c: 
        (register_edge_assert_for_2, extract_range_from_unary_expr)
        (register_edge_assert_for_1): Likewise.

        * cp/tree.c (cp_tree_equal): Likewise.

From-SVN: r139204
2008-08-18 18:23:47 +02:00
Richard Biener 726a989a8b backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch.
2008-07-28  Richard Guenther  <rguenther@suse.de>

	Merge from gimple-tuples-branch.

	* ChangeLog.tuples: ChangeLog from gimple-tuples-branch.
	* gimple.def: New file.
	* gsstruct.def: Likewise.
	* gimple-iterator.c: Likewise.
	* gimple-pretty-print.c: Likewise.
	* tree-gimple.c: Removed.  Merged into ...
	* gimple.c: ... here.  New file.
	* tree-gimple.h: Removed.  Merged into ...
	* gimple.h: ... here.  New file.

	* Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h.
	* configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the
	--enable-checking=gimple flag.
	* config.in: Likewise.
	* configure: Regenerated.

	* tree-ssa-operands.h: Tuplified.
	* tree-vrp.c: Likewise.
	* tree-loop-linear.c: Likewise.
	* tree-into-ssa.c: Likewise.
	* tree-ssa-loop-im.c: Likewise.
	* tree-dump.c: Likewise.
	* tree-complex.c: Likewise.
	* cgraphbuild.c: Likewise.
	* tree-ssa-threadupdate.c: Likewise.
	* tree-ssa-loop-niter.c: Likewise.
	* tree-pretty-print.c: Likewise.
	* tracer.c: Likewise.
	* gengtype.c: Likewise.
	* tree-loop-distribution.c: Likewise.
	* tree-ssa-loop-unswitch.c: Likewise.
	* cgraph.c: Likewise.
	* cgraph.h: Likewise.
	* tree-ssa-loop-manip.c: Likewise.
	* value-prof.c: Likewise.
	* tree-ssa-loop-ch.c: Likewise.
	* tree-tailcall.c: Likewise.
	* value-prof.h: Likewise.
	* tree.c: Likewise.
	* tree.h: Likewise.
	* tree-pass.h: Likewise.
	* ipa-cp.c: Likewise.
	* tree-scalar-evolution.c: Likewise.
	* tree-scalar-evolution.h: Likewise.
	* target.h: Likewise.
	* lambda-mat.c: Likewise.
	* tree-phinodes.c: Likewise.
	* diagnostic.h: Likewise.
	* builtins.c: Likewise.
	* tree-ssa-alias-warnings.c: Likewise.
	* cfghooks.c: Likewise.
	* fold-const.c: Likewise.
	* cfghooks.h: Likewise.
	* omp-low.c: Likewise.
	* tree-ssa-dse.c: Likewise.
	* ipa-reference.c: Likewise.
	* tree-ssa-uncprop.c: Likewise.
	* toplev.c: Likewise.
	* tree-gimple.c: Likewise.
	* tree-gimple.h: Likewise.
	* tree-chrec.c: Likewise.
	* tree-chrec.h: Likewise.
	* tree-ssa-sccvn.c: Likewise.
	* tree-ssa-sccvn.h: Likewise.
	* cgraphunit.c: Likewise.
	* tree-ssa-copyrename.c: Likewise.
	* tree-ssa-ccp.c: Likewise.
	* tree-ssa-loop-ivopts.c: Likewise.
	* tree-nomudflap.c: Likewise.
	* tree-call-cdce.c: Likewise.
	* ipa-pure-const.c: Likewise.
	* c-format.c: Likewise.
	* tree-stdarg.c: Likewise.
	* tree-ssa-math-opts.c: Likewise.
	* tree-ssa-dom.c: Likewise.
	* tree-nrv.c: Likewise.
	* tree-ssa-propagate.c: Likewise.
	* ipa-utils.c: Likewise.
	* tree-ssa-propagate.h: Likewise.
	* tree-ssa-alias.c: Likewise.
	* gimple-low.c: Likewise.
	* tree-ssa-sink.c: Likewise.
	* ipa-inline.c: Likewise.
	* c-semantics.c: Likewise.
	* dwarf2out.c: Likewise.
	* expr.c: Likewise.
	* tree-ssa-loop-ivcanon.c: Likewise.
	* predict.c: Likewise.
	* tree-ssa-loop.c: Likewise.
	* tree-parloops.c: Likewise.
	* tree-ssa-address.c: Likewise.
	* tree-ssa-ifcombine.c: Likewise.
	* matrix-reorg.c: Likewise.
	* c-decl.c: Likewise.
	* tree-eh.c: Likewise.
	* c-pretty-print.c: Likewise.
	* lambda-trans.c: Likewise.
	* function.c: Likewise.
	* langhooks.c: Likewise.
	* ebitmap.h: Likewise.
	* tree-vectorizer.c: Likewise.
	* function.h: Likewise.
	* langhooks.h: Likewise.
	* tree-vectorizer.h: Likewise.
	* ipa-type-escape.c: Likewise.
	* ipa-type-escape.h: Likewise.
	* domwalk.c: Likewise.
	* tree-if-conv.c: Likewise.
	* profile.c: Likewise.
	* domwalk.h: Likewise.
	* tree-data-ref.c: Likewise.
	* tree-data-ref.h: Likewise.
	* tree-flow-inline.h: Likewise.
	* tree-affine.c: Likewise.
	* tree-vect-analyze.c: Likewise.
	* c-typeck.c: Likewise.
	* gimplify.c: Likewise.
	* coretypes.h: Likewise.
	* tree-ssa-phiopt.c: Likewise.
	* calls.c: Likewise.
	* tree-ssa-coalesce.c: Likewise.
	* tree.def: Likewise.
	* tree-dfa.c: Likewise.
	* except.c: Likewise.
	* except.h: Likewise.
	* cfgexpand.c: Likewise.
	* tree-cfgcleanup.c: Likewise.
	* tree-ssa-pre.c: Likewise.
	* tree-ssa-live.c: Likewise.
	* tree-sra.c: Likewise.
	* tree-ssa-live.h: Likewise.
	* tree-predcom.c: Likewise.
	* lambda.h: Likewise.
	* tree-mudflap.c: Likewise.
	* ipa-prop.c: Likewise.
	* print-tree.c: Likewise.
	* tree-ssa-copy.c: Likewise.
	* ipa-prop.h: Likewise.
	* tree-ssa-forwprop.c: Likewise.
	* ggc-page.c: Likewise.
	* c-omp.c: Likewise.
	* tree-ssa-dce.c: Likewise.
	* tree-vect-patterns.c: Likewise.
	* tree-ssa-ter.c: Likewise.
	* tree-nested.c: Likewise.
	* tree-ssa.c: Likewise.
	* lambda-code.c: Likewise.
	* tree-ssa-loop-prefetch.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-inline.h: Likewise.
	* tree-iterator.c: Likewise.
	* tree-optimize.c: Likewise.
	* tree-ssa-phiprop.c: Likewise.
	* tree-vect-transform.c: Likewise.
	* tree-object-size.c: Likewise.
	* tree-outof-ssa.c: Likewise.
	* cfgloop.c: Likewise.
	* system.h: Likewise.
	* tree-profile.c: Likewise.
	* cfgloop.h: Likewise.
	* c-gimplify.c: Likewise.
	* c-common.c: Likewise.
	* tree-vect-generic.c: Likewise.
	* tree-flow.h: Likewise.
	* c-common.h: Likewise.
	* basic-block.h: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-switch-conversion.c: Likewise.
	* tree-ssa-structalias.h: Likewise.
	* tree-cfg.c: Likewise.
	* passes.c: Likewise.
	* ipa-struct-reorg.c: Likewise.
	* ipa-struct-reorg.h: Likewise.
	* tree-ssa-reassoc.c: Likewise.
	* cfgrtl.c: Likewise.
	* varpool.c: Likewise.
	* stmt.c: Likewise.
	* tree-ssanames.c: Likewise.
	* tree-ssa-threadedge.c: Likewise.
	* langhooks-def.h: Likewise.
	* tree-ssa-operands.c: Likewise.
	* config/alpha/alpha.c: Likewise.
	* config/frv/frv.c: Likewise.
	* config/s390/s390.c: Likewise.
	* config/m32c/m32c.c: Likewise.
	* config/m32c/m32c-protos.h: Likewise.
	* config/spu/spu.c: Likewise.
	* config/sparc/sparc.c: Likewise.
	* config/i386/i386.c: Likewise.
	* config/sh/sh.c: Likewise.
	* config/xtensa/xtensa.c: Likewise.
	* config/stormy16/stormy16.c: Likewise.
	* config/ia64/ia64.c: Likewise.
	* config/rs6000/rs6000.c: Likewise.
	* config/pa/pa.c: Likewise.
	* config/mips/mips.c: Likewise.

From-SVN: r138207
2008-07-28 14:33:56 +00:00
Daniel Berlin c91457541d Fix PR tree-optimization/23455 Fix PR tree-optimization/35286 Fix PR tree-optimization/35287
2008-07-05  Daniel Berlin  <dberlin@dberlin.org>
	
	Fix PR tree-optimization/23455
	Fix PR tree-optimization/35286
	Fix PR tree-optimization/35287
	* Makefile.in (OBJS-common): Remove tree-vn.o.
	tree-vn.o: Remove.
	* dbgcnt.def: Add treepre_insert debug counter.
	* gcc/tree-flow.h (add_to_value): Updated for other changes.
	(debug_value_expressions): Ditto.
	(print_value_expressions): Ditto.
	* tree-pretty-print.c (dump_generic_node): Updated for
	VALUE_HANDLE removal.
	* tree-ssa-dom.c (record_equality): Ditto.
	(cprop_operand): Ditto.
	(lookup_avail_expr): Ditto.
	* tree-ssa-threadedge.c
	(record_temporary_equivalences_from_stmts_at_dest): Ditto.
	(simplify_control_stmt_condition): Ditto.
	* tree.c (tree_code_size): Ditto.
	(tree_node_structure): Ditto.
	(iterative_hash_expr): Ditto.
	* tree.def: Ditto.
	* tree.h (VALUE_HANDLE_ID): Ditto.
	(VALUE_HANDLE_EXPR_SET): Ditto.
	(struct tree_value_handle): Ditto.
	(union tree_node): Ditto.
	* treestruct.def: Ditto.
	* tree-vn.c: Removed.
	* tree-ssa-pre.c: Rewritten entirely.
	* tree-ssa-sccvn.c (constant_to_value_id): New hashtable.
	(constant_value_ids): Ditto.
	(vn_nary_op_t): Moved to header.
	(vn_phi_t): Ditto.
	(vn_reference_op_t): Ditto
	(vn_reference_t): Ditto.
	(next_value_id): New variable.
	(VN_INFO): Add an assert.
	(vn_constant_eq): New function.
	(vn_constant_hash): Ditto.
	(get_or_alloc_constant_value_id): Ditto.
	(value_id_constant_p): Ditto.
	(vn_reference_compute_hash): De-staticify.
	(copy_reference_ops_from_ref): Don't use get_callee_fndecl.
	Disable some code with a FIXME.
	Remove VALUE_HANDLE use.
	(valueize_refs): Update opcode if it changes from ssa name to
	constant.
	(vn_reference_lookup_1): Add new argument.
	(vn_reference_lookup):  Ditto.
	(vn_reference_lookup_pieces): New function.
	(vn_reference_insert): Add return type. Modify to deal with value
	ids.
	(vn_reference_insert_pieces):  New function.
	(vn_nary_op_compute_hash): De-staticify.
	(vn_nary_op_eq): Ditto.
	(vn_nary_op_lookup_pieces): New function.
	(vn_nary_op_lookup): Add new argument.  
	(vn_nary_op_insert_pieces): New function.
	(vn_nary_op_insert): Add return type. Modify to deal with value
	ids.
	(vn_phi_insert): Ditto.
	(visit_unary_op): Update for callee changes.
	(visit_binary_op): Ditto.
	(visit_reference_op_load): Ditto.
	(visit_reference_op_store): Ditto.
	(init_scc_vn): Init next_value_id, constant_to_value_id and
	constant_value_ids. 
	(free_scc_vn): Free them.
	(set_hashtable_value_ids): New function.
	(run_scc_vn): Use it.
	(get_max_value_id): New function.
	(get_next_value_id): Ditto.
	(expressions_equal_p): Moved from tree-vn.c
	(sort_vuses): Ditto.
	(sort_vuses_heap): Ditto.
	* tree-ssa-sccvn.h: Structures moved from tree-ssa-sccvn.c (noted
	above).
	* tree.c (iterative_hash_hashval_t): Made non-static
	* tree.h (iterative_hash_hashval_t): Declare it.

From-SVN: r137631
2008-07-08 16:11:06 +00:00
Ralf Wildenhues fa10beec52 cgraph.c: Fix typos in comments.
gcc/
	* cgraph.c: Fix typos in comments.
	(cgraph_availability_names): Fix string typo.
	* fold-const.c: Fix typos in comments.
	(fold_binary): Fix typo in warning.
	* genautomata.c: Fix typos in comments.
	(check_presence_pattern_sets): Fix typo in local variable.
	(output_description): Fix typo in output.
	* ggc-zone.c (ggc_pch_finish): Fix typo in error message.
	* hwint.h: Likewise.
	* matrix-reorg.c (check_allocation_function): Likewise.
	* omega.c (smooth_weird_equations): Likewise.
	* auto-inc-dec.c: Fix typos in comments.
	* bb-reorder.c: Likewise.
	* builtins.c: Likewise.
	* c-common.c: Likewise.
	* c-cppbuiltin.c: Likewise.
	* c-parser.c: Likewise.
	* c-pretty-print.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfgexpand.c: Likewise.
	* cfghooks.c: Likewise.
	* cfglayout.c: Likewise.
	* cfgloopmanip.c: Likewise.
	* cgraphunit.c: Likewise.
	* coverage.c: Likewise.
	* dbxout.c: Likewise.
	* df-byte-scan.c: Likewise.
	* df-core.c: Likewise.
	* df-problems.c: Likewise.
	* df-scan.c: Likewise.
	* dfp.c: Likewise.
	* dominance.c: Likewise.
	* domwalk.c: Likewise.
	* dse.c: Likewise.
	* dwarf2out.c: Likewise.
	* emit-rtl.c: Likewise.
	* et-forest.c: Likewise.
	* function.c: Likewise.
	* function.h: Likewise.
	* gcc.c: Likewise.
	* gcov-io.c: Likewise.
	* gcov.c: Likewise.
	* gcse.c: Likewise.
	* genattrtab.c: Likewise.
	* ggc-page.c: Likewise.
	* gimplify.c: Likewise.
	* gthr-lynx.h: Likewise.
	* haifa-sched.c: Likewise.
	* ipa-cp.c: Likewise.
	* ipa-inline.c: Likewise.
	* ipa-prop.h: Likewise.
	* ipa-pure-const.c: Likewise.
	* ipa-struct-reorg.c: Likewise.
	* ipa-struct-reorg.h: Likewise.
	* ipa-type-escape.c: Likewise.
	* ipa.c: Likewise.
	* loop-doloop.c: Likewise.
	* mips-tfile.c: Likewise.
	* mkmap-flat.awk: Likewise.
	* mkmap-symver.awk: Likewise.
	* modulo-sched.c: Likewise.
	* omp-low.c: Likewise.
	* optabs.c: Likewise.
	* optabs.h: Likewise.
	* opts.c: Likewise.
	* passes.c: Likewise.
	* postreload-gcse.c: Likewise.
	* postreload.c: Likewise.
	* predict.c: Likewise.
	* pretty-print.h: Likewise.
	* profile.c: Likewise.
	* protoize.c: Likewise.
	* ra-conflict.c: Likewise.
	* real.c: Likewise.
	* recog.c: Likewise.
	* regclass.c: Likewise.
	* regs.h: Likewise.
	* reload.c: Likewise.
	* rtl-error.c: Likewise.
	* rtlanal.c: Likewise.
	* scan.h: Likewise.
	* sched-rgn.c: Likewise.
	* see.c: Likewise.
	* stmt.c: Likewise.
	* target.h: Likewise.
	* tree-dfa.c: Likewise.
	* tree-eh.c: Likewise.
	* tree-flow-inline.h: Likewise.
	* tree-inline.c: Likewise.
	* tree-into-ssa.c: Likewise.
	* tree-loop-distribution.c: Likewise.
	* tree-nested.c: Likewise.
	* tree-parloops.c: Likewise.
	* tree-pass.h: Likewise.
	* tree-pretty-print.c: Likewise.
	* tree-profile.c: Likewise.
	* tree-scalar-evolution.c: Likewise.
	* tree-sra.c: Likewise.
	* tree-ssa-alias-warnings.c: Likewise.
	* tree-ssa-ccp.c: Likewise.
	* tree-ssa-coalesce.c: Likewise.
	* tree-ssa-dom.c: Likewise.
	* tree-ssa-dse.c: Likewise.
	* tree-ssa-forwprop.c: Likewise.
	* tree-ssa-live.c: Likewise.
	* tree-ssa-live.h: Likewise.
	* tree-ssa-loop-im.c: Likewise.
	* tree-ssa-loop-ivopts.c: Likewise.
	* tree-ssa-loop-niter.c: Likewise.
	* tree-ssa-loop-prefetch.c: Likewise.
	* tree-ssa-phiopt.c: Likewise.
	* tree-ssa-phiprop.c: Likewise.
	* tree-ssa-sccvn.c: Likewise.
	* tree-ssa-ter.c: Likewise.
	* tree-ssa-threadupdate.c: Likewise.
	* tree-ssa.c: Likewise.
	* tree-vect-analyze.c: Likewise.
	* tree-vect-transform.c: Likewise.
	* tree-vectorizer.c: Likewise.
	* tree-vn.c: Likewise.
	* tree-vrp.c: Likewise.
	* tree.c: Likewise.
	* tree.def: Likewise.
	* tree.h: Likewise.
	* unwind-dw2-fde.c: Likewise.
	* unwind.inc: Likewise.
	* value-prof.c: Likewise.
	* vmsdbgout.c: Likewise.

From-SVN: r136425
2008-06-06 05:42:00 +00:00
Richard Guenther 0190265374 tree-ssa-reassoc.c (fini_reassoc): Use the statistics infrastructure.
2008-05-20  Richard Guenther  <rguenther@suse.de>

	* tree-ssa-reassoc.c (fini_reassoc): Use the statistics
	infrastructure.
	* tree-ssa-sccvn.c (process_scc): Likewise.
	* tree-ssa-sink.c (execute_sink_code): Likewise.
	* tree-ssa-threadupdate.c (thread_through_all_blocks): Likewise.
	* tree-vrp.c (process_assert_insertions): Likewise.
	* tree-ssa-dce.c (eliminate_unnecessary_stmts): Likewise.
	(perform_tree_ssa_dce): Likewise.
	* tree-ssa-dom.c (tree_ssa_dominator_optimize): Likewise.
	(dump_dominator_optimization_stats): Likewise.
	* tree-vectorizer.c (vectorize_loops): Likewise.

	* gcc.dg/tree-ssa/ssa-sink-1.c: Adjust.
	* gcc.dg/tree-ssa/ssa-sink-2.c: Likewise.
	* gcc.dg/tree-ssa/ssa-sink-3.c: Likewise.
	* gcc.dg/tree-ssa/ssa-sink-4.c: Likewise.

From-SVN: r135611
2008-05-20 12:34:06 +00:00
Eric Botcazou 45a7844faf tree-ssa-dom.c (tree_ssa_dominator_optimize): If some blocks need EH cleanup at the end of the pass...
* tree-ssa-dom.c (tree_ssa_dominator_optimize): If some blocks need
	EH cleanup at the end of the pass, search for those that have been
	turned into forwarder blocks and do the cleanup on their successor.

From-SVN: r135514
2008-05-18 22:36:30 +00:00
Richard Guenther cf3135aaa1 tree-flow.h (widen_bitfield): Remove declaration.
2008-03-26  Richard Guenther  <rguenther@suse.de>

	* tree-flow.h (widen_bitfield): Remove declaration.
	* tree-ssa-ccp.c (visit_assignment): Remove unneeded code.
	(widen_bitfield): Remove function.
	* tree-ssa-dom.c (record_equivalences_from_stmt): Remove unneeded
	code.

From-SVN: r133597
2008-03-26 11:09:43 +00:00
Richard Guenther ad6003f260 tree-scalar-evolution.c (chrec_contains_symbols_defined_in_loop): Use is_gimple_min_invariant instead of TREE_INVARIANT.
2008-03-21  Richard Guenther  <rguenther@suse.de>

	* tree-scalar-evolution.c (chrec_contains_symbols_defined_in_loop):
	Use is_gimple_min_invariant instead of TREE_INVARIANT.
	* tree-ssa-loop-ivopts.c (force_expr_to_var_cost): Likewise.
	* tree-ssa-dom.c (record_equality): Likewise.
	* tree-inline.c (copy_body_r): Likewise.
	* tree-ssa-pre.c (make_values_for_stmt): Remove test for
	TREE_INVARIANT.

From-SVN: r133403
2008-03-20 23:14:35 +00:00
Jan Hubicka 8ddbbcaea4 re PR other/35094 (RTL dump file letters hosed and partly undocumented)
* gcc.dg/20050811-2.c: Update dumping flags.
	* gcc.dg/sms-2.c: Update dumping flags.
	* gcc.dg/var-expand1.c: Update dumping flags.
	* gcc.dg/var-expand3.c: Update dumping flags.
	* gcc.dg/pr30957-1.c: Update dumping flags.
	* gcc.dg/20050811-1.c: Update dumping flags.
	* gcc.dg/cpp/cmdlne-dI-M.C: Do not xfail.
	* gcc.dg/cpp/cmdlne-dM-M.C: Do not xfail.

	PR other/35094
	* toplev.c (decode_d_option): Handle all CPP flags.
	* tree-vrp.c: Update tree_pass descriptors.
	* regrename.c: Update tree_pass descriptors.
	* fwprop.c: Update tree_pass descriptors.
	* doc/invoke.texi: Remove documentation of dropped -d? flags.
	* tree-into-ssa.c: Update tree_pass descriptors.
	* tree-dump.c: Update tree_pass descriptors.
	* tree-complex.c: Update tree_pass descriptors.
	* tree-dump.h: Update tree_pass descriptors.
	* see.c: Update tree_pass descriptors.
	* cgraphbuild.c: Update tree_pass descriptors.
	* tracer.c: Update tree_pass descriptors.
	* tree-loop-distribution.c: Update tree_pass descriptors.
	* cgraph.c: Update tree_pass descriptors.
	* postreload-gcse.c: Update tree_pass descriptors.
	* postreload.c: Update tree_pass descriptors.
	* tree-ssa-loop-ch.c: Update tree_pass descriptors.
	* tree-tailcall.c: Update tree_pass descriptors.
	* tree-pass.h (tree_opt_pass): Rename to ...
	(opt_pass) ... this one; add "type" field and remove letter field.
	(gimple_opt_pass, rtl_opt_pass, simple_ipa_opt_pass): New.
	(execute_pass_list, execute_ipa_pass_list, all_passes, all_ipa_passes,
	all_lowering_passes): Update declaration.
	* ipa-cp.c: Update tree_pass descriptors.
	* final.c: Update tree_pass descriptors.
	* omp-low.c: Update tree_pass descriptors.
	* tree-ssa-dse.c: Update tree_pass descriptors.
	* ipa-reference.c: Update tree_pass descriptors.
	* tree-ssa-uncprop.c: Update tree_pass descriptors.
	* auto-inc-dec.c: Update tree_pass descriptors.
	* reorg.c: Update tree_pass descriptors.
	* cgraphunit.c: Update tree_pass descriptors.
	* tree-ssa-copyrename.c: Update tree_pass descriptors.
	* tree-ssa-ccp.c: Update tree_pass descriptors.
	* df-core.c: Update tree_pass descriptors.
	* mode-switching.c: Update tree_pass descriptors.
	* tree-nomudflap.c: Update tree_pass descriptors.
	* modulo-sched.c: Update tree_pass descriptors.
	* ipa-pure-const.c: Update tree_pass descriptors.
	* cse.c: Update tree_pass descriptors.
	* web.c: Update tree_pass descriptors.
	* tree-stdarg.c: Update tree_pass descriptors.
	* tree-ssa-math-opts.c: Update tree_pass descriptors.
	* tree-ssa-dom.c: Update tree_pass descriptors.
	* tree-nrv.c: Update tree_pass descriptors.
	* tree-ssa-alias.c: Update tree_pass descriptors.
	* loop-init.c: Update tree_pass descriptors.
	* gimple-low.c: Update tree_pass descriptors.
	* ipa-inline.c: Update tree_pass descriptors.
	* tree-ssa-sink.c: Update tree_pass descriptors.
	* global.c: Update tree_pass descriptors.
	* ifcvt.c: Update tree_pass descriptors.
	* jump.c: Update tree_pass descriptors.
	* predict.c: Update tree_pass descriptors.
	* tree-ssa-loop.c: Update tree_pass descriptors.
	* recog.c: Update tree_pass descriptors.
	* dse.c: Update tree_pass descriptors.
	* tree-ssa-ifcombine.c: Update tree_pass descriptors.
	* tree-eh.c: Update tree_pass descriptors.
	* regmove.c: Update tree_pass descriptors.
	* local-alloc.c
	* function.c: Update tree_pass descriptors.
	* tree-vectorizer.c: Update tree_pass descriptors.
	* gcse.c: Update tree_pass descriptors.
	* ipa-type-escape.c: Update tree_pass descriptors.
	* tree-if-conv.c: Update tree_pass descriptors.
	* init-regs.c: Update tree_pass descriptors.
	* ipa.c: Update tree_pass descriptors.
	* tree-ssa-phiopt.c: Update tree_pass descriptors.
	* rtl-factoring.c: Update tree_pass descriptors.
	* lower-subreg.c: Update tree_pass descriptors.
	* bt-load.c: Update tree_pass descriptors.
	* tree-dfa.c: Update tree_pass descriptors.
	* except.c: Update tree_pass descriptors.
	* emit-rtl.c: Update tree_pass descriptors.
	* cfgexpand.c: Update tree_pass descriptors.
	* tree-cfgcleanup.c: Update tree_pass descriptors.
	* cfgcleanup.c: Update tree_pass descriptors.
	* tree-ssa-pre.c: Update tree_pass descriptors.
	* tree-sra.c: Update tree_pass descriptors.
	* tree-mudflap.c: Update tree_pass descriptors.
	* tree-ssa-copy.c: Update tree_pass descriptors.
	* cfglayout.c: Update tree_pass descriptors.
	* tree-ssa-forwprop.c: Update tree_pass descriptors.
	* tree-ssa-dce.c: Update tree_pass descriptors.
	* tree-ssa.c: Update tree_pass descriptors.
	* regclass.c: Update tree_pass descriptors.
	* integrate.c: Update tree_pass descriptors.
	* tree-optimize.c: Update tree_pass descriptors.
	* tree-ssa-phiprop.c: Update tree_pass descriptors.
	* tree-object-size.c: Update tree_pass descriptors.
	* combine.c: Update tree_pass descriptors.
	* tree-outof-ssa.c: Update tree_pass descriptors.
	* bb-reorder.c: Update tree_pass descriptors.
	* stack-ptr-mod.c: Update tree_pass descriptors.
	* var-tracking.c: Update tree_pass descriptors.
	* tree-profile.c: Update tree_pass descriptors.
	* tree-vect-generic.c: Update tree_pass descriptors.
	* reg-stack.c: Update tree_pass descriptors.
	* sched-rgn.c: Update tree_pass descriptors.
	* tree-ssa-structalias.c: Update tree_pass descriptors.
	* tree-cfg.c: Update tree_pass descriptors.
	* passes.c (current_pass): Update declaration.
	(finish_optimization_passes): Update.
	(all_passes, all_ipa_passes, all_lowering_passes): Update declaration.
	(register_one_dump_file, register_dump_files_1, next_pass_1):
 	Update arguments.
	(init_optimization_passes): Update handling of new types.
	(execute_one_pass, execute_pass_list, execute_ipa_pass_list): Update.
	* ipa-struct-reorg.c: Update tree_pass descriptors.
	* tree-ssa-reassoc.c: Update tree_pass descriptors.
	* combine-stack-adj.c: Update tree_pass descriptors.
	* cfgrtl.c: Update tree_pass descriptors.
	* dce.c: Update tree_pass descriptors.
	* tree-ssanames.c: Update tree_pass descriptors.

From-SVN: r133342
2008-03-19 11:22:40 +00:00
Richard Guenther ae4dbd44ba re PR middle-end/34462 (tree check: expected ssa_name, have struct_field_tag in vuses_compare, at tree-vn.c:118)
2007-12-14  Richard Guenther  <rguenther@suse.de>

	PR middle-end/34462
	* tree-ssa-operands.h (create_ssa_artificial_load_stmt): Add
	parameter to say whether to unlink immediate uses.
	* tree-ssa-operands.c (create_ssa_artificial_load_stmt): Do not
	mark the artificial stmt as modified.  Unlink immediate uses
	only if requested.
	* tree-ssa-dom.c (record_equivalences_from_stmt): Update caller.
	* tree-ssa-pre.c (insert_fake_stores): Likewise.

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

From-SVN: r130931
2007-12-14 14:21:41 +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 741ac90383 c-common.c (fname_as_string, [...]): Constify.
* c-common.c (fname_as_string, c_type_hash): Constify.
	* c-typeck.c (free_all_tagged_tu_seen_up_to): Likewise.
	* cgraph.c (edge_hash, edge_eq): Likewise.
	* dwarf2out.c (decl_die_table_eq, decl_loc_table_eq): Likewise.
	* emit-rtl.c (mem_attrs_htab_eq, reg_attrs_htab_hash,
	reg_attrs_htab_eq): Likewise.
	* except.c (t2r_eq, t2r_hash, ttypes_filter_eq, ehl_hash, ehl_eq):
	Likewise.
	* genautomata.c (const_reserv_sets_t, const_unit_decl_t,
	const_decl_t, const_state_t, const_automata_list_el_t): New.
	(first_out_arc, DECL_UNIT, DECL_BYPASS, DECL_AUTOMATON, DECL_EXCL,
	DECL_PRESENCE, DECL_ABSENCE, DECL_RESERV, DECL_INSN_RESERV,
	automaton_decl_hash, automaton_decl_eq_p, insn_decl_hash,
	insn_decl_eq_p, decl_hash, decl_eq_p, alt_state_cmp,
	reserv_sets_cmp, reserv_sets_eq, state_hash, state_eq_p,
	automata_list_hash, automata_list_eq_p, compare_states_for_equiv,
	compare_max_occ_cycle_nums, out_state_arcs_num,
	compare_transition_els_num, units_cmp, state_reservs_cmp):
	Constify.
	* genmodes.c (cmp_modes): Likewise.
	* ggc-common.c (saving_htab_hash, saving_htab_eq): Likewise.
	* gimplify.c (compare_case_labels): Likewise.
	* ipa-type-escape.c (get_name_of_type, type_brand_s): Likewise.
	* loop-unroll.c (si_info_hash, ve_info_hash): Likewise.
	* matrix-reorg.c (mtt_info_hash): Likewise.
	* postreload-gcse.c (hash_expr_for_htab, expr_equiv_p): Likewise.
	* rtl-factoring.c (const_p_hash_bucket, const_p_hash_elem): New.
	(htab_hash_bucket, htab_hash_elem): Constify.
	* tree-browser.c (TB_parent_eq): Likewise.
	* tree-scalar-evolution.c (hash_scev_info): Likewise.
	* tree-ssa-alias.c (sort_tags_by_id): Likewise.
	* tree-ssa-coalesce.c (const_coalesce_pair_p): New.
	(coalesce_pair_map_hash, coalesce_pair_map_eq, compare_pairs):
	Constify.
	* tree-ssa-dom.c (avail_expr_hash, avail_expr_eq): Likewise.
	* tree-ssa-pre.c (const_expr_pred_trans_t): New.
	(expr_pred_trans_hash, expr_pred_trans_eq): Constify.
	* tree-ssa-sccvn.c (const_vn_binary_op_t, const_vn_unary_op_t,
	const_vn_phi_t, const_vn_reference_op_t, const_vn_reference_t):
	New.
	(vn_reference_op_eq, vn_reference_hash, vn_reference_eq,
	vn_unary_op_hash, vn_unary_op_eq, vn_binary_op_hash,
	vn_binary_op_eq, vn_phi_hash, vn_phi_eq): Constify.
	* tree-ssa-threadupdate.c (redirection_data_hash,
	redirection_data_eq): Likewise. 
	* tree-ssa-uncprop.c (equiv_hash, equiv_eq): Likewise.
	* tree-ssa.c (var_ann_eq): Likewise.
	* tree-vrp.c (compare_case_labels): Likewise.
	* tree.c (int_cst_hash_hash, int_cst_hash_eq,
	tree_map_base_marked_p, type_hash_marked_p, tree_check_failed,
	tree_not_check_failed, tree_class_check_failed,
	tree_range_check_failed, tree_not_class_check_failed,
	omp_clause_check_failed, omp_clause_range_check_failed,
	tree_contains_struct_check_failed, tree_operand_check_failed):
	Likewise. 
	* tree.h (tree_contains_struct_check_failed, tree_check_failed,
	tree_not_check_failed, tree_class_check_failed,
	tree_range_check_failed, tree_not_class_check_failed,
	tree_operand_check_failed, omp_clause_operand_check_failed,
	tree_operand_length): Likewise. 
	* var-tracking.c (const_variable): New.
	(variable_htab_hash, variable_htab_eq): Constify.
	* varasm.c (const_desc_hash): Likewise.

cp:
	* decl.c (typename_hash, typename_compare): Constify.
	* mangle.c (hash_type, compare_type): Likewise.
	* pt.c (eq_local_specializations, hash_local_specialization):
	Likewise.
	* tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
	list_hash): Likewise.
	* typeck2.c (pat_compare): Likewise.

fortran:
	* gfortran.h (generate_isocbinding_symbol): Constify.
	* symbol.c (gen_special_c_interop_ptr, gen_cptr_param,
	generate_isocbinding_symbol): Likewise.

java:
	* class.c (java_treetreehash_hash, java_treetreehash_compare):
	Constify. 
	* expr.c (type_assertion_eq): Likewise.
	* jcf-io.c (compare_path): Likewise.
	* jcf-parse.c (cmpstringp): Likewise.
	* verify-impl.c (get_one_type, compute_argument_types,
	compute_return_type): Likewise. 

objc:
	* objc-act.c (volatilized_hash, volatilized_eq, string_hash,
	string_eq): Constify.

From-SVN: r126925
2007-07-25 19:06:06 +00:00
Richard Guenther f4088621a5 re PR middle-end/15988 (ICE in fold_convert with pointer-to-member-function)
2007-07-02  Richard Guenther  <rguenther@suse.de>

	* tree-flow.h (types_compatible_p): Declare.
	* tree-ssa.c (types_compatible_p): New function.
	* ipa-type-escape.c (discover_unique_type): Use
	types_compatible_p instead of lang_hooks.types_compatible_p.
	* tree-ssa-copyrename.c (copy_rename_partition_coalesce): Likewise.
	* tree-vn.c (expressions_equal_p): Likewise.
	* tree.c (fields_compatible_p): Likewise.
	* tree-ssa-dom.c (avail_expr_eq): Likewise.
	(cprop_operand): Use useless_type_conversion_p instead of
	lang_hooks.types_compatible_p.
	* tree-inline.c (setup_one_parameter): Likewise.
	(declare_return_variable): Likewise.
	* tree-nrv.c (tree_nrv): Likewise.
	* tree-ssa-ccp.c (maybe_fold_offset_to_array_ref): Likewise.
	(maybe_fold_offset_to_component_ref): Likewise.
	(maybe_fold_offset_to_reference): Likewise.
	* tree-ssa-copy.c (may_propagate_copy): Likewise.
	(merge_alias_info): Likewise.
	* tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Likewise.
	* tree-ssa-phiopt.c (conditional_replacement): Likewise.
	* tree-ssa-reassoc.c (optimize_ops_list): Likewise.
	* tree-tailcall.c (find_tail_calls): Likewise.
	* tree-vect-generic.c (expand_vector_operations_1): Likewise.
	* gimplify.c (canonicalize_addr_expr): Likewise.
	(fold_indirect_ref_rhs): Likewise.
	(gimplify_addr_expr): Likewise.  Swap parameters to cpt_same_type.
	(cpt_same_type): Likewise.
	(check_pointer_types_r): Swap parameters to cpt_same_type
	where appropriate.
	* fold-const.c (fold_convert): Revert fix for PR15988.
	* tree-inline.c (setup_one_parameter): Instead fix it here by
	using fold_build1 instead of fold_convert and checking for
	error_mark_node.  Convert only if the conversion is necessary.

From-SVN: r126198
2007-07-02 11:53:08 +00:00
Richard Guenther 36618b93d0 tree-flow.h (tree_ssa_useless_type_conversion_1): Rename to ...
2007-07-02  Richard Guenther  <rguenther@suse.de>

	* tree-flow.h (tree_ssa_useless_type_conversion_1): Rename to ...
	(useless_type_conversion_p): ... this.
	* tree-ssa.c (tree_ssa_useless_type_conversion_1): Rename to ...
	(useless_type_conversion_p): ... this.
	* builtins.c (fold_builtin_memory_op): Rename
	tree_ssa_useless_type_conversion_1 to useless_type_conversion_p.
	* tree-cfg.c (verify_expr): Likewise.
	* tree-ssa-address.c (tree_ssa_useless_type_conversion_1): Likewise.
	* tree-ssa-ccp.c (ccp_fold): Likewise.
	* tree-ssa-copy.c (may_propagate_copy): Likewise.
	* tree-ssa-dom.c (eliminate_redundant_computations): Likewise.
	* tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Likewise.
	* tree-ssa-loop-niter.c (refine_bounds_using_guard): Likewise.
	* tree-ssa-pre.c (eliminate): Likewise.
	* tree-ssa.c (delete_tree_ssa): Likewise.
	(tree_ssa_useless_type_conversion): Likewise.
	* tree.c (build2_stat): Likewise.

From-SVN: r126194
2007-07-02 09:18:14 +00:00
Thomas Neumann c22940cd7c tree-ssa-alias-warnings.c (maybe_add_match): Cast according to the coding conventions.
* tree-ssa-alias-warnings.c (maybe_add_match): Cast according to the
	coding conventions.
	(add_key): Likewise.
	* tree-ssa.c (init_tree_ssa): Use type safe memory macros.
	* tree-ssa-ccp.c (ccp_fold_builtin): Avoid using C++ keywords as
	variable names.
	* tree-ssa-coalesce.c (find_coalesce_pair): Use type safe memory macros.
	(add_cost_one_coalesce): Likewise.
	* tree-ssa-copy.c (merge_alias_info): Avoid using C++ keywords as
	variable names. Rename orig to orig_name for consistency.
	* tree-ssa-dom.c (dom_thread_across_edge): Cast according to the coding
	conventions.
	(cprop_into_successor_phis): Avoid using C++ keywords as variable names.
	(record_equivalences_from_stmt): Likewise.
	* tree-ssa-dse.c (dse_initialize_block_local_data): Cast according to
	the coding conventions.
	(memory_ssa_name_same): Likewise.
	(dse_optimize_stmt): Likewise.
	(dse_record_phis): Likewise.
	(dse_finalize_block): Likewise.
	* tree-ssa-loop-im.c (outermost_invariant_loop_expr): Avoid using C++
	keywords as variable names.
	(may_move_till): Cast according to the coding conventions.
	(force_move_till_expr): Avoid using C++ keywords as variable names.
	(force_move_till): Cast according to the coding conventions.
	(memref_hash): Likewise.
	(memref_eq): Likewise.
	(gather_mem_refs_stmt): Likewise.
	* tree-ssa-loop-ivopts.c (contains_abnormal_ssa_name_p): Avoid using C++
	keywords as variable names.
	(idx_find_step): Cast according to the coding conventions.
	(idx_record_use): Likewise.
	(find_depends): Likewise.
	(prepare_decl_rtl): Likewise.
	(mbc_entry_hash): Likewise.
	(mbc_entry_eq): Likewise.
	* tree-ssa-loop-niter.c (SWAP): Use the correct the type for tmp.
	(simplify_replace_tree): Avoid using C++ keywords as variable names.
	(idx_infer_loop_bounds): Cast according to the coding conventions.
	* tree-ssa-loop-prefetch.c (idx_analyze_ref): Likewise.
	* tree-ssa-math-opts.c (occ_new ): Likwise.
	* tree-ssanames.c (duplicate_ssa_name_ptr_info): Use type safe memory
	macros.
	* tree-ssa-operands.c (add_def_op): Avoid using C++ keywords as variable
	names.
	(add_use_op): Likewise.
	(add_vop): Likewise.
	(add_vuse_op): Likewise.
	(add_vdef_op): Likewise.
	(get_expr_operands): Likewise.
	(push_stmt_changes): Use type safe memory macros.
	* tree-ssa-phiopt.c (replace_phi_edge_with_variable): Avoid using C++
	keywords as variable names.
	(conditional_replacement): Likewise.
	(minmax_replacement): Likewise.
	(abs_replacement): Likewise.
	* tree-ssa-pre.c (create_expression_by_pieces): Cast according to the
	coding conventions.
	(insert_fake_stores): Avoid using C++ keywords as variable names.
	* tree-ssa-reassoc.c (add_to_ops_vec): Cast according to the coding
	conventions.
	* tree-ssa-structalias.c (heapvar_lookup): Likewise.
	(heapvar_insert): Use type safe memory macros.
	(new_var_info): Cast according to the coding conventions.
	(new_constraint): Likewise.
	(remove_preds_and_fake_succs): Use type safe memory macros.
	* tree-ssa-threadupdate.c (thread_block): Cast according to the coding
	conventions.
	(thread_single_edge): Likewise.

From-SVN: r125504
2007-06-06 20:18:47 +00:00
Zdenek Dvorak b02b9b53ec tree-vrp.c (finalize_jump_threads): Do not care about dominance info.
* tree-vrp.c (finalize_jump_threads): Do not care about dominance info.
	(execute_vrp): Preserve loops through jump threading.
	* tree-ssa-threadupdate.c (thread_single_edge,
	dbds_continue_enumeration_p, determine_bb_domination_status,
	thread_through_loop_header): New functions.
	(create_edge_and_update_destination_phis,
	create_edge_and_update_destination_phis): Set loops for the new blocks.
	(prune_undesirable_thread_requests): Removed.
	(redirect_edges): Do not pretend that redirect_edge_and_branch can
	create new blocks.
	(thread_block): Do not call prune_undesirable_thread_requests.
	Update loops.
	(mark_threaded_blocks): Select edges to thread here.
	(thread_through_all_blocks): Take may_peel_loop_headers argument.
	Thread edges through loop headers independently.
	* cfgloopmanip.c (create_preheader, mfb_keep_just): Export.
	* tree-pass.h (TODO_mark_first_instance): New.
	(first_pass_instance): Declare.
	* cfghooks.c (duplicate_block): Put the block to the original loop
	if copy is not specified.
	* tree-ssa-dom.c (tree_ssa_dominator_optimize): Preserve loops through
	jump threading.  Pass may_peel_loop_headers to
	thread_through_all_blocks according to first_pass_instance.
	* cfgloop.h (create_preheader): Declare.
	* tree-flow.h (thread_through_all_blocks): Declaration changed.
	* basic-block.h (mfb_keep_just, mfb_kj_edge): Declare.
	* passes.c (first_pass_instance): New variable.
	(next_pass_1): Set TODO_mark_first_instance.
	(execute_todo): Set first_pass_instance.

	* gcc.dg/tree-ssa/ssa-dom-thread-2.c: New test.
	* gcc.dg/vect/vect-102.c, gcc.dg/vect/vect-103.c,
	gcc.dg/vect/vect-104.c: Use more complex construction to prevent vectorizing.
	* gcc.dg/tree-ssa/pr21559.c: Update outcome.

From-SVN: r124786
2007-05-17 08:10:24 +00:00
Eric Botcazou 4be1caf900 tree-ssa-dom.c (tree_ssa_dominator_optimize): Do not free dominance info after purging EH edges.
* tree-ssa-dom.c (tree_ssa_dominator_optimize): Do not free dominance
	info after purging EH edges.
	(eliminate_degenerate_phis): Likewise.

From-SVN: r124499
2007-05-07 12:48:46 +00:00
Eric Botcazou 8d9d65619c tree-ssa-dom.c (tree_ssa_dominator_optimize): Reset cfg_altered.
* tree-ssa-dom.c (tree_ssa_dominator_optimize): Reset cfg_altered.
	Free dominance info before purging EH edges as well as after.
	(eliminate_degenerate_phis): Likewise.
	(propagate_rhs_into_lhs): Set cfg_altered to true instead of 1.

From-SVN: r124498
2007-05-07 11:42:21 +00:00
Diego Novillo 706ca88ebb tree-pass.h (TODO_update_smt_usage): Remove.
* tree-pass.h (TODO_update_smt_usage): Remove.
	Update all users.
	* tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Remove
	argument SOME.
	Update all users.

From-SVN: r122787
2007-03-09 20:54:13 -05:00
Ian Lance Taylor 0c948c2746 tree-vrp.c: Include "intl.h".
./:	* tree-vrp.c: Include "intl.h".
	(usable_range_p): New static function.
	(compare_values_warnv): Don't test TYPE_OVERFLOW_UNDEFINED for
	overflowed values, juts set *strict_overflow_p.
	(compare_values): Only return -2 if one of the operands is not a
	constant.
	(compare_ranges): Call usable_range_p.
	(compare_range_with_value): Likewise.
	(vrp_evaluate_conditional_warnv): Rename from
	vrp_evaluate_conditional.  Make static.  Change all callers.
	(vrp_evaluate_conditional): New function.
	(simplify_div_or_mod_using_ranges): Issue warning about reliance
	on signed overflow.
	(simplify_abs_using_ranges): Likewise.
	(simplify_stmt_for_jump_threading): Add within_stmt parameter.
	* tree-ssa-dom.c (simplify_stmt_for_jump_threading): Add
	within_stmt parameter.
	* tree-ssa-propagate.c (fold_predicate_in): Update call to
	vrp_evaluate_conditional.
	* tree-ssa-threadedge.c
	(record_temporary_equivalences_from_stmts_at_dest): Change
	simplify parameter to take a second tree parameter.
	(simplify_control_stmt_condition): Likewise.
	(thread_across_edge): Likewise.
	* tree-flow.h (vrp_evaluate_conditional): Update declaration.
	(thread_across_edge): Likewise.
	* gcc/Makefile.in (tree-vrp.o): Depend upon intl.h.
testsuite/:
	* gcc.dg/no-strict-overflow-5.c: New test.
	* gcc.dg/no-strict-overflow-6.c: New test.
	* gcc.dg/Wstrict-overflow-11.c: New test.
	* gcc.dg/Wstrict-overflow-12.c: New test.
	* gcc.dg/Wstrict-overflow-13.c: New test.
	* gcc.dg/Wstrict-overflow-14.c: New test.
	* gcc.dg/Wstrict-overflow-15.c: New test.

From-SVN: r122706
2007-03-08 17:36:05 +00:00
Roger Sayle 939409afce re PR middle-end/30391 (ICE at -O1 with conditional expressions and GIMPLE_MODIFY_STMT)
PR middle-end/30391
	* tree.c (expr_align): Handle MODIFY_EXPR.  GIMPLE_MODIFY_STMT
	should be unreachable.
	(build2_stat): Allow construction of MODIFY_EXPR at any time.
	For the time being redirect GIMPLE_MODIFY_STMT to the new
	(renamed) build_gimple_modify_stmt_stat.
	(build2_gimple_stat): Rename to...
	(build_gimple_modify_stmt_stat): Now longer take a CODE argument.
	Always build a GIMPLE_MODIFY_STMT node.
	* tree.h (build2_gimple, build2_gimple_stat): Delete.
	(build_gimple_modify_stmt, build_gimple_modify_stmt_stat): New
	declarations.

	* tree-cfg.c (factor_computed_gotos, tree_merge_blocks,
	gimplify_val): Use build_gimple_modify_stmt instead of build2_gimple.
	* tree-complex.c (set_component_ssa_name, expand_complex_move,
	expand_complex_div_wide): Likewise.
	* tree-ssa-dom.c (record_equivalences_from_stmt): Likewise.
	* tree-ssa-loop-im.c (schedule_sm): Likewise.
	* tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Likewise.
	* tree-ssa-loop-manip.c (create_iv): Likewise.
	* tree-ssa-phiopt.c (conditional_replacement, minmax_replacement,
	abs_replacement): Likewise.
	* tree-ssa-pre.c (create_expression_by_pieces, poolify_modify_stmt,
	realify_fake_stores): Likewise.

	* builtins.c (std_expand_builtin_va_start): Build a MODIFY_EXPR
	node rather than a GIMPLE_MODIFY_STMT node.
	(std_gimpify_va_arg_expr, expand_builtin_va_copy,
	fold_builtin_memset, fold_builtin_memory_op, do_mpfr_sincos):
	Likewise.
	(integer_valued_real_p): Handle MODIFY_EXPR, not GIMPLE_MODIFY_STMT.
	* expr.c (expand_expr_real_1): Handle both MODIFY_EXPR and
	GIMPLE_MODIFY_STMT.

	* gfortran.dg/pr30391-1.f90: New test case.

From-SVN: r122030
2007-02-16 03:38:22 +00:00
Zdenek Dvorak 89f8f30f35 loop.texi: Document possibility not to perform disambiguation of loops with multiple latches.
* doc/loop.texi: Document possibility not to perform disambiguation
	of loops with multiple latches.
	* cfgloopmanip.c (alp_enum_p): Removed.
	(add_loop): Handle subloops.  Use get_loop_body_with_size.
	(create_preheader): Do not allow ENTRY_BLOCK_PTR to be preheader.
	* cfghooks.c (redirect_edge_and_branch_force): Set dominator for
	the new forwarder block.
	(make_forwarder_block): Only call new_bb_cbk if it is not NULL.
	Handle the case latch is NULL.
	* tree-ssa-dom.c (tree_ssa_dominator_optimize): Avoid cfg modifications
	when marking loop exits.
	* ifcvt.c (if_convert): Ditto.  Mark loop exits even if cfg cannot
	be modified.
	* loop-init.c (loop_optimizer_init): Do not modify cfg.  Call
	disambiguate_loops_with_multiple_latches.
	* tree-cfgcleanup.c (cleanup_tree_cfg_loop): Calculate dominators
	before fix_loop_structure.
	* cfgloop.c: Include pointer-set.h and output.h.
	(canonicalize_loop_headers, HEADER_BLOCK, LATCH_EDGE,
	update_latch_info, mfb_keep_just, mfb_keep_nonlatch): Removed.
	(get_loop_latch_edges, find_subloop_latch_edge_by_profile,
	find_subloop_latch_edge_by_ivs, find_subloop_latch_edge,
	mfb_redirect_edges_in_set, form_subloop, merge_latch_edges,
	disambiguate_multiple_latches, get_loop_body_with_size,
	disambiguate_loops_with_multiple_latches): New functions.
	(flow_loop_dump): Dump multiple latch edges.
	(flow_loop_nodes_find): Handle loops with multiple latches.
	(flow_loops_find): Ditto. Do not call canonicalize_loop_headers.
	(glb_enum_p): Modified.
	(get_loop_body): Use get_loop_body_with_size.
	* cfgloop.h (LOOPS_HAVE_RECORDED_EXITS): New flag.
	(AVOID_CFG_MODIFICATIONS): New constant.
	(disambiguate_loops_with_multiple_latches, add_loop,
	get_loop_body_with_size): Declare.
	* Makefile.in (cfgloop.o): Add pointer-set.h and output.h.

	* gcc.dg/tree-ssa/loop-25.c: New test.

From-SVN: r121670
2007-02-06 21:49:49 +00:00
Jan Hubicka ca15e36529 tree-vrp.c (remove_range_assertions): Release defs.
* tree-vrp.c (remove_range_assertions): Release defs.
	* tree-ssa-loop-ivopts.c (rmeove_statement): Likewise.
	* tree-ssa-dom.c (remove_stmt_or_phi): Likewise.

From-SVN: r120662
2007-01-11 01:20:40 +00:00
Andrew Pinski 1f70491b99 re PR tree-optimization/28624 (latent segfault in remove_phi_node)
2006-12-12  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR tree-opt/28624
        * tree-ssa-dom.c (eliminate_degenerate_phis): Use a temporary
        bitmap for EXECUTE_IF_SET_IN_BITMAP.

From-SVN: r119802
2006-12-12 14:45:25 -08:00
Diego Novillo 38635499e9 [multiple changes]
2006-12-11  Diego Novillo  <dnovillo@redhat.com>

	* doc/tree-ssa.texi: Update documentation for virtual operands
	and the use of push_stmt_changes/pop_stmt_changes.
	* doc/invoke.texi: Remove documentation for params
	global-var-threshold.
	Update documentation on max-aliased-vops.

	* tree-into-ssa.c: Cleanup comments, variables and
	spacing in various functions.
	(regs_to_rename): Declare.
	(mem_syms_to_rename): Declare.
	(dump_update_ssa): Declare.
	(debug_update_ssa): Declare.
	(dump_names_replaced_by): Declare.
	(debug_names_replaced_by): Declare.
	(dump_def_blocks): Declare.
	(debug_def_blocks): Declare.
	(dump_defs_stack): Declare.
	(debug_defs_stack): Declare.
	(dump_currdefs): Declare.
	(debug_currdefs): Declare.
	(mark_def_sites): Do not handle virtual operands.
	(compute_idf): Rename from find_idf.  Update users.
	(register_new_def): Make local.  Convert second argument
	to 'tree'.
	Use BLOCK_DEFS_STACK directly.
	If pushing a non-register, also push the underlying
	symbol.
	(rewrite_stmt): Do not handle virtual operands.
	(dump_tree_ssa): Call dump_def_blocks, dump_defs_stack,
	dump_currdefs and dump_tree_ssa_stats.
	(dump_tree_ssa_stats): Also dump REPL_TBL.
	(replace_use): Remove.  Update all users to call SET_USE
	instead.
	(rewrite_blocks): Move code to free memory to
	fini_ssa_renamer.
	(mark_def_site_blocks): Move initialization code to
	init_ssa_renamer.
	(init_ssa_renamer): New.
	(fini_ssa_renamer): New.
	(rewrite_into_ssa): Call them.
	(prepare_block_for_update): Process SSA_OP_ALL_USES first
	and SSA_OP_ALL_DEFS later.  Do not process virtual
	operands separately.
	(dump_update_ssa): Call dump_decl_set.
	(init_update_ssa): Initialize regs_to_rename and
	mem_syms_to_rename.
	Call init_ssa_renamer.
	(delete_update_ssa): Call fini_ssa_renamer.
	Free blocks_with_phis_to_rewrite.
	(mark_sym_for_renaming): If the variable has
	sub-variables, also mark them.
	If the variable belongs to a partition, also mark it.
	(mark_set_for_renaming): Call mark_sym_for_renaming on
	every symbol in the set.
	(switch_virtuals_to_full_rewrite): Call
	mark_set_for_renaming.
	(update_ssa): Separate syms_to_rename into regs_to_rename
	and mem_syms_to_rename.

	* tree-dump.c (dump_options): Add TDF_MEMSYMS.
	* tree-pretty-print.c (debug_generic_expr): Add TDF_MEMSYMS.
	(debug_generic_stmt): Likewise.
	(debug_tree_chain): Likewise.
	(dump_symbols): New.
	(dump_generic_node): Check for TDF_MEMSYMS.
	Handle MEMORY_PARTITION_TAG.
	If the statement references memory and TDF_MEMSYMS is
	given, call dump_symbols.
	Indicate default names with (D).
	(dump_vops): Update for new virtual operator format.

	* tree.c (init_ttree): Add MEMORY_PARTITION_TAG to
	tree_contains_struct.
	(tree_code_size): Handle MEMORY_PARTITION_TAG.
	(tree_node_structure): Likewise.
	(needs_to_live_in_memory): Handle SSA names.
	* tree.h (MTAG_P): Likewise.
	(struct tree_memory_partition_tag): Declare.
	(MPT_SYMBOLS): Define.
	(union tree_node): Add field 'mpt'.
	* treestruct.def (TS_MEMORY_PARTITION_TAG): Define.
	* tree.def (MEMORY_PARTITION_TAG): Define.

	* tree-pass.h (TDF_MEMSYMS): Define.

	* params.h (GLOBAL_VAR_THRESHOLD): Remove.

	* tree-ssa-alias.c: Include pointer-set.h
	(struct alias_map_d): Remove fields total_alias_vops,
	grouped_p and may_aliases.  Update all users.
	(struct mp_info_def): Declare.
	(mp_info_t): New type.
	(get_smt_for): Rename from get_tmt_for.  Update all
	users.
	(add_may_alias): Add argument ALREADY_ADDED.  If given,
	use it to avoid adding duplicate entries to alias sets.
	(replace_may_alias): Remove.  Update all users.
	(total_alias_vops_cmp): Remove.  Update all users.
	(group_aliases_into): Remove.  Update all users.
	(tree_pointer_compare): Remove.  Update all users.
	(compact_name_tags): Remove.  Update all users.
	(group_aliases): Remove.  Update all users.
	(mark_non_addressable): Move from tree-flow-inline.h.
	Remove the symbol from the partition holding it, if
	needed.
	(dump_mp_info): New.
	(debug_mp_info): New.
	(sort_mp_info): New.
	(create_partition_for): New.
	(rewrite_alias_set_for): New.
	(compute_memory_partitions): New.
	(compute_may_aliases): Call it.
	(init_alias_info): If computing aliases for the first
	time, mark every memory symbol for renaming.
	(have_common_aliases_p): New.
	(compute_flow_insensitive_aliasing): Call it.
	(setup_pointers_and_addressables): Do not cache
	num_referenced_vars.
	For register promoted symbols, mark their former
	partition for renaming.
	(maybe_create_global_var): Only create .GLOBAL_VAR if
	there are no call-clobbered variables and a mix of pure
	and non-pure functions were found.
	(may_alias_p): Tidy comments.
	(create_tag_raw): Remove unused variable new_type.
	(dump_alias_info): call dump_memory_partitions.
	(dump_points_to_info_for): Call dump_decl_set.
	(may_be_aliased): Tidy comments and formatting.

	* timevar.def (TV_MEMORY_PARTITIONING): Define.
	* tree-vectorizer.c (vect_memsyms_to_rename): Rename from
	vect_vnames_to_rename.  Set DECL_UIDs instead of SSA name
	versions in it.
	(slpeel_update_phi_nodes_for_guard1): Ignore memory PHIs.
	* tree-vect-transform.c (vect_transform_loop): Call
	mark_set_for_renaming with vect_memsyms_to_rename.
	* tree-flow-inline.h (zero_imm_uses_p): New.
	(memory_partition): New.
	(set_memory_partition): New.
	(factoring_name_p): New.
	(symbol_mem_tag): New.  Update every function that used
	to access the annotation directly.
	(set_symbol_mem_tag): Likewise.

	* tree-ssa-copy.c (may_propagate_copy): Allow copies
	between a partition and a symbol as long as the symbol
	belongs to the partition.
	(merge_alias_info): Ignore merge requests when memory
	partitions are involved.

	* tree-ssa.c (verify_ssa_name): Check that default
	definitions have empty defining statements.
	(verify_use): Remove argument IS_VIRTUAL.
	Don't call verify_ssa_name.
	(verify_phi_args): Call verify_ssa_name.
	(verify_flow_insensitive_alias_info): Handle MPTs.
	(verify_flow_sensitive_alias_info): Likewise.
	(verify_name_tags): Likewise.
	(verify_call_clobbering): Likewise.
	(verify_ssa): Check for VOPs only after aliasing
	information is available.
	Check virtuals and real operands separately.
	Call verify_ssa_name on every operand.
	(stmt_references_memory_p): Move to tree-ssa-operands.c.
	(walk_use_def_chains_1): Guard against NULL PHI
	arguments.

	* tree-ssa-operands.c (stmt_references_memory_p): Move from
	tree-ssa.c.
	(get_mpt_for): New.
	(dump_memory_partitions): New.
	(debug_memory_partitions): New.

	* tree-flow.h (struct var_ann_d): Add field mpt.
	(struct stmt_ann_d): Add bitfield references_memory.
	* Makefile.in (tree-ssa-structalias.o): Include
	pointer-set.h
	(tree-ssa-alias.o): Likewise.
	* tree-ssa-structalias.c: (update_alias_info): Use
	STORED_SYMS to determine which variables are being
	written to by the store operation.
	* tree-ssa-structalias.h (struct alias_info)
	<total_alias_vops>: Remove.  Update all users.
	<written_vars>: Change to a pointer set.  Update all
	users.
	<dereferenced_ptrs_store>: Likewise.
	<dereferenced_ptrs_load>: Likewise.
	(NUM_REFERENCES): Remove.  Update all users.
	(NUM_REFERENCES_CLEAR): Remove.  Update all users.
	(NUM_REFERENCES_INC): Remove.  Update all users.
	(NUM_REFERENCES_SET): Remove.  Update all users.

	* params.def (PARAM_GLOBAL_VAR_THRESHOLD): Remove.
	Update all users.
	(PARAM_MAX_ALIASED_VOPS): Set to 10.
	* tree-ssanames.c (make_ssa_name): Initialize
	SSA_NAME_IS_DEFAULT_DEF to 0.

2006-12-11  Aldy Hernandez  <aldyh@redhat.com>

	* tree-ssa-dse.c (aggregate_vardecl_d): New.
	(dse_global_data): Add aggregate_vardecl field.
	(dse_possible_dead_store_p): New.
	Add prev_defvar variable.
	Allow immediate uses and previous immediate uses to differ
	if they are setting different parts of the whole.
	(get_aggregate_vardecl): New.
	(dse_record_partial_aggregate_store): New.
	(dse_whole_aggregate_clobbered_p): New.
	(dse_partial_kill_p): New.
	(dse_optimize_stmt): Abstract code checking a possible dead store
	into new function dse_possible_dead_store_p().
	Call dse_maybe_record_aggregate_store().
	When checking whether a STMT and its USE_STMT refer to the
	same memory address, check also for partial kills that clobber
	the whole.
	Move some variable definitions to the block where they are used.
	(aggregate_vardecl_hash): New.
	(aggregate_vardecl_eq): New.
	(aggregate_vardecl_free): New.
	(aggregate_whole_store_p): New.
	(tree_ssa_dse): Initialize and free aggregate_vardecl.
	Mark which aggregate stores we care about.

2006-12-11  Andrew Macleod  <amacleod@redhat.com>

	* tree-ssa-operands.h (struct vuse_element_d): Declare.
	(vuse_element_t): Declare.
	(struct vuse_vec_d): Declare.
	(vuse_vec_p): Declare.
	(VUSE_VECT_NUM_ELEM): Define.
	(VUSE_VECT_ELEMENT_NC): Define.
	(VUSE_ELEMENT_PTR_NC): Define.
	(VUSE_ELEMENT_VAR_NC): Define.
	(VUSE_VECT_ELEMENT): Define.
	(VUSE_ELEMENT_PTR): Define.
	(VUSE_ELEMENT_VAR): Define.
	(struct maydef_optype_d) <use_var>: Remove.
	<use_ptr>: Remove.
	<usev>: Add.
	(struct vuse_optype_d) <kill_var>: Remove.
	<use_ptr>: Remove.
	<usev>: Add.
	(struct mustdef_optype_d) <kill_var>: Remove.
	<use_ptr>: Remove.
	<usev>: Add.
	(VUSE_OP_PTR): Add argument.  Use VUSE_ELEMENT_PTR.
	(VUSE_OP): Add argument.  Use VUSE_ELEMENT_PTR.
	(VUSE_NUM): Define.
	(VUSE_VECT): Define.
	(MAYDEF_OP_PTR): Add argument.  Use VUSE_OP_PTR.
	(MAYDEF_OP): Add argument.  Use VUSE_OP.
	(MAYDEF_NUM): Define.
	(MAYDEF_VECT): Define.
	(MUSTDEF_KILL_PTR): Use VUSE_OP_PTR.
	(MUSTDEF_KILL): Use VUSE_OP.
	(MUSTDEF_NUM): Define.
	(MUSTDEF_VECT): Define.
	(realloc_maydef): Declare.
	(realloc_vuse): Declare.
	(struct ssa_operand_iterator_d) <vuse_index>: Add.
	<mayuse_index>: Add.
	(LOADED_SYMS): Define.
	(STORED_SYMS): Define.
	(FOR_EACH_SSA_MUSTDEF_OPERAND): Call op_iter_next_mustdef.
	* tree-into-ssa.c: Adapt for multi-operand V_MAY_DEF and VUSE
	operators.
	* tree-pretty-print.c: Likewise.
	* tree-ssa-dse.c: Likewise.
	* tree-flow-inline.h: Likewise.
	(op_iter_next_mustdef): New.
	* tree-ssa-operands.c: Likewise.
	(ALLOC_OPTYPE): Remove.
	Update all users.
	(alloc_def): New.
	(alloc_use): New.
	(alloc_maydef): New.
	(alloc_vuse): New.
	(alloc_mustdef): New.
	(realloc_maydef): New.
	(realloc_vuse): New.

2006-12-11  Aldy Hernandez  <aldyh@redhat.com>

	* tree-ssa-operands.c: Remove build_v_must_defs.
	(init_ssa_operands): Delete build_v_must_defs.
	(finalize_ssa_v_must_def_ops): Remove.
	(finalize_ssa_v_must_defs): Remove.
	(finalize_ssa_stmt_operands): Do not call
	finalize_ssa_v_must_defs.
	(start_ssa_stmt_operands): Do not check build_v_must_defs.
	(append_v_must_def): Delete.
	(copy_virtual_operands): Do not copy V_MUST_DEFs.
	(get_modify_expr_operands): Remove reference to V_MUST_DEF from
	comment.  Remove opf_kill_def.
	(build_ssa_operands): Remove references to v_must_defs.
	(copy_virtual_operands): Same.
	(copy_virtual_operands): Same.
	(fini_ssa_operands): Same.
	(free_ssa_operands): Same.
	(add_mustdef_op): Remove.
	Remove mustdef_optype_p.
	(alloc_mustdef): Remove.
	Remove references to V_MUST_DEFs in comment at top of file.
	(get_expr_operands): Remove opf_kill_def.
	(opf_kill_def): Remove.
	(add_virtual_operand): Remove opf_kill_def.
	(get_indirect_ref_operands): Same.
	(get_tmr_operands): Same.

	* tree-vectorizer.c (rename_variables_in_bb): Remove
	SSA_OP_ALL_KILLS.

	* tree-ssa-loop-manip.c (find_uses_to_rename_stmt): Remove
	SSA_OP_ALL_KILLS.
	(check_loop_closed_ssa_stmt): Same.

	* tree-ssa.c (verify_def): Remove V_MUST_DEF from comment.
	(verify_use): Same.
	(verify_ssa): Remove V_MUST_DEFs traces.
	(verify_ssa): Remove SSA_OP_ALL_KILLS.

	* tree-into-ssa.c (mark_def_sites): Change SSA_OP_VMUSTDEF to
	SSA_OP_VMAYDEF.
	(rewrite_update_stmt): Remove SSA_OP_VIRTUAL_KILLS.
	(rewrite_stmt): Remove SSA_OP_ALL_KILLS.

	* tree-ssa-operands.h (struct stmt_operands_d): Remove V_MUST_DEF
	references.
	(MUSTDEF_OPS): Remove.
	(SSA_OP_VMUSTDEF): Remove.
	(FOR_EACH_SSA_MUSTDEF_OPERAND): Remove.
	(struct mustdef_optype_d): Remove.
	Remove mustdef_optype_p.
	(struct stmt_operands_d): Remove mustdef_ops.
	(ssa_operand_iterator_d): Remove mustdefs and mustkills.
	(SSA_OP_VIRTUAL_DEFS): Remove SSA_OP_VMUSTDEF.
	(MUSTDEF_RESULT_PTR): Remove.
	(MUSTDEF_RESULT): Remove.
	(MUSTDEF_KILL_PTR): Remove.
	(MUSTDEF_KILL): Remove.
	(MUSTDEF_NUM): Remove.
	(MUSTDEF_VECT): Remove.
	(SSA_OP_VIRTUAL_KILLS): Remove.
	(SSA_OP_ALL_VIRTUALS): Remove SSA_OP_VIRTUAL_KILLS.
	(SSA_OP_VMUSTKILL): Remove.
	(SSA_OP_ALL_KILLS): Remove.
	(SSA_OP_ALL_OPERANDS): Remove SSA_OP_ALL_KILLS.

	* tree-flow-inline.h (op_iter_init_def): Remove
	SSA_OP_VIRTUAL_KILLS.
	(delink_stmt_imm_use): Remove SSA_OP_ALL_KILLS.

	* tree-ssa-pre.c (compute_rvuse_and_antic_safe): Remove
	SSA_OP_VIRTUAL_KILLS.

	* tree-ssa-loop-im.c (determine_max_movement): Remove
	SSA_OP_VIRTUAL_KILLS.
	(gather_mem_refs_stmt): Same.
	(gather_mem_refs_stmt): Same.

	* tree-ssa-dce.c (mark_really_necessary_kill_operand_phis): Delete.
	(perform_tree_ssa_dce): Remove call to
	mark_really_necessary_kill_operand_phis.

	* tree-flow-inline.h (op_iter_init): Remove setting of mustdefs
	and mustkills.
	(op_iter_next_use): Do not check mustkills.
	(op_iter_next_def): Do not check mustdefs.
	(op_iter_next_tree): Do not check mustkills or mustdefs.
	(clear_and_done_ssa_iter): Do not set mustdefs or mustkills.
	(op_iter_next_maymustdef): Do not check mustkills.
	(op_iter_init_must_and_may_def): Remove SSA_OP_VMUSTKILL.
	(op_iter_init_mustdef): Remove.

	* tree-ssa-live.c (create_ssa_var_map): Change SSA_OP_VMUSTDEF to
	SSA_OP_VMAYDEF.

	* tree-ssa-dse.c (dse_optimize_stmt): Remove SSA_OP_VMUSTDEF.

	* tree-ssa-ccp.c: Remove V_MUST_DEF traces from comments.
	(visit_assignment): Same.

	* tree-ssa-copy.c (copy_prop_visit_assignment): Same.

	* tree-sra.c (mark_all_v_defs_1): Remove V_MUST_DEF from comment.

	* tree-outof-ssa.c (check_replaceable): Remove SSA_OP_VMUSTDEF.

	* tree-pretty-print.c (dump_vops): Remove printing of V_MUST_DEF.
	Remove kill_p variable.

	* tree-dfa.c (struct dfa_stats_d): Remove num_v_must_defs.
	(dump_dfa_stats): Remove code related to V_MUST_DEFs.
	(collect_dfa_stats_r): Do not set num_v_must_defs.
	(mark_new_vars_to_rename): Remove v_must_defs_{before,after}
	code.

	* tree-into-ssa.c (mark_def_sites): Change SSA_OP_VMUSTKILL to
	SSA_OP_VMAYUSE.

	* tree-ssa-pre.c (compute_rvuse_and_antic_safe): Remove
	SSA_OP_VMUSTDEF and SSA_OP_VMUSTKILL.

	* tree-ssa-propagate.c (stmt_makes_single_store): Remove
	SSA_OP_VMUSTDEF.

From-SVN: r119760
2006-12-11 20:48:51 -05:00
Diego Novillo cfaab3a924 tree-ssa-operands.h (create_ssa_artificial_load_stmt): Rename from create_ssa_artficial_load_stmt.
* tree-ssa-operands.h (create_ssa_artificial_load_stmt):
	Rename from create_ssa_artficial_load_stmt.  Update all users.
	* tree-into-ssa.c (register_new_def): Make static.
	* tree.c (is_global_var): Handle SSA_NAMEs.
	* tree.h (SSA_NAME_IS_DEFAULT_DEF): Define.  Update all users
	that used to call gimple_default_def.
	* tree-ssa-operands.c (push_stmt_changes): New.
	(pop_stmt_changes): New.  Update every pass that modifies
	statements to bracket modifications with
	push_stmt_changes/pop_stmt_changes.
	(discard_stmt_changes): New.
	* tree-ssa-dom.c (stmts_to_rescan): Change to stack of
	'tree *' instead of 'tree'.  Update all users.
	* tree-flow-inline.h (zero_imm_uses_p): New.
	(symbol_mem_tag): New.  Update every function that used
	to access the annotation directly.
	(set_symbol_mem_tag): Likewise.
	* tree-dfa.c (dump_variable): Always show the escape mask.
	(mark_symbols_for_renaming): Rename from
	mark_new_vars_to_rename.  Update all users.
	Only mark to rename naked symbols in real and virtual
	operands.

From-SVN: r119746
2006-12-11 15:15:53 -05:00
Diego Novillo 9b3b55a105 * tree-scalar-evolution.c (scev_const_prop):
* tree-phinodes.c (remove_phi_node): Add argument
	RELEASE_LHS_P.  If given, release the SSA name on the LHS of
	the PHI node.
	Update all users.
	* tree-ssa-dce.c: Remove forward declarations for static
	functions.  Re-arrange functions bodies as needed.
	(find_obviously_necessary_stmts): Never mark PHI nodes as
	obviously necessary.

From-SVN: r119740
2006-12-11 12:50:53 -05:00
Daniel Berlin ae07b4632c tree-vrp.c (pass_vrp): Remove PROP_smt_usage.
2006-12-05  Daniel Berlin  <dberlin@dberlin.org>

	* tree-vrp.c (pass_vrp): Remove PROP_smt_usage.
	* tree-complex.c (pass_lower_complex): Ditto.
	* tree-ssa-ccp.c (pass_ccp): Ditto.
	(pass_store_ccp): Ditto.
	* tree-ssa-dom.c (pass_dominator): Ditto.
	(pass_phi_only_cprop): Ditto.
	* tree-sra.c (pass_sra): Ditto.
	* tree-ssa-forwprop.c (pass_forwprop): Ditto.
	* tree-flow.h (updating_used_alone): Remove.
	(updating_used_alone): Ditto.
	* tree-ssa-alias.c (updating_used_alone): Remove variable.
	(lhs_may_store_to): Remove function.
	(recalculate_used_alone): Ditto.
	(compute_may_aliases): Remove used_alone calculation.
	* tree.h (struct tree_memory_tag): Remove is_used_alone and
	old_used_alone. Remove SMT_USED_ALONE and SMT_OLD_USED_ALONE.
	* tree-pass.h (PROP_smt_usage): Remove.
	* passes.c (execute_todo): Remove used alone recalculation.
	(execute_one_pass): Ditto.
	* tree-ssa-operands.c (add_virtual_operand): Remove used_alone
	stuff.

From-SVN: r119550
2006-12-05 18:39:13 +00:00
Aldy Hernandez 07beea0df3 Merge gimple-tuples-branch into mainline.
From-SVN: r119546
2006-12-05 17:26:05 +00:00
Zdenek Dvorak d73be2683d tree-vrp.c (execute_vrp): Do not pass loops structure through arguments.
* tree-vrp.c (execute_vrp): Do not pass loops structure through
	arguments.
	* loop-unswitch.c (unswitch_loops, unswitch_single_loop,
	unswitch_loop): Ditto.
	* tree-loop-linear.c (linear_transform_loops): Ditto.
	* tree-ssa-loop-im.c (determine_lsm, tree_ssa_lim_initialize,
	tree_ssa_lim): Ditto.
	* tree-ssa-loop-niter.c (estimate_numbers_of_iterations,
	free_numbers_of_iterations_estimates): Ditto.
	* tree-ssa-loop-unswitch.c (tree_ssa_unswitch_loops,
	tree_unswitch_single_loop, tree_unswitch_loop): Ditto.
	* cfgloopmanip.c (fix_bb_placement, fix_bb_placements,
	remove_path, add_loop, loopify, unloop, fix_loop_placements,
	place_new_loop, duplicate_loop, duplicate_subloops,
	update_single_exit_for_duplicated_loops, copy_loops_to,
	duplicate_loop_to_header_edge, create_preheaders,
	force_single_succ_latches, loop_version, fix_loop_structure):
	Ditto.
	* tree-ssa-loop-manip.c (tree_duplicate_loop_to_header_edge,
	tree_unroll_loop): Ditto.
	* tree-ssa-loop-ch.c (copy_loop_headers): Ditto.
	* tree-scalar-evolution.c (select_loops_exit_conditions,
	scev_initialize, scev_analysis): Ditto.
	* tree-scalar-evolution.h (scev_initialize): Ditto.
	* cfghooks.c (cfg_hook_duplicate_loop_to_header_edge): Ditto.
	* cfgloopanal.c (mark_irreducible_loops, mark_loop_exit_edges): Ditto.
	* tree-ssa-loop-ivopts.c (tree_ssa_iv_optimize): Ditto.
	* modulo-sched.c (sms_schedule): Ditto.
	* tree-ssa-dom.c (tree_ssa_dominator_optimize): Ditto.
	* loop-init.c (loop_optimizer_init, rtl_move_loop_invariants,
	rtl_unswitch, rtl_unroll_and_peel_loops, rtl_doloop): Ditto.
	* ifcvt.c (if_convert): Ditto.
	* tree-ssa-loop-ivcanon.c (try_unroll_loop_completely,
	canonicalize_loop_induction_variables,
	canonicalize_induction_variables,
	tree_unroll_loops_completely, remove_empty_loops): Ditto.
	* tree-ssa-loop.c (tree_ssa_loop_init, tree_ssa_loop_im,
	tree_ssa_loop_unswitch, tree_vectorize, tree_linear_transform,
	tree_ssa_loop_ivcanon, tree_ssa_empty_loop, tree_ssa_loop_bounds,
	tree_complete_unroll, tree_ssa_loop_prefetch, tree_ssa_loop_ivopts,
	tree_ssa_loop_done): Ditto.
	* predict.c (predict_loops, tree_estimate_probability, estimate_loops,
	estimate_bb_frequencies): Ditto.
	* tree-vectorizer.c (slpeel_tree_duplicate_loop_to_edge_cfg,
	slpeel_tree_peel_loop_to_edge, vectorize_loops): Ditto.
	* loop-unroll.c (unroll_and_peel_loops, peel_loops_completely,
	decide_unrolling_and_peeling, peel_loop_completely,
	unroll_loop_constant_iterations, unroll_loop_runtime_iterations,
	peel_loop_simple, unroll_loop_stupid): Ditto.
	* loop-doloop.c (doloop_optimize_loops): Ditto.
	* tree-cfgcleanup.c (cleanup_tree_cfg_loop): Ditto.
	* loop-invariant.c (move_loop_invariants): Ditto.
	* tree-ssa-dce.c (tree_ssa_dce_loop): Ditto.
	* tree-ssa-loop-prefetch.c (loop_prefetch_arrays,
	tree_ssa_prefetch_arrays): Ditto.
	* lambda-code.c (gcc_loopnest_to_lambda_loopnest, perfect_nestify):
	Ditto.
	* tree-vect-transform.c (vect_do_peeling_for_loop_bound,
	vect_do_peeling_for_alignment, vect_transform_loop): Ditto.
	* cfgloop.c (flow_loops_cfg_dump, flow_loops_dump,
	mark_single_exit_loops, cancel_loop, cancel_loop_tree,
	verify_loop_structure): Ditto.
	* tree-flow.h (vectorize_loops, tree_ssa_lim, tree_ssa_unswitch_loops,
	canonicalize_induction_variables, tree_unroll_loops_completely,
	tree_ssa_prefetch_arrays, remove_empty_loops, tree_ssa_iv_optimize,
	estimate_numbers_of_iterations, free_numbers_of_iterations_estimates,
	tree_duplicate_loop_to_header_edge, tree_ssa_loop_version,
	tree_unroll_loop, linear_transform_loops): Declaration changed.
	* basic-block.h: Remove declaration of struct loops.
	* cfghooks.h (struct cfg_hooks): Change type of
	cfg_hook_duplicate_loop_to_header_edge.
	(cfg_hook_duplicate_loop_to_header_edge): Declaration changed.
	* tree-vectorizer.h (slpeel_tree_peel_loop_to_edge,
	vect_transform_loop): Declaration changed.
	* lambda.h (gcc_loopnest_to_lambda_loopnest): Declaration changed.
	* cfgloop.h (flow_loops_dump, fix_loop_structure,
	mark_irreducible_loops, mark_single_exit_loops, mark_loop_exit_edges,
	cancel_loop_tree, create_preheaders, force_single_succ_latches,
	verify_loop_structure, duplicate_loop, duplicate_loop_to_header_edge,
	loopify, loop_version, remove_path, unswitch_loops,
	unroll_and_peel_loops, doloop_optimize_loops, move_loop_invariants):
	Declaration changed.

From-SVN: r119189
2006-11-25 10:34:13 +00:00
Zdenek Dvorak 598ec7bdbe tree-vrp.c (execute_vrp): Do not update current_loops.
* tree-vrp.c (execute_vrp): Do not update current_loops.
	* loop-unswitch.c (unswitch_loop): Do not use loop_split_edge_with.
	* doc/loop.texi: Remove documentation for cancelled functions.
	* tree-ssa-loop-im.c (loop_commit_inserts): Removed.
	(move_computations, determine_lsm): Use bsi_commit_edge_inserts
	instead.
	* cfgloopmanip.c (remove_bbs): Do not update loops explicitly.
	(remove_path): Ensure that in delete_basic_blocks, the loops
	are still allocated.
	(add_loop): Work on valid loop structures.
	(loopify): Modify call of add_loop.
	(mfb_update_loops): Removed.
	(create_preheader): Do not update loops explicitly.
	(force_single_succ_latches, loop_version): Do not use
	loop_split_edge_with.
	(loop_split_edge_with): Removed.
	* tree-ssa-loop-manip.c (create_iv, determine_exit_conditions):
	Do not use bsi_insert_on_edge_immediate_loop.
	(split_loop_exit_edge, tree_unroll_loop): Do not use
	loop_split_edge_with.
	(bsi_insert_on_edge_immediate_loop): Removed.
	* tree-ssa-loop-ch.c (copy_loop_headers): Use current_loops.  Do not
	use loop_split_edge_with.
	* cfghooks.c: Include cfgloop.h.
	(verify_flow_info): Verify that loop_father is filled iff current_loops
	are available.
	(redirect_edge_and_branch_force, split_block, delete_basic_block,
	split_edge, merge_blocks, make_forwarder_block, duplicate_block):
	Update cfg.
	* cfgloopanal.c (mark_irreducible_loops): Work if the function contains
	no loops.
	* modulo-sched.c (generate_prolog_epilog, canon_loop): Do not use
	loop_split_edge_with.
	(sms_schedule): Use current_loops.
	* tree-ssa-dom.c (tree_ssa_dominator_optimize): Use current_loops.
	* loop-init.c (loop_optimizer_init, loop_optimizer_finalize): Set
	current_loops.
	(rtl_loop_init, rtl_loop_done): Do not set current_loops.
	* tree-ssa-sink.c (execute_sink_code): Use current_loops.
	* ifcvt.c (if_convert): Ditto.
	* predict.c (predict_loops): Do not clear current_loops.
	(tree_estimate_probability): Use current_loops.
	(propagate_freq): Receive head of the region to propagate instead of
	loop.
	(estimate_loops_at_level): Do not use shared to_visit bitmap.
	(estimate_loops): New function.  Handle case current_loops == NULL.
	(estimate_bb_frequencies): Do not allocate tovisit.  Use
	estimate_loops.
	* tree-ssa-loop.c (current_loops): Removed.
	(tree_loop_optimizer_init): Do not return loops.
	(tree_ssa_loop_init, tree_ssa_loop_done): Do not set current_loops.
	* tree-vectorizer.c (slpeel_update_phi_nodes_for_guard1,
	slpeel_update_phi_nodes_for_guard2, slpeel_tree_peel_loop_to_edge):
	Do not update loops explicitly.
	* function.h (struct function): Add x_current_loops field.
	(current_loops): New macro.
	* tree-if-conv.c (combine_blocks): Do not update loops explicitly.
	* loop-unroll.c (split_edge_and_insert): New function.
	(unroll_loop_runtime_iterations, analyze_insns_in_loop): Do not
	use loop_split_edge_with.
	* loop-doloop.c (add_test, doloop_modify): Ditto.
	* tree-ssa-pre.c (init_pre, fini_pre): Do not set current_loops.
	* cfglayout.c (copy_bbs): Do not update loops explicitly.
	* lambda-code.c (perfect_nestify): Do not use loop_split_edge_with.
	* tree-vect-transform.c (vect_transform_loop): Do not update loops
	explicitly.
	* cfgloop.c (flow_loops_cfg_dump): Do not dump dfs_order and rc_order.
	(flow_loops_free): Do not free dfs_order and rc_order.
	(flow_loops_find): Do not set dfs_order and rc_order in loops
	structure.  Do not call loops and flow info verification.
	(add_bb_to_loop, remove_bb_from_loops): Check whether the block
	already belongs to some loop.
	* cfgloop.h (struct loops): Remove struct cfg.
	(current_loops, loop_split_edge_with): Declaration removed.
	(loop_optimizer_init, loop_optimizer_finalize): Declaration changed.
	* tree-flow.h (loop_commit_inserts, bsi_insert_on_edge_immediate_loop):
	Declaration removed.
	* Makefile.in (cfghooks.o): Add CFGLOOP_H dependency.
	* basic-block.h (split_edge_and_insert): Declare.
	* tree-cfg.c (remove_bb): Do not update loops explicitly.

From-SVN: r118931
2006-11-17 11:29:17 +00:00
Roger Sayle 14b41b5f66 tree-ssa-dom.c (record_conditions): Only record "unordered" conditions from floating point comparisons.
* tree-ssa-dom.c (record_conditions): Only record "unordered"
	conditions from floating point comparisons.

From-SVN: r114489
2006-06-08 16:48:30 +00:00
Andrew MacLeod a5f844647b The condition the assert was flawed.
2006-04-28  Andrew MacLeod  <amacleod@redhat.com>

	* tree-ssa-dom.c (propagate_rhs_into_lhs): Fix assert clause.

From-SVN: r113356
2006-04-28 20:39:18 +00:00
Andrew MacLeod 6c00f606c1 Implement new immediate use iterators.
2006-04-27  Andrew MacLeod  <amacleod@redhat.com>

	PR tree-optimization/26854
	* tree-vrp.c (remove_range_assertions): Use new Immuse iterator.
	* doc/tree-ssa.texi: Update immuse iterator documentation.
	* tree-ssa-math-opts.c (execute_cse_reciprocals_1): Use new iterator.
	* tree-ssa-dom.c (propagate_rhs_into_lhs): Use new iterator.
	* tree-flow-inline.h (end_safe_imm_use_traverse, end_safe_imm_use_p,
	first_safe_imm_use, next_safe_imm_use): Remove.
	(end_imm_use_stmt_p): New.  Check for end of immuse stmt traversal.
	(end_imm_use_stmt_traverse): New.  Terminate immuse stmt traversal.
	(move_use_after_head): New.  Helper function to sort immuses in a stmt.
	(link_use_stmts_after): New.  Link all immuses in a stmt consescutively.
	(first_imm_use_stmt): New.  Get first stmt in an immuse list.
	(next_imm_use_stmt): New.  Get next stmt in an immuse list.
	(first_imm_use_on_stmt): New.  Get first immuse on a stmt.
	(end_imm_use_on_stmt_p): New.  Check for end of immuses on a stmt.
	(next_imm_use_on_stmt): New.  Move to next immuse on a stmt.
	* tree-ssa-forwprop.c (forward_propagate_addr_expr): Use new iterator.
	* lambda-code.c (lambda_loopnest_to_gcc_loopnest): Use new iterator.
	(perfect_nestify): Use new iterator.
	* tree-vect-transform.c (vect_create_epilog_for_reduction): Use new 
	iterator.
	* tree-flow.h (struct immediate_use_iterator_d): Add comments.
	(next_imm_name): New field in struct immediate_use_iterator_d.
	(FOR_EACH_IMM_USE_SAFE, BREAK_FROM_SAFE_IMM_USE): Remove.
	(FOR_EACH_IMM_USE_STMT, BREAK_FROM_IMM_USE_STMT, 
	FOR_EACH_IMM_USE_ON_STMT): New immediate use iterator macros.
	* tree-cfg.c (replace_uses_by): Use new iterator.
	* tree-ssa-threadedge.c (lhs_of_dominating_assert): Use new iterator.
	* tree-ssa-operands.c (correct_use_link): Remove.
	(finalize_ssa_use_ops): No longer call correct_use_link.

From-SVN: r113321
2006-04-27 20:22:17 +00:00
Kazu Hirata 66a4ad3731 op-common.h, [...]: Fix comment typos.
* config/soft-fp/op-common.h, double-int.h, tree-ssa-dom.c:
	Fix comment typos.
	* doc/tm.texi: Fix a typo.

From-SVN: r113178
2006-04-22 16:19:56 +00:00
Jeff Law bfc646bfc0 re PR tree-optimization/26854 (Inordinate compile times on large routines)
PR tree-optimization/26854
	* tree-ssa-dse.c (dse_optimize_stmt): Avoid num_imm_uses when
	checking for zero or one use.
	* tree-ssa-dom.c (propagate_rhs_into_lhs): Similarly.
	* tree-cfgcleanup.c (merge_phi_nodes): Similarly.
	* tree-ssa-reassoc.c (negate_value): Similarly.
	(reassociate_bb): Similarly.

From-SVN: r113120
2006-04-20 10:13:12 -06:00