Commit Graph

131 Commits

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

From-SVN: r151312
2009-09-02 02:42:21 +00:00
Paolo Bonzini cde0f3fd8a expr.c (store_constructor): Use promote_decl_mode.
2009-04-17  Paolo Bonzini  <bonzini@gnu.org>

	* expr.c (store_constructor): Use promote_decl_mode.  Remove
	now write-only variable unsignedp.
	(expand_expr_real_1): Use promote_decl_mode.
	* expr.h (promote_function_mode, promote_decl_mode): New.
	(promote_mode): Remove last argument.
	* function.c (assign_temp): Drop last argument of promote_mode.
	(assign_parm_find_data_types): Use promote_function_mode.
	(assign_parm_setup_reg): Likewise.
	(expand_function_end): Use promote_function_mode.
	* calls.c (initialize_argument_information): Use promote_function_mode.
	(precompute_arguments): Use promote_mode instead of checking if
	only PROMOTE_FUNCTION_MODE is defined.
	(expand_call): When making sibcall decisions, use promote_function_mode.
	Below, remove an if for targetm.calls.promote_function_return and
	and use promote_function_mode.
	(emit_library_call_value_1): Use promote_function_mode, fix bug
	where promote_mode was passed FOR_CALL == 0 for a return value in an
	assertion.
	* cfgexpand.c (expand_one_register_var): Use promote_decl_mode.
	* explow.c (promote_function_mode, promote_decl_mode): New.
	(promote_mode): Keep only the FOR_CALL == 0 case.
	* combine.c (setup_incoming_promotion): Remove test of
	promote_function_args.  Use promote_function_mode.
	* stmt.c (expand_value_return): Use promote_decl_mode.
	(expand_decl): Use promote_decl_mode.

	* expr.c (store_constructor): Use promote_decl_mode.  Remove
	now write-only variable unsignedp.
	(expand_expr_real_1): Use promote_decl_mode.
	* expr.h (promote_function_mode, promote_decl_mode): New.
	(promote_mode): Remove last argument.
	* function.c (assign_temp): Drop last argument of promote_mode.
	(assign_parm_find_data_types): Use promote_function_mode.
	(assign_parm_setup_reg): Likewise.
	(expand_function_end): Use promote_function_mode.
	* calls.c (initialize_argument_information): Use promote_function_mode.
	(precompute_arguments): Use promote_mode instead of checking if
	only PROMOTE_FUNCTION_MODE is defined.
	(expand_call): When making sibcall decisions, use promote_function_mode.
	Below, remove an if for targetm.calls.promote_function_return and
	and use promote_function_mode.
	(emit_library_call_value_1): Use promote_function_mode, fix bug
	where promote_mode was passed FOR_CALL == 0 for a return value in an
	assertion.
	* cfgexpand.c (expand_one_register_var): Use promote_decl_mode.
	* explow.c (promote_function_mode, promote_decl_mode): New.
	(promote_mode): Keep only the FOR_CALL == 0 case.
	* combine.c (setup_incoming_promotion): Remove test of
	promote_function_args.  Use promote_function_mode.
	* stmt.c (expand_value_return): Use promote_decl_mode.
	(expand_decl): Use promote_decl_mode.

	* explow.c (promote_function_mode): Just call the target hook.
	* targhooks.c (default_promote_function_mode,
	default_promote_function_mode_always_promote): New.
	* targhooks.h (default_promote_function_mode,
	default_promote_function_mode_always_promote): Declare.
	* target.h (promote_function_args, promote_function_return): Remove.
	(promote_function_mode): New.
	* target-def.h (TARGET_PROMOTE_FUNCTION_ARGS,
	TARGET_PROMOTE_FUNCTION_RETURN): Remove.
	(TARGET_PROMOTE_FUNCTION_MODE): New.
	(TARGET_CALLS): Adjust.
	* system.h (TARGET_PROMOTE_FUNCTION_ARGS,
	TARGET_PROMOTE_FUNCTION_RETURN, PROMOTE_FUNCTION_MODE): Poison.

	* config/s390/s390.h (PROMOTE_FUNCTION_MODE): Move...
	* config/s390/s390.c (s390_promote_function_mode): ... here,
	with pointer handling.
	(TARGET_PROMOTE_FUNCTION_MODE): Define.
	(TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Remove.

	* config/sparc/sparc.h (PROMOTE_FUNCTION_MODE): Move...
	* config/sparc/sparc.c (sparc_promote_function_mode): ... here,
	with pointer handling.
	(TARGET_PROMOTE_FUNCTION_MODE): Define.
	(TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Remove.
	
	* config/sh/sh-protos.h (sh_promote_function_mode): New.
	* config/sh/sh.c (sh_promote_function_mode): New.
	(TARGET_PROMOTE_FUNCTION_MODE): Define.
	(TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Remove.

	* config/cris/cris.h (PROMOTE_FUNCTION_MODE): Move...
	* config/cris/cris.c (cris_promote_function_mode): ... here.
	(TARGET_PROMOTE_FUNCTION_MODE): Define.
	(TARGET_PROMOTE_FUNCTION_ARGS): Remove.

	* config/mmix/mmix.h (PROMOTE_FUNCTION_MODE): Move...
	* config/mmix/mmix.c (mmix_promote_function_mode): ... here.
	(TARGET_PROMOTE_FUNCTION_MODE): Define.
	(TARGET_PROMOTE_FUNCTION_ARGS): Remove.

	* config/arm/arm.h (PROMOTE_FUNCTION_MODE): Move...
	* config/arm/arm.c (arm_promote_function_mode): ... here, without complex
	type handling.
	(TARGET_PROMOTE_FUNCTION_MODE): Define.
	(TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Remove.

	* config/pa/pa.c (pa_promote_function_mode): New.
	(TARGET_PROMOTE_FUNCTION_MODE): Define.
	(TARGET_PROMOTE_FUNCTION_RETURN): Remove.

	* config/alpha/alpha.c (TARGET_PROMOTE_FUNCTION_ARGS,
	TARGET_PROMOTE_FUNCTION_RETURN): Remove.
	(TARGET_PROMOTE_FUNCTION_MODE): Define equivalently.
	* config/xtensa/xtensa.c: Likewise.
	* config/stormy16/stormy16.c: Likewise.
	* config/iq2000/iq2000.c: Likewise.
	* config/rs6000/rs6000.c: Likewise.
	* config/picochip/picochip.c: Likewise.
	* config/arc/arc.c: Likewise.
	* config/mcore/mcore.c: Likewise.
	* config/score/score.c: Likewise.
	* config/mips/mips.c: Likewise.
	* config/bfin/bfin.c: Likewise.
	* config/ia64/ia64.c: Likewise (disabled though).

	* config/frv/frv.h: Remove pointless remark.

	* doc/tm.texi (PROMOTE_FUNCTION_MODE,
	TARGET_PROMOTE_FUNCTION_ARGS,
	TARGET_PROMOTE_FUNCTION_RETURN): Consolidate into...
	(TARGET_PROMOTE_FUNCTION_MODE): ... this.

From-SVN: r150336
2009-08-01 22:03:34 +00:00
Andrew MacLeod f5045c967e Add source_location support to PHI arguments.
2009-07-29  Andrew MacLeod  <amacleod@redhat.com>

	PR debug 26475
	* tree-into-ssa.c (insert_phi_nodes_for, rewrite_add_phi_arguments): Set
	location for phi arguments.
	(rewrite_update_phi_arguments): Find locations for reaching defs.
	* tree-ssa-threadupdate.c (create_edge_and_update_destination_phis):
	Add location to add_phi_arg calls.
	* tree-loop-districbution.c (update_phis_for_loop_copy): Add locations.
	* tree-ssa-loop-manip.c (create_iv, add_exit_phis_edge,
	split_loop_exit_edge, tree_transform_and_unroll_loop): Add locations.
	* tree-tailcall.c (add_successor_phi_arg, eliminate_tail_call,
	create_tailcall_accumulator, tree_optimize_tail_calls_1): Add locations.
	* tree.h (struct phi_arg_d): Add location_t to PHI arguments.
	* tree-phinodes.c (make_phi_node): Initialize location.
	(resize_phi_node): Initialize location to UNKNOWN_LOCATION.
	(add_phi_arg): Add location parameter.
	(remove_phi_arg_num): Move location when moving phi argument.
	* omp-low.c (expand_parallel_call, expand_omp_for_static_chunk): Set 
	location.
	* tree-vect-loop-manip.c (slpeel_update_phis_for_duplicate_loop,
	slpeel_update_phi_nodes_for_guard1,
	slpeel_update_phi_nodes_for_guard2,
	slpeel_tree_duplicate_loop_to_edge_cfg, set_prologue_iterations,
	vect_loop_versioning): Set locations.
	* tree-parloops.c (create_phi_for_local_result,
	transform_to_exit_first_loop, create_parallel_loop): Add locations.
	* gimple-pretty-print.c (dump_gimple_phi): Dump lineno's if present.
	* tree-vect-loop.c (get_initial_def_for_induction,
	vect_create_epilog_for_reduction, vect_finalize_reduction): Add
	locations.
	* tree-flow-inline.h (gimple_phi_arg_location): New.  Return locus.
	(gimple_phi_arg_location_from_edge): New.  Return locus from an edge.
	(gimple_phi_arg_set_location): New.  Set locus.
	(gimple_phi_arg_has_location): New.  Check for locus.
	(redirect_edge_var_map_location): New.  Return locus from var_map.
	* tree-vect-data-refs.c (vect_setup_realignment): Set location.
	* tree-ssa-phiopt.c (conditional_replacement): Set locus when
	combining PHI arguments.
	(cond_store_replacement): Set location.
	* cfgexpand.c (gimple_assign_rhs_to_tree): Transfer locus if possible.
	* grpahite.c (add_loop_exit_phis, add_guard_exit_phis,
	scop_add_exit_phis_edge): Add locations.
	* tree-cfgcleanup.c (remove_forwarder_block,
	remove_forwarder_block_with_phi): Add locations.
	* tree-ssa-pre.c (insert_into_preds_of_block): Add locations.
	* tree-predcom.c (initialize_root_vars, initialize_root_vars_lm): Add
	locations.
	* tree-ssa-dce.c (forward_edge_to_pdom): Add locations.
	* tree-ssa.c (redirect_edge_var_map_add, ssa_redirect_edge,
	flush_pending_stmts): Add source location.
	* lambda-code.c (perfect_nestify): Maintain location stack with argument
	stack to preserve locations.
	* tree-vect-stmts.c (vectorizable_load): Add location.
	* tree-inline.c (copy_phis_for_bb): Copy locus.
	(setup_one_parameter): Add call locus to inlined parameter stmts.
	(initialize_inlined_parameters): Pass in call location as parameter
	assignment locus.
	(tree_function_versioning): Pass location to setup_one_parameter.
	* tree-ssa-phiprop.c (phiprop_insert_phi): Set locations.
	* tree-outof-ssa.c (struct _elim_graph): Add source_location vecs for
	copy and edge lists.
	(insert_partition_copy_on_edge, insert_value_copy_on_edge,
	insert_rtx_to_part_on_edge, insert_part_to_rtx_on_edge): Provide a 
	locus parameter and override the stmt default if provided.
	(new_elim_graph, clear_elim_graph, delete_elim_graph,
	elim_graph_add_edge, elim_graph_remove_succ_edge,
	FOR_EACH_ELIM_GRAPH_SUCC, FOR_EACH_ELIM_GRAPH_PRED, eliminate_build,
	elim_forward, elim_unvisited_predecessor, elim_backward, elim_create,
	eliminate_phi):  Add locus info in elimination graph for each edge and
	value copy.
	(insert_backedge_copies): Copy locus if present.
	* tree-flow.h (struct _edge_var_map): Add locus field.
	* tree-switch_conversions.c (fix_phi_nodes): Add locations.
	* tree-cfg.c (reinstall_phi_args, gimple_make_forwarder_block,
	add_phi_args_after_copy_edge, gimple_lv_adjust_loop_header_phi): Add 
	locations.
	* ipa-struct-reorg.c (make_edge_and_fix_phis_of_dest): Add locations.

From-SVN: r150267
2009-07-30 18:36:30 +00:00
Richard Guenther 0b200b806d re PR middle-end/40745 (Revision 149624 caused x86-64 failures)
2009-07-14  Richard Guenther  <rguenther@suse.de>

	PR middle-end/40745
	* cfgexpand.c (partition_stack_vars): Do not bother to update
	alias information when not optimizing.

From-SVN: r149627
2009-07-14 14:08:09 +00:00
Richard Guenther 55b34b5fd1 tree-ssa-alias.h (refs_may_alias_p_1): Declare.
2009-07-14  Richard Guenther  <rguenther@suse.de>
	Andrey Belevantsev <abel@ispras.ru>

	* tree-ssa-alias.h (refs_may_alias_p_1): Declare.
	(pt_solution_set): Likewise.
	* tree-ssa-alias.c (refs_may_alias_p_1): Export.
	* tree-ssa-structalias.c (pt_solution_set): New function.
	* final.c (rest_of_clean_state): Free SSA data structures.
	* print-rtl.c (print_decl_name): Remove.
	(print_mem_expr): Implement in terms of print_generic_expr.
	* alias.c (ao_ref_from_mem): New function.
	(rtx_refs_may_alias_p): Likewise.
	(true_dependence): Query alias-export info.
	(canon_true_dependence): Likewise.
	(write_dependence_p): Likewise.
	* tree-dfa.c (get_ref_base_and_extent): For void types leave
	size unknown.
	* emit-rtl.c (component_ref_for_mem_expr): Remove.
	(mem_expr_equal_p): Use operand_equal_p.
	(set_mem_attributes_minus_bitpos): Do not use
	component_ref_for_mem_expr.
	* cfgexpand.c (add_partitioned_vars_to_ptset): New function.
	(update_alias_info_with_stack_vars): Likewise.
	(partition_stack_vars): Call update_alias_info_with_stack_vars.
	* tree-ssa.c (delete_tree_ssa): Do not release SSA names
	explicitly nor clear stmt operands.
	Free the decl-to-pointer map.
	* tree-optimize.c (execute_free_datastructures): Do not free
	SSA data structures here.
	* tree-flow.h (struct gimple_df): Add decls_to_pointers member.
	* Makefile.in (emit-rtl.o): Add pointer-set.h dependency.
	(alias.o): Add tree-ssa-alias.h, pointer-set.h and $(TREE_FLOW_H)
	dependencies.
	(print-rtl.o): Add $(DIAGNOSTIC_H) dependency.

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

From-SVN: r149624
2009-07-14 09:59:18 +00:00
Jakub Jelinek ae58e54888 re PR target/40667 (stack frames are generated even with -fomit-frame-pointer)
PR rtl-optimization/40667
	* defaults.h (MINIMUM_ALIGNMENT): Define if not defined.
	* doc/tm.texi (MINIMUM_ALIGNMENT): Document it.
	* config/i386/i386.h (MINIMUM_ALIGNMENT): Define.
	* config/i386/i386.c (ix86_minimum_alignment): New function.
	* config/i386/i386-protos.h (ix86_minimum_alignment): New prototype.
	* cfgexpand.c (expand_one_var): Use MINIMIM_ALIGNMENT.
	* emit-rtl.c (gen_reg_rtx): Likewise.
	* function.c (assign_parms): Likewise.  If nominal_type needs
	bigger alignment than FUNCTION_ARG_BOUNDARY, use its alignment
	rather than passed_type's alignment.

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

From-SVN: r148442
2009-06-12 22:06:47 +00:00
Joey Ye f85882d8e1 re PR target/39146 (Unnecessary stack alignment)
gcc/

2009-06-12  Joey Ye  <joey.ye@intel.com>

	PR middle-end/39146
	* cfgexpand.c (get_decl_align_unit): Update
	max_used_stack_slot_alignment with align instead of
	stack_alignment_needed.

	* function.c (assign_stack_local_1): Update
	max_used_stack_slot_alignment with alignment_in_bits instead
	of stack_alignment_needed.
	(locate_and_pad_parm): Don't update max_used_stack_slot_alignment
	here.

gcc/testsuite/

2009-06-12  Joey Ye  <joey.ye@intel.com>
	    H.J. Lu  <hongjiu.lu@intel.com>

	PR middle-end/39146
	* gcc.target/i386/stackalign/pr39146.c: New.

From-SVN: r148428
2009-06-12 05:54:30 -07:00
Michael Matz eb7adebcd8 re PR debug/40012 (Revision 146817 generated bad debug info for local variables)
PR debug/40012

        * cfgexpand.c (set_rtl): Store place also in DECL_RTL, if all
        partitions use the same.
        (expand_one_var): Deal with DECL_RTL sometimes begin set also
        for basevars of SSA_NAMEs.
        (expand_used_vars): Reset TREE_USED for basevars of SSA_NAMEs,
        to not expand them twice.
        (gimple_expand_cfg): Clear DECL_RTL for those decls that have
        multiple places.

From-SVN: r148273
2009-06-08 11:37:12 +00:00
Richard Guenther 6f11d6900d cfgexpand.c (discover_nonconstant_array_refs_r): Make only non-BLKmode arrays addressable.
2009-06-03  Richard Guenther  <rguenther@suse.de>
            Andrey Belevantsev  <abel@ispras.ru>

        * cfgexpand.c (discover_nonconstant_array_refs_r): Make only
        non-BLKmode arrays addressable.


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

From-SVN: r148130
2009-06-03 18:33:31 +04:00
Alexandre Oliva fe8a77795a cfgexpand.c (gimple_expand_cfg): Discard the source location only for builtins that are not overridden.
* cfgexpand.c (gimple_expand_cfg): Discard the source location
only for builtins that are not overridden.

From-SVN: r148078
2009-06-02 08:10:53 +00:00
Richard Guenther 4d7a65ea61 re PR tree-optimization/38964 (TBAA side-effects of C++ new still missing)
2009-05-22  Richard Guenther  <rguenther@suse.de>

	PR middle-end/38964
	* alias.c (write_dependence_p): Do not use TBAA for answering
	anti-dependence or output-dependence.
	* tree-ssa-structalias.c (set_uids_in_ptset): Remove TBAA pruning
	code.
	(emit_pointer_definition): Remove.
	(emit_alias_warning): Likewise.
	(find_what_var_points_to): Remove TBAA pruning code.
	(find_what_p_points_to): Likewise.  Do not warn about strict-aliasing
	violations.
	(compute_points_to_sets): Remove code computing the set of
	dereferenced pointers.
	* tree-data-ref.c (dr_may_alias_p): Properly use the split
	oracle for querying anti and output dependencies.
	* tree-ssa-alias.c (refs_may_alias_p_1): Add argument specifying
	if TBAA may be applied.
	(refs_anti_dependent_p): New function.
	(refs_output_dependent_p): Likewise.
	* tree-ssa-alias.h (refs_anti_dependent_p): Declare.
	(refs_output_dependent_p): Likewise.

	* doc/tree-ssa.texi (Memory model): New section.

	testsuite/
	* g++.dg/warn/Wstrict-aliasing-float-ref-int-obj.C: XFAIL.
	* gcc.dg/Wstrict-aliasing-converted-assigned.c: Likewise.
	* gcc.dg/Wstrict-aliasing-float-ptr-int-obj.c: Likewise.

	* doc/c-tree.texi (CHANGE_DYNAMIC_TYPE_EXPR): Remove.
	* doc/gimple.texi (GIMPLE_CHANGE_DYNAMIC_TYPE): Remove.

	* cfgexpand.c (expand_gimple_basic_block): Do not handle
	GIMPLE_CHANGE_DYNAMIC_TYPE or CHANGE_DYNAMIC_TYPE_EXPR.
	* expr.c (expand_expr_real_1): Likewise.
	* gimple-low.c (lower_stmt): Likewise.
	* gimple-pretty-print.c (dump_gimple_stmt): Likewise.
	(dump_gimple_cdt): Remove.
	* gimple.c (gss_for_code): Do not handle GIMPLE_CHANGE_DYNAMIC_TYPE.
	(gimple_size): Likewise.
	(walk_gimple_op): Likewise.
	(is_gimple_stmt): Likewise.
	(walk_stmt_load_store_addr_ops): Likewise.
	(gimple_build_cdt): Remove.
	* gimple.def (GIMPLE_CHANGE_DYNAMIC_TYPE): Remove.
	* gimple.h (gimple_cdt_new_type): Remove.
	(gimple_cdt_new_type_ptr): Likewise.
	(gimple_cdt_set_new_type): Likewise.
	(gimple_cdt_location): Likewise.
	(gimple_cdt_location_ptr): Likewise.
	(gimple_cdt_set_location): Likewise.
	* gimplify.c (gimplify_expr): Do not handle CHANGE_DYNAMIC_TYPE_EXPR.
	* tree-cfg.c (remove_useless_stmts_1): Do not handle
	GIMPLE_CHANGE_DYNAMIC_TYPE.
	(verify_types_in_gimple_stmt): Likewise.
	* tree-inline.c (estimate_num_insns): Likewise.
	(expand_call_inline): Do not copy DECL_NO_TBAA_P.
	(copy_decl_to_var): Likewise.
	(copy_result_decl_to_var): Likewise.
	* tree-pretty-print.c (dump_generic_node): Do not handle
	CHANGE_DYNAMIC_TYPE_EXPR.
	* tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise.
	* tree-ssa-operands.c (get_expr_operands): Likewise.
	* tree-ssa-structalias.c (struct variable_info): Remove
	no_tbaa_pruning member.
	(new_var_info): Do not set it based on DECL_NO_TBAA_P.
	(unify_nodes): Do not copy it.
	(find_func_aliases): Do not handle GIMPLE_CHANGE_DYNAMIC_TYPE.
	(dump_solution_for_var): Do not dump no_tbaa_pruning state.
	(set_uids_in_ptset): Do not check it.
	(find_what_var_points_to): Likewise.
	(compute_tbaa_pruning): Remove.
	(compute_points_to_sets): Do not call it.
	* tree.c (walk_tree_1): Do not handle CHANGE_DYNAMIC_TYPE_EXPR.
	* tree.def (CHANGE_DYNAMIC_TYPE_EXPR): Remove.
	* tree.h (CHANGE_DYNAMIC_TYPE_NEW_TYPE): Remove.
	(CHANGE_DYNAMIC_TYPE_LOCATION): Likewise.
	(DECL_NO_TBAA_P): Likewise.
	(struct tree_decl_common): Move no_tbaa_flag to unused flags section.
	* omp-low.c (copy_var_decl): Do not copy DECL_NO_TBAA_P.
	(expand_omp_atomic_pipeline): Do not set it.
	* print-tree.c (print_node): Do not dump it.
	* tree-ssa-copyrename.c (copy_rename_partition_coalesce): Remove
	redundant check.

	cp/
	* init.c (avoid_placement_new_aliasing): Remove.
	(build_new_1): Do not call it.

From-SVN: r147805
2009-05-22 20:41:31 +00:00
Michael Matz 529ff44101 re PR middle-end/40021 (Revision 146817 miscompiled DAXPY in BLAS)
PR middle-end/40021
        * cfgexpand.c (maybe_cleanup_end_of_block): New static function.
        (expand_gimple_cond): Use it to cleanup CFG and superfluous jumps.

        * gfortran.dg/pr40021.f: New test.

From-SVN: r147186
2009-05-06 16:49:13 +00:00
Michael Matz e97809c61d ssaexpand.h (struct ssaexpand): Member 'values' is a bitmap.
* ssaexpand.h (struct ssaexpand): Member 'values' is a bitmap.
	(get_gimple_for_ssa_name): Adjust, lookup using SSA_NAME_DEF_STMT.
	* tree-ssa-live.h: (find_replaceable_exprs): Return a bitmap.
	(dump_replaceable_exprs): Take a bitmap.
	* cfgexpand.c (gimple_cond_pred_to_tree): Handle bitmap instead of
	array.
	(expand_gimple_basic_block): Likewise.
	* tree-ssa-ter.c (struct temp_expr_table_d): Make
	replaceable_expressions member a bitmap.
	(free_temp_expr_table): Pass back and deal with bitmap, not gimple*.
	(mark_replaceable): Likewise.
	(find_replaceable_in_bb, dump_replaceable_exprs): Likewise.
	* tree-outof-ssa.c (remove_ssa_form): 'values' is a bitmap.

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

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

testsuite/

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

From-SVN: r146817
2009-04-26 19:35:04 +00:00
H.J. Lu 2ac26e152e re PR middle-end/39315 (Unaligned move used on aligned stack variable)
gcc/

2009-03-27  H.J. Lu  <hongjiu.lu@intel.com>

	PR middle-end/39315
	* cfgexpand.c (expand_one_stack_var_at): Change alignment
	limit to MAX_SUPPORTED_STACK_ALIGNMENT.

gcc/testsuite/

2009-03-27  H.J. Lu  <hongjiu.lu@intel.com>

	PR middle-end/39315
	* gcc.target/i386/pr39315-1.c: New.
	* gcc.target/i386/pr39315-2.c: Likewise.
	* gcc.target/i386/pr39315-3.c: Likewise.
	* gcc.target/i386/pr39315-4.c: Likewise.
	* gcc.target/i386/pr39315-check.c: Likewise.

From-SVN: r145138
2009-03-27 15:37:39 -07:00
Jakub Jelinek 9bfaf89d4f re PR target/39137 (-mpreferred-stack-boundary=2 causes lots of dynamic realign)
PR target/39137
	* cfgexpand.c (get_decl_align_unit): Use LOCAL_DECL_ALIGNMENT
	macro.
	* defaults.h (LOCAL_DECL_ALIGNMENT): Define if not yet defined.
	* config/i386/i386.h (LOCAL_DECL_ALIGNMENT): Define.
	* config/i386/i386.c (ix86_local_alignment): For
	-m32 -mpreferred-stack-boundary=2 use 32-bit alignment for
	long long variables on the stack to avoid dynamic realignment.
	Allow the first argument to be a decl rather than type.
	* doc/tm.texi (LOCAL_DECL_ALIGNMENT): Document.

	* gcc.target/i386/stackalign/longlong-1.c: New test.
	* gcc.target/i386/stackalign/longlong-2.c: New test.

From-SVN: r144792
2009-03-11 22:12:33 +01:00
Jakub Jelinek 66647d441f Update Copyright years for files modified in 2008 and/or 2009.
From-SVN: r144324
2009-02-20 16:20:38 +01:00
Richard Guenther b5c3dfbbfb re PR middle-end/38503 (warnings from -isystem headers strikes back.)
2009-01-27  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/38503
	* cfgexpand.c (expand_gimple_basic_block): Ignore
	GIMPLE_CHANGE_DYNAMIC_TYPE during expansion.
	* tree-ssa-structalias.c (set_uids_in_ptset): Do not prune
	variables that cannot have TBAA applied.
	(compute_points_to_sets): Do not remove GIMPLE_CHANGE_DYNAMIC_TYPE
	statements.

	* g++.dg/warn/Wstrict-aliasing-bogus-placement-new.C: New testcase.

From-SVN: r143700
2009-01-27 10:42:59 +00:00
H.J. Lu e939805b7b re PR middle-end/37843 (unaligned stack in main due to tail call optimization)
gcc/

2009-01-15  H.J. Lu  <hongjiu.lu@intel.com>
	    Joey Ye  <joey.ye@intel.com>

	PR middle-end/37843
	* cfgexpand.c (expand_stack_alignment): Don't update stack
	boundary nor check incoming stack boundary here.
	(gimple_expand_cfg): Update stack boundary and check incoming
	stack boundary here.

gcc/testsuite/

2009-01-15  H.J. Lu  <hongjiu.lu@intel.com>

	PR middle-end/37843
	* gcc.target/i386/pr37843-3.c: Replace _Decimal128 with __m128.

Co-Authored-By: Joey Ye <joey.ye@intel.com>

From-SVN: r143400
2009-01-15 07:44:41 -08:00
Steven Bosscher b5a430f346 re PR middle-end/38584 (Inline heuristics run even at -O0)
PR middle-end/38584
	* cfgexpand.c (estimate_stack_frame_size): Simplify the estimate:
	Calculate the size of all stack vars assuming no packing of stack
	vars will happen, replacing a quadratic algorithm with a linear one.

From-SVN: r143040
2009-01-04 00:15:08 +00:00
Jakub Jelinek 7787b4aa9b cfgexpand.c (expand_gimple_cond): Convert also goto_block and goto_locus of true_edge into RTL locator.
* cfgexpand.c (expand_gimple_cond): Convert also goto_block and
	goto_locus of true_edge into RTL locator.

From-SVN: r140986
2008-10-08 22:49:23 +02:00
Jakub Jelinek 7241571ec8 re PR middle-end/29609 (Even with -O0 -g gcc optimizes a goto away and I cannot debug)
PR debug/29609
	PR debug/36690
	PR debug/37616
	* basic-block.h (struct edge_def): Add goto_block field.
	* cfglayout.c (fixup_reorder_chain): Ensure that there is at least
	one insn with locus corresponding to edge's goto_locus if !optimize.
	* profile.c (branch_prob): Copy edge's goto_block.
	* cfgrtl.c (force_nonfallthru_and_redirect): Use goto_locus for
	emitted jumps.
	(cfg_layout_merge_blocks): Emit a nop with edge's goto_locus
	locator in between the merged basic blocks if !optimize and needed.
	* cfgexpand.c (expand_gimple_cond): Convert goto_block and
	goto_locus into RTL locator.  For unconditional jump use that
	locator for the jump insn.
	(expand_gimple_cond): Convert goto_block and goto_locus into
	RTL locator for all remaining edges.  For unconditional jump
	use that locator for the jump insn.
	* cfgcleanup.c (try_forward_edges): Avoid the optimization if
	there is more than one edge or insn locator along the forwarding
	edges and !optimize.  If there is just one, set e->goto_locus.
	* tree-cfg.c (make_cond_expr_edges, make_goto_expr_edges): Set also
	edge's goto_block.
	(move_block_to_fn): Adjust edge's goto_block.

	* gcc.dg/debug/pr29609-1.c: New test.
	* gcc.dg/debug/pr29609-2.c: New test.
	* gcc.dg/debug/pr36690-1.c: New test.
	* gcc.dg/debug/pr36690-2.c: New test.
	* gcc.dg/debug/pr36690-3.c: New test.
	* gcc.dg/debug/pr37616.c: New test.
	* gcc.dg/debug/dwarf2/pr29609-1.c: New test.
	* gcc.dg/debug/dwarf2/pr29609-2.c: New test.
	* gcc.dg/debug/dwarf2/pr36690-1.c: New test.
	* gcc.dg/debug/dwarf2/pr36690-2.c: New test.
	* gcc.dg/debug/dwarf2/pr36690-3.c: New test.
	* gcc.dg/debug/dwarf2/pr37616.c: New test.

From-SVN: r140948
2008-10-07 20:48:40 +02:00
Jakub Jelinek 802e9f8e7c re PR debug/34037 (Bounds for VLAs not emitted into debuginfo)
PR debug/34037
	* gimplify.c (gimplify_type_sizes): When not optimizing, ensure
	TYPE_MIN_VALUE and TYPE_MAX_VALUE is not is not DECL_IGNORED_P
	VAR_DECL.
	* cfgexpand.c (expand_used_vars): Keep DECL_ARTIFICIAL
	!DECL_IGNORED_P vars in local_decls list for instantiate_decls,
	ggc_free other TREE_LIST nodes from that chain.
	* function.c (instantiate_decls): Instantiate also DECL_RTL
	of vars in cfun->local_decls, free that list afterwards.

From-SVN: r140459
2008-09-18 17:17:10 +02:00
Aldy Hernandez 1751ecd619 function.h (struct function): Add function_start_locus.
* function.h (struct function): Add function_start_locus.
        * cfgexpand.c (gimple_expand_cfg): Use it.
        * c-parser.c (c_parser_declaration_or_fndef): Set it.
testsuite/
        * gcc.dg/always_inline.c: Place error message on function
        name line.
        * gcc.dg/winline-6.c: Same.
        * gcc.dg/noreturn-1.c: Same.
        * gcc.dg/noreturn-7.c: Same.
        * gcc.dg/inline-14.c: Same.
        * gcc.dg/always_inline3.c: Same.
        * gcc.dg/winline-3.c: Same.
        * gcc.dg/wtr-func-def-1.c: Same.
        * gcc.dg/winline-5.c: Same.
        * gcc.dg/winline-7.c: Same.
        * gcc.dg/winline-9.c: Same.
        * gcc.dg/noreturn-4.c: Same.
        * gcc.dg/20041213-1.c: Use column numbers.

From-SVN: r140144
2008-09-09 10:56:23 +00:00
Richard Guenther 7c9577becf gimple.c (gimple_build_call_1): Deal with FUNCTION_DECL fn.
2008-08-09  Richard Guenther  <rguenther@suse.de>

	* gimple.c (gimple_build_call_1): Deal with FUNCTION_DECL fn.
	* gimple.h (gimple_call_fn): Adjust comment.
	(gimple_call_set_fndecl): New function.
	(gimple_call_fndecl): Adjust for GIMPLE_CALL no
	longer having bare FUNCTION_DECL operand.
	(gimple_call_return_type): Likewise.
	* tree-cfg.c (verify_stmt): Verify function operand of a GIMPLE_CALL.

	* value-prof.c (gimple_divmod_fixed_value): Do not emit labels.
	(gimple_mod_pow2): Likewise.
	(gimple_mod_subtract): Likewise.
	(gimple_ic): Likewise.
	(gimple_stringop_fixed_value): Likewise.
	(gimple_indirect_call_to_profile): Fix for GIMPLE_CALL no
	longer having bare FUNCTION_DECL operand.
	* ipa-cp.c (ipcp_update_callgraph): Use gimple_call_set_fndecl.
	* omp-low.c (optimize_omp_library_calls): Likewise.
	* cgraphunit.c (update_call_expr): Likewise.
	* tree-ssa-math-opts.c (execute_cse_reciprocals): Likewise.
	(execute_convert_to_rsqrt): Likewise.
	* cfgexpand.c (gimple_to_tree): Simplify.
	(release_stmt_tree): Fix for GIMPLE_CALL no longer having
	bare FUNCTION_DECL operand.
	* tree-nested.c (init_tmp_var_with_call): Use gimple_call_return_type.
	(convert_gimple_call): Use gimple_call_fndecl.
	* c-common.c (c_warn_unused_result): Likewise.

	* gcc.dg/tree-ssa/inline-2.c: New testcase.

From-SVN: r138907
2008-08-09 17:28:39 +00:00
Kaveh R. Ghazi 82d6e6fc38 builtins.c (expand_builtin_profile_func): Avoid C++ keywords.
* builtins.c (expand_builtin_profile_func): Avoid C++ keywords.
	* calls.c (avoid_likely_spilled_reg): Likewise.
	* cfgexpand.c (gimple_assign_rhs_to_tree): Likewise.
	* cgraph.c (cgraph_clone_edge, cgraph_clone_node): Likewise.
	* config/i386/i386.c (ix86_expand_special_args_builtin,
	ix86_secondary_reload): Likewise.
	* except.c (struct eh_region, gen_eh_region_catch,
	remove_unreachable_regions, duplicate_eh_regions,
	assign_filter_values, build_post_landing_pads,
	sjlj_find_directly_reachable_regions, remove_eh_handler,
	reachable_next_level, foreach_reachable_handler,
	can_throw_internal_1, can_throw_external_1,
	collect_one_action_chain): Likewise.
	* expr.c (expand_expr_real_1, vector_mode_valid_p): Likewise.
	* fold-const.c (twoval_comparison_p, eval_subst): Likewise.
	* function.c (update_temp_slot_address, instantiate_new_reg,
	instantiate_virtual_regs_in_rtx,
	instantiate_virtual_regs_in_insn): Likewise.
	* gimple.c (extract_ops_from_tree, gimple_seq_copy): Likewise.
	* gimplify.c (gimplify_call_expr, gimplify_init_constructor,
	gimplify_cleanup_point_expr): Likewise.
	* ipa-cp.c (ipcp_lattice_changed): Likewise.
	* passes.c (next_pass_1): Likewise.
	* print-tree.c (print_node_brief, print_node): Likewise.
	* profile.c (branch_prob): Likewise.
	* tree-dump.c (dump_register): Likewise.
	* tree-eh.c (replace_goto_queue_cond_clause, lower_catch):
	Likewise.
	* tree-inline.c (remap_ssa_name, remap_type_1, remap_blocks,
	copy_statement_list, remap_gimple_op_r, copy_tree_body_r,
	copy_edges_for_bb, copy_cfg_body, copy_tree_r,
	copy_arguments_for_versioning, copy_static_chain): Likewise.
	* tree-into-ssa.c (names_replaced_by, add_to_repl_tbl,
	add_new_name_mapping, register_new_name_mapping): Likewise.
	* tree-mudflap.c (mf_xform_derefs): Likewise.
	* tree-predcom.c (struct chain, dump_chain, replace_ref_with,
	get_init_expr, combine_chains): Likewise.
	* tree-pretty-print.c (dump_generic_node): Likewise.
	* tree-ssa-structalias.c (create_variable_info_for): Likewise.
	* tree-vrp.c (simplify_cond_using_ranges): Likewise.
	* tree.c (substitute_in_expr, iterative_hash_expr): Likewise.
	* value-prof.c (gimple_duplicate_stmt_histograms): Likewise.

From-SVN: r138809
2008-08-06 15:57:09 +00:00
H.J. Lu e94a448f66 re PR middle-end/37009 (No need to align stack when incoming stack is aligned)
gcc/

2008-08-06  H.J. Lu  <hongjiu.lu@intel.com>

	PR middle-end/37009
	* cfgexpand.c (expand_stack_alignment): Check parm_stack_boundary
	for incoming stack boundary.

	* function.c (assign_parm_find_entry_rtl): Update
	parm_stack_boundary.

	* function.h (rtl_data): Add parm_stack_boundary.

	* config/i386/i386.c (ix86_finalize_stack_realign_flags): Check
	parm_stack_boundary for incoming stack boundary.

gcc/testsuite/

2008-08-06  H.J. Lu  <hongjiu.lu@intel.com>

	PR middle-end/37009
	* gcc.dg/torture/stackalign/alloca-2.c: New.
	* gcc.dg/torture/stackalign/alloca-3.c: Likewise.
	* gcc.dg/torture/stackalign/alloca-4.c: Likewise.
	* gcc.dg/torture/stackalign/vararg-3.c: Likewise.
	* gcc.target/i386/incoming-1.c: Likewise.
	* gcc.target/i386/incoming-2.c: Likewise.
	* gcc.target/i386/incoming-3.c: Likewise.
	* gcc.target/i386/incoming-4.c: Likewise.
	* gcc.target/i386/incoming-5.c: Likewise.

From-SVN: r138806
2008-08-06 08:29:37 -07:00
H.J. Lu d015f7cc65 cfgexpand.c (expand_stack_alignment): Assert that stack_realign_drap and drap_rtx must match.
2008-08-01  H.J. Lu  <hongjiu.lu@intel.com>

	* cfgexpand.c (expand_stack_alignment): Assert that
	stack_realign_drap and drap_rtx must match.

	* function.c (instantiate_new_reg): If DRAP is used to realign
	stack, replace virtual_incoming_args_rtx with internal arg
	pointer.

From-SVN: r138524
2008-08-01 09:05:50 -07:00
H.J. Lu d2d93c32dc re PR debug/36977 (Incorrect debug info for stack variables with stack alignment)
2008-07-31  H.J. Lu  <hongjiu.lu@intel.com>

	PR debug/36977
	* cfgexpand.c (expand_stack_alignment): Set stack_realign_tried.

	* dwarf2out.c (based_loc_descr): Check crtl->stack_realign_tried
	for stack alignment.

	* function.h (rtl_data): Add stack_realign_tried.  Update
	comments.

From-SVN: r138438
2008-07-31 14:28:54 -07:00
H.J. Lu 2e3f842fe6 [multiple changes]
2008-07-30  Joey Ye  <joey.ye@intel.com>
	    H.J. Lu  <hongjiu.lu@intel.com>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	* doc/extend.texi: Update force_align_arg_pointer.

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

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

From-SVN: r138335
2008-07-30 12:20:43 -07:00
Jan Hubicka bf08ebebc7 predict.c (always_optimize_for_size_p): New function.
* predict.c (always_optimize_for_size_p): New function.
	(optimize_bb_for_size_p, optimize_bb_for_speed_p,
	optimize_edge_for_size_p, optimize_edge_for_speed_p,
	optimize_insn_for_size_p, optimize_insn_for_speed_p): New global
	functions.
	(rtl_profile_for_bb, rtl_profile_for_edge, rtl_default_profile): New.
	* function.c (prepare_function_start): Set default profile.
	* function.h (rtl_data): Add maybe_hot_insn_p.
	* cfgexpand.c (expand_gimple_basic_block): Set RTL profile.
	(construct_exit_block): Likewise.
	(tree_expand_cfg): Likewise.
	* basic-block.h
	(optimize_bb_for_size_p, optimize_bb_for_speed_p,
	optimize_edge_for_size_p, optimize_edge_for_speed_p,
	optimize_insn_for_size_p, optimize_insn_for_speed_p): Declare.
	(rtl_profile_for_bb, rtl_profile_for_edge, default_rtl_profile):
	Declare.

From-SVN: r138237
2008-07-29 10:52:16 +00: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
Jan Hubicka 7e8b322aa0 cgraphbuild.c (record_reference): Drop non-unit-at-a-time code.
* cgraphbuild.c (record_reference): Drop non-unit-at-a-time code.
	(build_cgraph_edges): Likewise.
	* cgraph.c (cgraph_node): Do not update assembler hash.
	(cgraph_remove_node): Drop non-unit-at-a-time code.
	* tree-pass.h (pass_O0_always_inline): Remove.
	* ipa-reference.c (gate_reference): Remove unit-at-a-time check.
	* toplev.c (process_options): Flag unit-at-a-time does not imply
	no section anchors.
	* cgraphunit.c: Update comments.
	(decide_is_function_needed): Drop non-unit-at-a-time mode.
	(cgraph_assemble_pending_functions): Remove.
	(cgraph_reset_node): Drop non-unit-at-a-time code.
	(cgraph_finalize_function): Likewise.
	(cgraph_analyze_function): Likewise.
	(cgraph_finalize_compilation_unit): Likewise.
	(cgraph_expand_function): Likewise.
	(cgraph_optimize): Likesise.
	(save_inline_function_body): Likewise.
	* ipa-pure-const.c (gate_pure_const): Drop flag_unit_at_a_time check.
	* tree-ssa-alias.c (maybe_be_aliased): Likewise.
	* ipa-inline.c: Update comments.
	(enum inlining_mode): remove INLINE_SPEED.
	(cgraph_clone_inlined_nodes): Drop unit-at-a-time check.
	(cgraph_mark_inline_edge): Likewise.
	(try_inline): Likewise.
	(cgraph_decide_inlining_incrementally): Likewise.
	(cgraph_gate_inlining): Remove.
	(cgraph_early_inlining): Remove flag_unit_at_a_time checks.
	(cgraph_gate_early_inlining): Likewise.
	(gate_inline_passes): Remove.
	(pass_inline_parameters, pass_ipa_inline): Remove gates.
	(cgraph_gate_O0_always_inline, cgraph_O0_always_inline, 
	pass_O0_always_inline): Remove.
	* c-pch.c (c_pch_matching): Remove -funit-at-a-time.
	* dwarf2out.c (reference_to_unused): Remove flag_unit_at_a_time check.
	* opts.c (no_unit_at_a_time_default): Remove.
	(decode_options): Remove flag_unit_at_a_time reset and warning.
	* opts.h (no_unit_at_a_time_default): Remove.
	* c-decl.c (diagnose_mismatched_decls): Do not require inline keyword
	early in GNU dialect.
	(merge_decls): Update comment; drop unit-at-a-time check.
	(finish_decl): Likewise.
	(grok_declaration): Remove flag_inline_trees code.
	(finish_functions): Return on function returning non-void on all
	statics.
	* ipa-tye-escape.c (gate_type_escape_vars): Remove.
	* cfgexpand.c (expand_one_static_var): Remove.
	(expand_one_var): Remove expand_one_static_var call.
	(expand_used_vars_for_block): Remove flag_unit_a_time check.
	* c-opts.c (c_common_post_options): Remove flag_inline_trees code
	and flag_unit_at_a-time compatibility checks.
	* varasm.c (assemble_alias): Remove flag_unit_at_a_time check.
	* tree-inline.c (flag_inline_trees): Remove.
	(inlinable_function_p): Don't check it.
	(expand_call_inline): Remove non-unit-at-a-time code.
	* tree-inline.h (flag_inline_trees): Remove.
	* tree-optimize.c (execute_early_local_optimizations): Remove
	unit-at-a-time checks.
	(tree_rest_of_compilation): Likewise.
	* combine.c (setup_incoming_promotions): Likewise.
	* tree-profile.c (tree_gen_ic_func_profiler): Likewise.
	* tree-ssa-structalias.c (delete_points_to_sets): Likewise.
	* passes.c (pass_inline_parameters): Update comments; remove
	O0_alwaysinline pass.
	(execute_one_ipa_transform_pass): Do not reset in_gimple_form.
	(execute_one_pass): Likewise.
	* i386.c (ix86_function_regparm): Remove unit-at-a-time check.
	(ix86_function_sseregparm): Likewise.
	* arm.c (arm_function_in_section_p): Likewise.
	* bfin.c (bfin_load_pic_reg, bfin_function_ok_for_sibcall): Likewise.
	* varpool.c: Update comments.
	(decide_is_variable_needed): Remove unit-at-a-time checks.
	(varpool_finalize_decl): Likewise.

	* ada/utils.c (end_subprog_body): Remove inline trees check.
	* ada/misc.c (gnat_post_options): Do not set flag_inline_trees.

	* fortran/options.c (gfc_post_options): Remove flag_unline_trees code.

	* gcc.dg/winline-4.c: Remove.
	* gcc.dg/pch/valid-3.hs: Remove.
	* gcc.dg/pch/valid-3.c: Remove.
	* g++.old-deja/g++.brendan/crash52.C: Accept returning void warning
	* g++.old-deja/g++.jason/report.C: Likewise.
	* testsuite/g++.dg/warn/pr23075.C: We get returning void warning
	instead of control flow warning.


	* cp/decl.c (duplicate_decls): Update comment and unit-at-a-time.
	(grogfndecl): Drop flag_inline_trees code.
	* cp/pt.c (instantiate_decl): Drop flag_iline_trees code.
	* cp/lex.c (cxx_init): Do not set unit-at-a-time.


	* java/decl.c: Include cgraph.h
	(end_java_method): Remove non-unit-at-a-time code.
	(java_mark_decl_local): Likewise; sanity check that we don't touch
	finalized nodes.

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

From-SVN: r137374
2008-07-02 18:01:18 +00:00
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
H.J. Lu 76fe54f07a re PR middle-end/36253 (Caller-save stack slot may not have proper alignment)
2008-05-26  H.J. Lu  <hongjiu.lu@intel.com>

	PR middle-end/36253
	* caller-save.c (insert_restore): Verify alignment of spill
	space.
	(insert_save): Likewise.

	* cfgexpand.c (LOCAL_ALIGNMENT): Removed.

	* defaults.h (LOCAL_ALIGNMENT): New. Provide default.
	(STACK_SLOT_ALIGNMENT): Likewise.

	* function.c (LOCAL_ALIGNMENT): Removed.
	(get_stack_local_alignment): New.
	(assign_stack_local): Use it.  Set alignment on stack slot.
	(assign_stack_temp_for_type): Use get_stack_local_alignment.

	* config/i386/i386.h (LOCAL_ALIGNMENT): Updated.
	(STACK_SLOT_ALIGNMENT): New.

	* config/i386/i386.c (ix86_local_alignment): Handle caller-save
	stack slot in XFmode.

	* doc/tm.texi (STACK_SLOT_ALIGNMENT): New.

From-SVN: r135927
2008-05-26 06:59:56 -07:00
Eric Botcazou e8a2a782ee cfgexpand.c (tree_expand_cfg): Zap the EH throw statement table once finished.
* cfgexpand.c (tree_expand_cfg): Zap the EH throw statement table
	once finished.

From-SVN: r135712
2008-05-21 09:22:09 +00:00
Tomas Bily 1043771b10 pa.c (reloc_needed): Use CASE_CONVERT.
* config/pa/pa.c (reloc_needed): Use CASE_CONVERT.

        * tree-cfg.c (verify_expr, verify_gimple_expr): Likewise.

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

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

        * tree-object-size.c (compute_object_offset): Likewise.

        * tree-inline.c (estimate_num_insns_1): Likewise.

        * varasm.c (const_hash_1, compare_constant, copy_constant)
        (compute_reloc_for_constant, output_addressed_constants)
        (initializer_constant_valid_p): Likewise.

        * c-omp.c (check_omp_for_incr_expr): Likewise.

        * gimplify.c (gimplify_expr): Likewise.

        * c-typeck.c (c_finish_return): Likewise.

        * tree-vectorizer.c (supportable_widening_operation)
        (supportable_narrowing_operation): Likewise.

        * c-pretty-print.c (pp_c_cast_expression, pp_c_expression):
        Likewise.

        * matrix-reorg.c (can_calculate_expr_before_stmt): Likewise.

        * expr.c (highest_pow2_factor, expand_expr_real_1): Likewise.

        * dwarf2out.c (loc_descriptor_from_tree_1, add_bound_info)
        (descr_info_loc): Likewise.

        * tree-ssa-loop-ivopts.c (may_be_nonaddressable_p): Likewise.

        * fold-const.c (operand_equal_p, make_range, extract_muldiv_1)
        (fold_unary): Likewise.

        * builtins.c (get_pointer_alignment): Likewise.

        * tree-scalar-evolution.c (interpret_rhs_modify_stmt)
        (instantiate_parameters_1): Likewise.

        * tree.c (expr_align, stabilize_reference): Likewise.

        * tree-pretty-print.c (dump_generic_node, op_prio): Likewise.

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

        * convert.c (strip_float_extensions): Use CONVERT_EXPR_P.

        * tree-ssa-threadedge.c (simplify_control_stmt_condition):
        Likewise.

        * config/alpha/alpha.c (va_list_skip_additions): Likewise.

        * c-common.c (c_alignof_expr, check_function_arguments_recurse):
        Likewise.

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

        * varasm.c (initializer_constant_valid_p, output_constant):
        Likewise.

        * tree-ssa-forwprop.c (get_prop_source_stmt, can_propagate_from)
        (forward_propagate_addr_expr_1, forward_propagate_addr_expr)
        (forward_propagate_comparison)
        (tree_ssa_forward_propagate_single_use_vars): Likewise.

        * cfgexpand.c (discover_nonconstant_array_refs_r): Likewise.

        * emit-rtl.c (component_ref_for_mem_expr)
        (set_mem_attributes_minus_bitpos): Likewise.

        * tree-ssa-phiopt.c (conditional_replacement): Likewise.

        * gimplify.c (gimplify_conversion, goa_lhs_expr_p,
        gimplify_expr): Likewise.

        * c-typeck.c (default_function_array_conversion,
        build_indirect_ref)
        (build_function_call, pointer_diff, build_compound_expr)
        (c_finish_return): Likewise.

        * tree-vect-analyze.c (vect_determine_vectorization_factor):
        Likewise.

        * matrix-reorg.c (get_inner_of_cast_expr,
        may_flatten_matrices_1): Likewise.

        * tree-ssa-ifcombine.c (recognize_single_bit_test): Likewise.

        * expr.c (is_aligning_offset): Likewise.

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

        * tree-stdarg.c (va_list_counter_bump, check_va_list_escapes)
        (check_all_va_list_escapes): Likewise.

        * tree-ssa-loop-ivopts.c (determine_base_object)
        (determine_common_wider_type): Likewise.

        * dojump.c (do_jump): Likewise.

        * tree-ssa-sccvn.c (simplify_unary_expression): Likewise.

        * tree-gimple.c (is_gimple_cast): Likewise.

        * fold-const.c (decode_field_reference, )
        (fold_sign_changed_comparison, fold_unary, fold_comparison)
        (fold_binary): Likewise.

        * tree-ssa-alias-warnings.c (find_alias_site_helper)
        (already_warned_in_frontend_p): Likewise.

        * builtins.c (get_memory_rtx, fold_builtin_next_arg): Likewise.

        * tree.c (really_constant_p, get_unwidened): Likewise.

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

        * tree-ssa-loop-im.c (rewrite_bittest): Likewise.

        * tree-vrp.c (register_edge_assert_for_2,
        register_edge_assert_for_1): Likewise.

        * tree.h (STRIP_NOPS, STRIP_SIGN_NOPS, STRIP_TYPE_NOPS): Use
        CONVERT_EXPR_P.
        (CONVERT_EXPR_P): Define.
        (CASE_CONVERT): Define.

From-SVN: r135114
2008-05-09 16:57:39 +02:00
Jan Hubicka e3b5732b21 re PR testsuite/35843 (-fdump-rtl-expand does not exist anymore)
PR testsuite/35843
	* cfgexpand.c (pass_expand): Turn into RTL pass.
	* passes.c (execute_one_pass): Do pass typechecking after execution.
	* tree-pass.h (pass_expand): Turn into RTL pass.

	* function.h (struct rtl_data): Move here fields
	accesses_prior_frames, calls_eh_return, saves_all_registers,
	has_nonlocal_goto, has_asm_statement, is_thunk,
	all_throwers_are_sibcalls, limit_stack, profile, uses_const_pool,
	uses_pic_offset_table, uses_eh_lsda, tail_call_emit,
	arg_pointer_save_area_init from struct function; turn into bool.
	(struct function): Move
	calls_eh_return, saves_all_registers, has_nonlocal_goto,
	has_asm_statement, is_thunk, all_throwers_are_sibcalls, limit_stack,
	profile, uses_const_pool, uses_pic_offset_table, uses_eh_lsda,
	tail_call_emit, arg_pointer_save_area_init
	into struct rtl_data.  Remove recursive_call_emit and gimplified flags.
	(current_function_returns_struct, current_function_returns_pcc_struct,
	current_function_calls_setjmp, current_function_calls_alloca,
	current_function_accesses_prior_frames,
	current_function_calls_eh_return, current_function_is_thunk,
	current_function_stdarg, current_function_profile,
	current_function_limit_stack, current_function_uses_pic_offset_table,
	current_function_uses_const_pool, current_function_has_nonlocal_label,
	current_function_saves_all_registers,
	current_function_has_nonlocal_goto,
	current_function_has_asm_statement): Remove accesor macros.
	* ra-conflict.c (global_conflicts): Update.
	* tree-tailcall.c (suitable_for_tail_opt_p): Update.
	(suitable_for_tail_call_opt_p): Update.
	* builtins.c (expand_builtin_return_addr): Update.
	(expand_builtin_setjmp_setup): Update.
	(expand_builtin_nonlocal_goto): Update.
	* final.c (final_start_function): Update.
	(profile_function): Update.
	(leaf_function_p): Update.
	(only_leaf_regs_used): Update.
	* df-scan.c (df_get_exit_block_use_set): Update.
	* dojump.c (clear_pending_stack_adjust): Update.
	* tree-stdarg.c (gate_optimize_stdarg): Update.
	* gimple-low.c (lower_function_body): Update.
	* global.c (compute_regsets): Update.
	(global_alloc): Update.
	* dwarf2out.c (dwarf2out_begin_prologue): Update.
	* expr.c (expand_assignment): Update.
	* dse.c (dse_step0): Update.
	(dse_step1): Update.
	* c-decl.c (store_parm_decls): Update.
	* local-alloc.c (combine_regs): Update.
	(find_free_reg): Update.
	* function.c (assign_parms_augmented_arg_list): Update.
	(assign_parm_find_data_types): Update.
	(assign_parms): Update.
	(allocate_struct_function): Update.
	(expand_function_start): Update.
	(expand_function_end): Update.
	(get_arg_pointer_save_area): Update.
	(thread_prologue_and_epilogue_insns): Update.
	(rest_of_match_asm_constraints): Update.
	* stor-layout.c (variable_size): Update.
	* gcse.c (gcse_main): Update.
	(bypass_jumps): Update.
	* gimplify.c (gimplify_function_tree): Update.
	* calls.c (emit_call_1): Update.
	(expand_call): Update.
	* bt-load.c (compute_defs_uses_and_gen): Update.
	* except.c (sjlj_assign_call_site_values): Update.
	(sjlj_emit_function_enter): Update.
	(can_throw_external): Update.
	(set_nothrow_function_flags): Update.
	(expand_builtin_unwind_init): Update.
	(expand_eh_return): Update.
	(convert_to_eh_region_ranges): Update.
	(output_function_exception_table): Update.
	* emit-rtl.c (gen_tmp_stack_mem): Update.
	* cfgexpand.c (expand_used_vars): Update.
	(tree_expand_cfg): Update.
	* cfgcleanup.c (rest_of_handle_jump): Update.
	* explow.c (allocate_dynamic_stack_space): Update.
	* varasm.c (assemble_start_function): Update.
	(force_const_mem): Update.
	(mark_constant_pool): Update.
	* tree-optimize.c (tree_rest_of_compilation): Update.
	* stack-ptr-mod.c (notice_stack_pointer_modification): Update.
	* tree-cfg.c (notice_special_calls): Update.
	(is_ctrl_altering_stmt): Update.
	(tree_can_make_abnormal_goto): Update.
	(tree_purge_dead_abnormal_call_edges): Update.
	* config/alpha/predicates.md: Update.
	* config/alpha/alpha.c (alpha_sa_mask): Update.
	(alpha_sa_size): Update.
	(alpha_does_function_need_gp): Update.
	(alpha_expand_prologue): Update.
	(alpha_start_function): Update.
	(alpha_output_function_end_prologue): Update.
	(alpha_expand_epilogue): Update.
	* config/frv/frv.c (frv_stack_info): Update.
	(frv_expand_epilogue): Update.
	* config/s390/s390.c (s390_regs_ever_clobbered): Update.
	(s390_register_info): Update.
	(s390_frame_info): Update.
	(s390_init_frame_layout): Update.
	(s390_can_eliminate): Update.
	(save_gprs): Update.
	* config/spu/spu.c (spu_split_immediate): Update.
	(need_to_save_reg): Update.
	(spu_expand_prologue): Update.
	(spu_expand_epilogue): Update.
	* config/sparc/sparc.md: Update.
	* config/sparc/sparc.c (eligible_for_return_delay): Update.
	(sparc_tls_got): Update.
	(legitimize_pic_address): Update.
	(sparc_emit_call_insn): Update.
	(sparc_expand_prologue): Update.
	(output_return): Update.
	(print_operand): Update.
	(sparc_function_ok_for_sibcall): Update.
	* config/sparc/sparc.h (EXIT_IGNORE_STACK): Update.
	* config/m32r/m32r.md: Update.
	* config/m32r/m32r.c (MUST_SAVE_RETURN_ADDR): Update.
	(m32r_compute_frame_size): Update.
	(m32r_expand_prologue): Update.
	(m32r_expand_epilogue): Update.
	(m32r_legitimize_pic_address): Update.
	* config/m32r/m32r.h (FRAME_POINTER_REQUIRED): Update.
	* config/i386/linux.h (SUBTARGET_FRAME_POINTER_REQUIRED): Update.
	* config/i386/i386.c (ix86_frame_pointer_required): Update.
	(gen_push): Update.
	(ix86_save_reg): Update.
	(ix86_compute_frame_layout): Update.
	(ix86_expand_prologue): Update.
	(ix86_expand_epilogue): Update.
	* config/sh/sh.c (output_stack_adjust): Update.
	(calc_live_regs): Update.
	(sh5_schedule_saves): Update.
	(sh_expand_prologue): Update.
	(sh_expand_epilogue): Update.
	(sh_setup_incoming_varargs): Update.
	(sh_allocate_initial_value): Update.
	(sh_get_pr_initial_val): Update.
	* config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): Update.
	* config/sh/sh.md (label:): Update.
	* config/avr/avr.c (out_movhi_mr_r): Update.
	* config/crx/crx.h (enum): Update.
	* config/xtensa/xtensa.h (along): Update.
	* config/stormy16/stormy16.c Update.
	(xstormy16_compute_stack_layout): Update.
	* config/fr30/fr30.c (MUST_SAVE_RETURN_POINTER): Update.
	(fr30_expand_prologue): Update.
	* config/cris/cris.c (cris_conditional_register_usage): Update.
	(cris_reg_saved_in_regsave_area): Update.
	(cris_initial_frame_pointer_offset): Update.
	(cris_simple_epilogue): Update.
	(cris_expand_prologue): Update.
	(cris_expand_epilogue): Update.
	(cris_expand_pic_call_address): Update.
	(cris_asm_output_symbol_ref): Update.
	(cris_asm_output_label_ref): Update.
	* config/cris/cris.md Update.
	* config/iq2000/iq2000.c (compute_frame_size): Update.
	(iq2000_expand_epilogue): Update.
	* config/mt/mt.h (save_direction): Update.
	* config/mn10300/mn10300.c (mn10300_function_value): Update.
	* config/ia64/ia64.c (ia64_compute_frame_size): Update.
	(ia64_secondary_reload_class): Update.
	* config/m68k/m68k.c (m68k_save_reg): Update.
	(m68k_expand_prologue): Update.
	(m68k_expand_epilogue): Update.
	(legitimize_pic_address): Update.
	* config/rs6000/rs6000.c (rs6000_got_register): Update.
	(first_reg_to_save): Update.
	(first_altivec_reg_to_save): Update.
	(compute_vrsave_mask): Update.
	(compute_save_world_info): Update.
	(rs6000_stack_info): Update.
	(spe_func_has_64bit_regs_p): Update.
	(rs6000_ra_ever_killed): Update.
	(rs6000_emit_eh_reg_restore): Update.
	(rs6000_emit_allocate_stack): Update.
	(rs6000_emit_prologue): Update.
	(rs6000_emit_epilogue): Update.
	(rs6000_output_function_epilogue): Update.
	(output_profile_hook): Update.
	(rs6000_elf_declare_function_name): Update.
	* config/rs6000/rs6000.h (rs6000_args): Update.
	* config/rs6000/rs6000.md: Update.
	* config/mcore/mcore.c (mcore_expand_prolog): Update.
	* config/arc/arc.c (arc_output_function_epilogue): Update.
	* config/arc/arc.h (FRAME_POINTER_REQUIRED): Update.
	* config/darwin.c (machopic_function_base_name): Update.
	* config/score/score3.c (score3_compute_frame_size): Update.
	(rpush): Update.
	(rpop): Update.
	(score3_epilogue): Update.
	* config/score/score7.c (score7_compute_frame_size): Update.
	(score7_prologue): Update.
	(score7_epilogue): Update.
	* config/score/score.h (FRAME_POINTER_REQUIRED): Update.
	* config/arm/linux-elf.h (SUBTARGET_FRAME_POINTER_REQUIRED): Update.
	* config/arm/arm.c (use_return_insn): Update.
	(require_pic_register): Update.
	(arm_load_pic_register): Update.
	(arm_compute_save_reg0_reg12_mask): Update.
	(arm_compute_save_reg_mask): Update.
	(thumb1_compute_save_reg_mask): Update.
	(output_return_instruction): Update.
	(arm_output_function_prologue): Update.
	(arm_output_epilogue): Update.
	(arm_get_frame_offsets): Update.
	(arm_expand_prologue): Update.
	(thumb_pushpop): Update.
	(thumb_exit): Update.
	(thumb1_expand_prologue): Update.
	(thumb1_expand_epilogue): Update.
	(arm_unwind_emit): Update.
	(arm_output_fn_unwind): Update.
	* config/arm/arm.h (FRAME_POINTER_REQUIRED): Update.
	* config/arm/arm.md: Update.
	* config/pa/pa.md: Update.
	* config/pa/pa.c (legitimize_pic_address): Update.
	(compute_frame_size): Update.
	(hppa_expand_prologue): Update.
	(hppa_expand_epilogue): Update.
	(borx_reg_operand): Update.
	* config/pa/pa.h (FRAME_POINTER_REQUIRED): Update.
	(HARD_REGNO_RENAME_OK): Update.
	* config/mips/mips.c (mips_global_pointer): Update.
	(mips_save_reg_p): Update.
	(mips_compute_frame_info): Update.
	(mips_frame_pointer_required): Update.
	(mips_expand_prologue): Update.
	(mips_expand_epilogue): Update.
	(mips_can_use_return_insn): Update.
	(mips_reorg_process_insns): Update.
	* config/v850/v850.c (compute_register_save_size): Update.
	* config/mmix/mmix.h (FRAME_POINTER_REQUIRED): Update.
	* config/mmix/mmix.c (along): Update.
	(mmix_expand_epilogue): Update.
	* config/bfin/bfin.c (legitimize_pic_address): Update.
	(must_save_p): Update.
	(stack_frame_needed_p): Update.
	(add_to_reg): Update.
	(bfin_expand_prologue): Update.
	* stmt.c (expand_asm_operands): Update.
	* reload1.c (reload): Update.
	(init_elim_table): Update.

From-SVN: r134682
2008-04-25 23:14:40 +00:00
Jan Hubicka cb91fab00f except.c (dw2_size_of_call_site_table, [...]): Use vector API for call_site_record.
* except.c (dw2_size_of_call_site_table,
	sjlj_size_of_call_site_table): Use vector API for call_site_record.

	* cgraphbuild.c (build_cgraph_edges): Update.
	* tree-pass.h: Update comment.
	* final.c (leaf_function_p): Update.
	(leaf_renumber_regs): Update.
	(rest_of_clean_state): Update.
	* omp-low.c (expand_omp_parallel): Update.
	* ipa-reference.c (analyze_function): Update.
	* reorg.c (find_end_label): Update.
	(optimize_skip): Update.
	(fill_simple_delay_slots): Update.
	(fill_simple_delay_slots): Update.
	(make_return_insns): Update.
	(dbr_schedule): Update.
	* gimple-low.c (record_vars_into): Update.
	* cfgbuild.c (make_edges): Update.
	* function.c (assign_stack_local): Update.
	(assign_parm_adjust_stack_rtl): Update.
	(locate_and_pad_parm): Update.
	(allocate_struct_function): Do not initialize stack_alignment_needed
	and preferred_stack_boundary here.
	(stack_protect_prologue): Update.
	(stack_protect_epilogue): Update.
	(expand_function_start): Initialize stack_alignment_needed,
	preferred_stack_boundary and max_jumptable_ents.
	(expand_function_end): Update.
	(free_after_compilation): Do not NULLify epilogue_delay_list.
	* function.h (struct rtl_data): Add stack_protect_guard,
	stack_alignment_needed,
	preferred_stack_boundary, epilogue_delay_list.
	(struct function): Remove value_histograms, stack_alignment_needed,
	preferred_stack_boundary, epilogue_delay_list, max_jumptable_ents,
	last_label_uid,
	unexpanded_var_list, stack_protect_guard.
	(current_function_epilogue_delay_list): Remove.
	* ipa-type-escape.c (analyze_function): Update.
	* gimplify.c (pop_gimplify_context): Update comment.
	* calls.c (expand_call): Update.
	(emit_library_call_value_1): Update.
	* except.c (set_nothrow_function_flags): Update.
	* cfgexpand.c (get_decl_align_unit): Update.
	(create_stack_guard): Update.
	(estimated_stack_frame_size): Update.
	(expand_used_vars): Update.
	(tree_expand_cfg): Free histogram earliers, init expansion variables.
	* explow.c (allocate_dynamic_stack_space): Update.
	* tree-ssa-live.c (remove_unused_locals): Update.
	* varasm.c (mark_constant_pool): Update.
	* tree-inline.c (remap_decls): Update.
	(initialize_cfun): Update.
	(declare_return_variable): Update.
	(inline_forbidden_p): Update.
	(expand_call_inline): Update.
	(declare_inline_vars): Update.
	(tree_function_versioning): Update.
	* tree-flow.h (value_histograms): New.
	(VALUE_HISTOGRAMS): New macro.
	* basic-block.h (control_flow_graph): Add max_jumptable_ents,
	last_label_uid.
	* tree-cfg.c (set_bb_for_stmt): Update.
	(replace_by_duplicate_decl): Update.
	(move_block_to_fn): Update.
	(new_label_mapper): Update.
	(dump_function_to_file): Update.
	* ipa-struct-reorg.c (build_data_structure): Update.
	* cfgrtl.c (print_rtl_with_bb): Update.
	* reload1.c (reload): Update.
	(reload): Update.
	* config/i386/i386.c (setup_incoming_varargs_64,
	ix86_compute_frame_layout): Update.
	* config/arc/arc.c (arc_output_function_epilogue): Update.

From-SVN: r134425
2008-04-18 05:26:12 +00:00
Paolo Bonzini 4846b4355c expr.c (expand_var): Delete it.
2008-04-02  Paolo Bonzini  <bonzini@gnu.org>

	* expr.c (expand_var): Delete it.
	* expr.h (expand_var): Delete prototype.
	* function.c (expand_function_start): Use expand_decl instead.
	* cfgexpand.c (expand_one_static_var, expand_one_var): Don't call
	langhook.

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

From-SVN: r132679
2008-02-26 16:05:24 +00:00
Peter Bergner e41b2a33b3 re PR target/34814 (SDmode function args not passed according to ABI specification)
PR target/34814
	* doc/tm.texi (TARGET_EXPAND_TO_RTL_HOOK): Document.
	(TARGET_INSTANTIATE_DECLS): Likewise.
	* target.h (expand_to_rtl_hook): New target hook.
	(instantiate_decls): Likewise.
	* function.c (instantiate_decl): Make non-static.  Rename to...
	(instantiate_decl_rtl): ... this.
	(instantiate_expr): Use instantiate_decl_rtl.
	(instantiate_decls_1): Likewise.
	(instantiate_decls): Likewise.
	(instantiate_virtual_regs: Call new instantiate_decls taget hook.
	* function.h (instantiate_decl_rtl): Add prototype.
	* cfgexpand.c (target.h): New include.
	(tree_expand_cfg): Call new expand_to_rtl_hook target hook.
	* target-def.h (TARGET_EXPAND_TO_RTL_HOOK): New define.
	(TARGET_INSTANTIATE_DECLS): Likewise.
	(TARGET_INITIALIZER): New target hooks added.
	* config/rs6000/rs6000-protos.h (rs6000_secondary_memory_needed_rtx):
	New prototype.
	* config/rs6000/rs6000.c (tree-flow.h): New include.
	(machine_function): Add sdmode_stack_slot field.
	(rs6000_alloc_sdmode_stack_slot): New function.
	(rs6000_instantiate_decls): Likewise.
	(rs6000_secondary_memory_needed_rtx): Likewise.
	(rs6000_check_sdmode): Likewise.
	(TARGET_EXPAND_TO_RTL_HOOK): Target macro defined.
	(TARGET_INSTANTIATE_DECLS): Likewise.
	(rs6000_hard_regno_mode_ok): Allow SDmode.
	(num_insns_constant): Likewise.  Handle _Decimal32 constants.
	(rs6000_emit_move): Handle SDmode.
	(function_arg_advance): Likewise.
	(function_arg): Likewise.
	(rs6000_gimplify_va_arg): Likewise.  Add special handling of
	SDmode var args for 32-bit compiles.
	(rs6000_secondary_reload_class): Handle SDmode.
	(rs6000_output_function_epilogue): Likewise.
	(rs6000_function_value): Simplify if statement.
	(rs6000_libcall_value): Likewise.
	* config/rs6000/rs6000.h (SLOW_UNALIGNED_ACCESS): Handle SDmode.
	(SECONDARY_MEMORY_NEEDED_RTX): Add define.
	* config/rs6000/dfp.md (movsd): New define_expand and splitter.
	(movsd_hardfloat): New define_insn.
	(movsd_softfloat): Likewise.
	(movsd_store): Likewise.
	(movsd_load): Likewise.
	(extendsddd2): Likewise.
	(extendsdtd2): Likewise.
	(truncddsd2): Likewise.
	(movdd_hardfloat64): Fixup comment.
	(UNSPEC_MOVSD_LOAD): New constant.
	(UNSPEC_MOVSD_STORE): Likewise.

Co-Authored-By: Janis Johnson <janis187@us.ibm.com>

From-SVN: r131869
2008-01-26 11:18:35 -06:00
Andrew Pinski f8da819086 cfgexpand.c (expand_stack_vars): Add checking to make sure that the offset of a variable is not greater than the...
2007-10-17  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        * cfgexpand.c (expand_stack_vars): Add checking to make sure
        that the offset of a variable is not greater than the size
        of the paritition.

From-SVN: r129420
2007-10-17 14:12:50 -07:00
Manuel López-Ibáñez c54092492e builtins.c (gimplify_va_arg_expr): Use inform for help message.
2007-10-17  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

	* builtins.c (gimplify_va_arg_expr): Use inform for help message.
	* toplev.c (check_global_declaration_1): Use appropriate warning
	option instead of unnamed warning.
	* stor-layout.c (layout_decl): Likewise.
	* c-typeck.c (build_conditional_expr): Likewise.
	(build_compound_expr): Fix wrong comment.
	(build_binary_op): Use appropriate warning option instead of
	unnamed warning.
	* cfgexpand.c (tree_expand_cfg): Likewise.
	* tree-optimize.c (tree_rest_of_compilation): Likewise.
	* tree-cfg.c (remove_useless_stmts_warn_notreached): Likewise.
	(execute_warn_function_return): Likewise.
	* stmt.c (warn_if_unused_value): Likewise.
cp/
	* typeck.c (build_binary_op) : Use appropriate warning option
	instead of unnamed warning.

From-SVN: r129393
2007-10-17 00:11:25 +00:00
Andrew Pinski 1c50a20a4f cfgexpand.c (dump_stack_var_partition): Use the correct index for the offset.
2007-09-19  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        * cfgexpand.c (dump_stack_var_partition): Use the correct
        index for the offset.

From-SVN: r128607
2007-09-19 15:16:22 -07:00
Tom Tromey 5ffeb913b1 tree-cfg.c (remove_bb): Only warn if line is non-zero.
gcc:
	* tree-cfg.c (remove_bb): Only warn if line is non-zero.
	* c-pch.c (c_common_read_pch): Restore current location after
	reading PCH file.
	* tree.c (expand_location): Update.
	(expr_filename): Changed return type.  Unified the two cases.
	(expr_lineno): Likewise.
	(annotate_with_file_line): Don't use EXPR_LINENO and EXPR_FILENAME
	as lvalues.
	* toplev.c (line_table): Changed type.
	(general_init): Update.
	(realloc_for_line_map): New function.
	(general_init): Allocate line_table using GC.
	* fix-header.c (line_table): Changed type.
	(read_scan_file): Update.
	(read_scan_file): Update.
	* c-ppoutput.c (maybe_print_line): Update.
	(print_line): Update.
	(cb_line_change): Update.
	(cb_define): Update.
	(pp_file_change): Update.
	* c-opts.c (c_common_init_options): Update.
	(finish_options): Update.
	(push_command_line_include): Update.
	* c-lex.c (cb_line_change): Update.
	(cb_def_pragma): Update.
	(cb_define): Update.
	(cb_undef): Update.
	(c_lex_with_flags): Use cpp_get_token_with_location.
	* input.h (line_table): Changed type.
	(location_from_locus): New macro.
	* tree.h (EXPR_FILENAME): No longer an lvalue.
	(EXPR_LINENO): Likewise.
	(expr_locus, set_expr_locus): Declare separately for
	USE_MAPPED_LOCATION.
	(expr_filename, expr_lineno): Changed return type.
	* gimplify.c (tree_to_gimple_tuple): Use SET_EXPR_LOCUS.
	* cfgexpand.c (expand_gimple_cond_expr): Use location_from_locus.
	(expand_gimple_basic_block): Likewise.
	* final.c (final_scan_insn): Use expanded_location.
gcc/cp:
	* decl.c (finish_function): Put return's location on line zero of
	file.
gcc/fortran:
	* scanner.c (get_file): Update.
	(load_file): Update.
	(gfc_next_char_literal): Use gfc_linebuf_linenum.
	* f95-lang.c (gfc_init): Update.
	* gfortran.h (gfc_linebuf_linenum): New macro.
gcc/java:
	* lang.c (java_post_options): Update.
	* jcf-parse.c (set_source_filename): Update.
	(give_name_to_class): Update.
	(jcf_parse): Update.
	(duplicate_class_warning): Update.
	(parse_class_file): Update.
	(java_parse_file): Update.
	* expr.c (expand_byte_code): Update.
gcc/testsuite:
	* lib/g++.exp (g++_target_compile): Use -fno-show-column.
gcc/treelang:
	* tree1.c (treelang_init): Update.
	(treelang_parse_file): Update.
	(treelang_parse_file): Update.
	(treelang_parse_file): Update.
	* lex.l: Update.
	(update_lineno_charno): Likewise.
libcpp:
	* internal.h (struct cpp_reader) <invocation_location>: New
	field.
	(struct cpp_reader) <set_invocation_location>: Likewise.
	* init.c (cpp_set_line_map): New function.
	* line-map.c (linemap_add): Use linemap's allocator.
	* include/line-map.h (GTY): Define.
	(line_map_realloc): New typedef.
	(struct line_map): Mark with GTY.
	(struct line_maps): Likewise.
	(struct line_maps) <maps>: Likewise.
	(struct line_maps) <reallocator>: New field.
	* include/symtab.h (GTY): Conditionally define.
	* include/cpplib.h (cpp_set_line_map): Declare.
	(cpp_get_token_with_location): Declare.
	* macro.c (cpp_get_token): Set invocation_location on the reader.
	(cpp_get_token_with_location): New function.

From-SVN: r128190
2007-09-06 16:24:05 +00:00
Andrew Pinski 61021c2c73 re PR middle-end/32940 (REG_POINTER attribute on DECL_ARTIFICIAL pointers)
2007-08-19  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR middle-end/32940
        * cfgexpand.c  (expand_one_register_var): Mark pointer
        DECL_ARTIFICIAL as REG_POINTER also.
        * stmt.c (expand_decl): Likewise.

From-SVN: r127634
2007-08-19 17:48:09 -07:00