aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgrtl.c
diff options
context:
space:
mode:
authorDehao Chen <dehao@google.com>2012-09-19 19:56:42 +0000
committerDehao Chen <dehao@gcc.gnu.org>2012-09-19 19:56:42 +0000
commit5368224f426c0dbe08a42e89d4cd18b0c8435834 (patch)
treecb527556784345ff0f9931444fd4e51652a67835 /gcc/cfgrtl.c
parent1a83e602a157b844ed98d0dab832c1240ed6bf4b (diff)
downloadgcc-5368224f426c0dbe08a42e89d4cd18b0c8435834.zip
gcc-5368224f426c0dbe08a42e89d4cd18b0c8435834.tar.gz
gcc-5368224f426c0dbe08a42e89d4cd18b0c8435834.tar.bz2
Integrate lexical block into source_location.
gcc: 2012-09-19 Dehao Chen <dehao@google.com> * toplev.c (general_init): Init block_locations. * tree.c (tree_set_block): New. (tree_block): Change to use LOCATION_BLOCK. * tree.h (TREE_SET_BLOCK): New. * final.c (reemit_insn_block_notes): Change to use LOCATION_BLOCK. (final_start_function): Likewise. * input.c (expand_location_1): Likewise. * input.h (LOCATION_LOCUS): New. (LOCATION_BLOCK): New. (IS_UNKNOWN_LOCATION): New. * fold-const.c (expr_location_or): Change to use new location. * reorg.c (emit_delay_sequence): Likewise. (try_merge_delay_insns): Likewise. * modulo-sched.c (dump_insn_location): Likewise. * lto-streamer-out.c (lto_output_location_bitpack): Likewise. * lto-cgraph.c (output_node_opt_summary): Likewise. * jump.c (rtx_renumbered_equal_p): Likewise. * ifcvt.c (noce_try_move): Likewise. (noce_try_store_flag): Likewise. (noce_try_store_flag_constants): Likewise. (noce_try_addcc): Likewise. (noce_try_store_flag_mask): Likewise. (noce_try_cmove): Likewise. (noce_try_cmove_arith): Likewise. (noce_try_minmax): Likewise. (noce_try_abs): Likewise. (noce_try_sign_mask): Likewise. (noce_try_bitop): Likewise. (noce_process_if_block): Likewise. (cond_move_process_if_block): Likewise. (find_cond_trap): Likewise. * ipa-prop.c (ipa_set_jf_constant): Likewise. (ipa_write_jump_function): Likewise. * dwarf2out.c (add_src_coords_attributes): Likewise. * expr.c (expand_expr_real): Likewise. * tree-parloops.c (create_loop_fn): Likewise. * recog.c (peep2_attempt): Likewise. * function.c (free_after_compilation): Likewise. (expand_function_end): Likewise. (set_insn_locations): Likewise. (thread_prologue_and_epilogue_insns): Likewise. * print-rtl.c (print_rtx): Likewise. * profile.c (branch_prob): Likewise. * trans-mem.c (ipa_tm_scan_irr_block): Likewise. * gimplify.c (gimplify_call_expr): Likewise. * except.c (duplicate_eh_regions_1): Likewise. * emit-rtl.c (try_split): Likewise. (make_insn_raw): Likewise. (make_debug_insn_raw): Likewise. (make_jump_insn_raw): Likewise. (make_call_insn_raw): Likewise. (emit_pattern_after_setloc): Likewise. (emit_pattern_after): Likewise. (emit_debug_insn_after): Likewise. (emit_pattern_before): Likewise. (emit_insn_before_setloc): Likewise. (emit_jump_insn_before): Likewise. (emit_call_insn_before_setloc): Likewise. (emit_call_insn_before): Likeise. (emit_debug_insn_before_setloc): Likewise. (emit_copy_of_insn_after): Likewise. (insn_locators_alloc): Remove. (insn_locators_finalize): Remove. (insn_locators_free): Remove. (set_curr_insn_source_location): Remove. (get_curr_insn_source_location): Remove. (set_curr_insn_block): Remove. (get_curr_insn_block): Remove. (locator_scope): Remove. (insn_scope): Change to use new location. (locator_location): Remove. (insn_line): Change to use new location. (locator_file): Remove. (insn_file): Change to use new location. (locator_eq): Remove. (insn_locations_init): New. (insn_locations_finalize): New. (set_curr_insn_location): New. (curr_insn_location): New. * cfgexpand.c (gimple_assign_rhs_to_tree): Change to use new location. (expand_gimple_cond): Likewise. (expand_call_stmt): Likewise. (expand_gimple_stmt_1): Likewise. (expand_gimple_basic_block): Likewise. (construct_exit_block): Likewise. (gimple_expand_cfg): Likewise. * cfgcleanup.c (try_forward_edges): Likewise. * tree-ssa-live.c (remove_unused_scope_block_p): Likewise. (dump_scope_block): Likewise. (remove_unused_locals): Likewise. * rtl.c (rtx_equal_p_cb): Likewise. (rtx_equal_p): Likewise. * rtl.h (XUINT): New. (INSN_LOCATOR): Remove. (CURR_INSN_LOCATION): Remove. (INSN_LOCATION): New. (INSN_HAS_LOCATION): New. * tree-inline.c (remap_gimple_op_r): Change to use new location. (copy_tree_body_r): Likewise. (copy_phis_for_bb): Likewise. (expand_call_inline): Likewise. * tree-streamer-in.c (lto_input_ts_exp_tree_pointers): Likewise. * tree-streamer-out.c (write_ts_decl_minimal_tree_pointers): Likewise. * gimple-streamer-out.c (output_gimple_stmt): Likewise. * combine.c (try_combine): Likewise. * tree-outof-ssa.c (set_location_for_edge): Likewise. (insert_partition_copy_on_edge): Likewise. (insert_value_copy_on_edge): Likewise. (insert_rtx_to_part_on_edge): Likewise. (insert_part_to_rtx_on_edge): Likewise. * basic-block.h (edge_def): Remove field. * gimple.h (gimple_statement_base): Remove field. (gimple_bb): Change to use new location. (gimple_set_block): Likewise. (gimple_has_location): Likewise. * tree-cfg.c (make_cond_expr_edges): Likewise. (make_goto_expr_edges): Likewise. (gimple_can_merge_blocks_p): Likewise. (move_stmt_op): Likewise. (move_block_to_fn): Likewise. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. * config/i386/i386.c (x86_output_mi_thunk): Likewise. * config/tilegx/tilegx.c (tilegx_output_mi_thunk): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/ia64/ia64.c (ia64_output_mi_thunk): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/score/score.c (score_output_mi_thunk): Likewise. * config/tilepro/tilepro.c (tilepro_asm_output_mi_thunk): Likewise. * config/mips/mips.c (mips_output_mi_thunk): Likewise. * cfgrtl.c (unique_locus_on_edge_between_p): Likewise. (unique_locus_on_edge_between_p): Likewise. (emit_nop_for_unique_locus_between): Likewise. (force_nonfallthru_and_redirect): Likewise. (fixup_reorder_chain): Likewise. (cfg_layout_merge_blocks): Likewise. * stmt.c (emit_case_nodes): Likewise. gcc/lto: 2012-09-19 Dehao Chen <dehao@google.com> * lto/lto.c (lto_fixup_prevailing_decls): Remove tree.exp.block field. libcpp: 2012-09-19 Dehao Chen <dehao@google.com> * include/line-map.h (MAX_SOURCE_LOCATION): New value. (location_adhoc_data_fini): New. (get_combined_adhoc_loc): New. (get_data_from_adhoc_loc): New. (get_location_from_adhoc_loc): New. (location_adhoc_data_map): New. (COMBINE_LOCATION_DATA): New. (IS_ADHOC_LOC): New. (expanded_location): New field. (line_maps): New field. * line-map.c (location_adhoc_data): New. (location_adhoc_data_hash): New. (location_adhoc_data_eq): New. (location_adhoc_data_update): New. (get_combined_adhoc_loc): New. (get_data_from_adhoc_loc): New. (get_location_from_adhoc_loc): New. (location_adhoc_data_init): New. (location_adhoc_data_fini): New. (linemap_init): Initialize location_adhoc_data. (linemap_lookup): Change to use new location. (linemap_ordinary_map_lookup): Likewise. (linemap_macro_map_lookup): Likewise. (linemap_macro_map_loc_to_def_point): Likewise. (linemap_macro_map_loc_unwind_toward_spel): Likewise. (linemap_get_expansion_line): Likewise. (linemap_get_expansion_filename): Likewise. (linemap_location_in_system_header_p): Likewise. (linemap_location_from_macro_expansion_p): Likewise. (linemap_macro_loc_to_spelling_point): Likewise. (linemap_macro_loc_to_def_point): Likewise. (linemap_macro_loc_to_exp_point): Likewise. (linemap_resolve_location): Likewise. (linemap_unwind_toward_expansion): Likewise. (linemap_unwind_to_first_non_reserved_loc): Likewise. (linemap_expand_location): Likewise. (linemap_dump_location): Likewise. (linemap_line_start): Likewise. From-SVN: r191494
Diffstat (limited to 'gcc/cfgrtl.c')
-rw-r--r--gcc/cfgrtl.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index 4df289d..c04482e 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -720,19 +720,19 @@ rtl_split_block (basic_block bb, void *insnp)
static bool
unique_locus_on_edge_between_p (basic_block a, basic_block b)
{
- const int goto_locus = EDGE_SUCC (a, 0)->goto_locus;
+ const location_t goto_locus = EDGE_SUCC (a, 0)->goto_locus;
rtx insn, end;
- if (!goto_locus)
+ if (IS_UNKNOWN_LOCATION (goto_locus))
return false;
/* First scan block A backward. */
insn = BB_END (a);
end = PREV_INSN (BB_HEAD (a));
- while (insn != end && (!NONDEBUG_INSN_P (insn) || INSN_LOCATOR (insn) == 0))
+ while (insn != end && (!NONDEBUG_INSN_P (insn) || !INSN_HAS_LOCATION (insn)))
insn = PREV_INSN (insn);
- if (insn != end && locator_eq (INSN_LOCATOR (insn), goto_locus))
+ if (insn != end && INSN_LOCATION (insn) == goto_locus)
return false;
/* Then scan block B forward. */
@@ -743,8 +743,8 @@ unique_locus_on_edge_between_p (basic_block a, basic_block b)
while (insn != end && !NONDEBUG_INSN_P (insn))
insn = NEXT_INSN (insn);
- if (insn != end && INSN_LOCATOR (insn) != 0
- && locator_eq (INSN_LOCATOR (insn), goto_locus))
+ if (insn != end && INSN_HAS_LOCATION (insn)
+ && INSN_LOCATION (insn) == goto_locus)
return false;
}
@@ -761,7 +761,7 @@ emit_nop_for_unique_locus_between (basic_block a, basic_block b)
return;
BB_END (a) = emit_insn_after_noloc (gen_nop (), BB_END (a), a);
- INSN_LOCATOR (BB_END (a)) = EDGE_SUCC (a, 0)->goto_locus;
+ INSN_LOCATION (BB_END (a)) = EDGE_SUCC (a, 0)->goto_locus;
}
/* Blocks A and B are to be merged into a single block A. The insns
@@ -1477,7 +1477,7 @@ force_nonfallthru_and_redirect (edge e, basic_block target, rtx jump_label)
else
jump_block = e->src;
- if (e->goto_locus && e->goto_block == NULL)
+ if (!IS_UNKNOWN_LOCATION (e->goto_locus))
loc = e->goto_locus;
else
loc = 0;
@@ -3335,7 +3335,8 @@ fixup_reorder_chain (void)
edge_iterator ei;
FOR_EACH_EDGE (e, ei, bb->succs)
- if (e->goto_locus && !(e->flags & EDGE_ABNORMAL))
+ if (!IS_UNKNOWN_LOCATION (e->goto_locus)
+ && !(e->flags & EDGE_ABNORMAL))
{
edge e2;
edge_iterator ei2;
@@ -3345,15 +3346,15 @@ fixup_reorder_chain (void)
insn = BB_END (e->src);
end = PREV_INSN (BB_HEAD (e->src));
while (insn != end
- && (!NONDEBUG_INSN_P (insn) || INSN_LOCATOR (insn) == 0))
+ && (!NONDEBUG_INSN_P (insn) || !INSN_HAS_LOCATION (insn)))
insn = PREV_INSN (insn);
if (insn != end
- && locator_eq (INSN_LOCATOR (insn), (int) e->goto_locus))
+ && INSN_LOCATION (insn) == e->goto_locus)
continue;
if (simplejump_p (BB_END (e->src))
- && INSN_LOCATOR (BB_END (e->src)) == 0)
+ && !INSN_HAS_LOCATION (BB_END (e->src)))
{
- INSN_LOCATOR (BB_END (e->src)) = e->goto_locus;
+ INSN_LOCATION (BB_END (e->src)) = e->goto_locus;
continue;
}
dest = e->dest;
@@ -3369,24 +3370,24 @@ fixup_reorder_chain (void)
end = NEXT_INSN (BB_END (dest));
while (insn != end && !NONDEBUG_INSN_P (insn))
insn = NEXT_INSN (insn);
- if (insn != end && INSN_LOCATOR (insn)
- && locator_eq (INSN_LOCATOR (insn), (int) e->goto_locus))
+ if (insn != end && INSN_HAS_LOCATION (insn)
+ && INSN_LOCATION (insn) == e->goto_locus)
continue;
}
nb = split_edge (e);
if (!INSN_P (BB_END (nb)))
BB_END (nb) = emit_insn_after_noloc (gen_nop (), BB_END (nb),
nb);
- INSN_LOCATOR (BB_END (nb)) = e->goto_locus;
+ INSN_LOCATION (BB_END (nb)) = e->goto_locus;
/* If there are other incoming edges to the destination block
with the same goto locus, redirect them to the new block as
well, this can prevent other such blocks from being created
in subsequent iterations of the loop. */
for (ei2 = ei_start (dest->preds); (e2 = ei_safe_edge (ei2)); )
- if (e2->goto_locus
+ if (!IS_UNKNOWN_LOCATION (e2->goto_locus)
&& !(e2->flags & (EDGE_ABNORMAL | EDGE_FALLTHRU))
- && locator_eq (e->goto_locus, e2->goto_locus))
+ && e->goto_locus == e2->goto_locus)
redirect_edge_and_branch (e2, nb);
else
ei_next (&ei2);
@@ -4086,7 +4087,7 @@ cfg_layout_merge_blocks (basic_block a, basic_block b)
}
/* If B was a forwarder block, propagate the locus on the edge. */
- if (forwarder_p && !EDGE_SUCC (b, 0)->goto_locus)
+ if (forwarder_p && IS_UNKNOWN_LOCATION (EDGE_SUCC (b, 0)->goto_locus))
EDGE_SUCC (b, 0)->goto_locus = EDGE_SUCC (a, 0)->goto_locus;
if (dump_file)