Commit f8b23302 by David Malcolm Committed by David Malcolm

except.*: Use rtx_insn (also touches function.h)

gcc/
	* except.h (sjlj_emit_function_exit_after): Strengthen param
	"after" from rtx to rtx_insn *.  This is only called with
	result of get_last_insn (in function.c) so type-change should be
	self-contained.

	* function.h (struct rtl_eh): Strengthen field "ehr_label" from
	rtx to rtx_code_label *, and field "sjlj_exit_after" from rtx
	to rtx_insn *.  These fields are only used from except.c so this
	type-change should be self-contained to this patch.

	* except.c (emit_to_new_bb_before): Strengthen param "seq" and
	local "last" from rtx to rtx_insn *.
	(dw2_build_landing_pads): Likewise for local "seq".
	(sjlj_mark_call_sites): Likewise for locals "insn", "before", p".
	(sjlj_emit_function_enter): Strengthen param "dispatch_label" from
	rtx to rtx_code_label *.  Strengthen locals "fn_begin", "seq" from
	rtx to rtx_insn *.
	(sjlj_emit_function_exit_after): Strengthen param "after" from rtx
	to rtx_insn *.
	(sjlj_emit_function_exit): Likewise for locals "seq", "insn".
	(sjlj_emit_dispatch_table): Likewise for locals "seq", "seq2".
	(sjlj_build_landing_pads): Replace NULL_RTX with NULL when
	referring to an insn.  Strengthen local "dispatch_label" from
	rtx to rtx_code_label *.
	(set_nothrow_function_flags): Strengthen local "insn" from rtx to
	rtx_insn *.
	(expand_eh_return): Strengthen local "around_label" from
	rtx to rtx_code_label *.
	(convert_to_eh_region_ranges): Strengthen locals "iter",
	"last_action_insn", "first_no_action_insn",
	"first_no_action_insn_before_switch",
	"last_no_action_insn_before_switch", from rtx to rtx_insn *.

From-SVN: r214321
parent cff08b2b
2014-08-22 David Malcolm <dmalcolm@redhat.com> 2014-08-22 David Malcolm <dmalcolm@redhat.com>
* except.h (sjlj_emit_function_exit_after): Strengthen param
"after" from rtx to rtx_insn *. This is only called with
result of get_last_insn (in function.c) so type-change should be
self-contained.
* function.h (struct rtl_eh): Strengthen field "ehr_label" from
rtx to rtx_code_label *, and field "sjlj_exit_after" from rtx
to rtx_insn *. These fields are only used from except.c so this
type-change should be self-contained to this patch.
* except.c (emit_to_new_bb_before): Strengthen param "seq" and
local "last" from rtx to rtx_insn *.
(dw2_build_landing_pads): Likewise for local "seq".
(sjlj_mark_call_sites): Likewise for locals "insn", "before", p".
(sjlj_emit_function_enter): Strengthen param "dispatch_label" from
rtx to rtx_code_label *. Strengthen locals "fn_begin", "seq" from
rtx to rtx_insn *.
(sjlj_emit_function_exit_after): Strengthen param "after" from rtx
to rtx_insn *.
(sjlj_emit_function_exit): Likewise for locals "seq", "insn".
(sjlj_emit_dispatch_table): Likewise for locals "seq", "seq2".
(sjlj_build_landing_pads): Replace NULL_RTX with NULL when
referring to an insn. Strengthen local "dispatch_label" from
rtx to rtx_code_label *.
(set_nothrow_function_flags): Strengthen local "insn" from rtx to
rtx_insn *.
(expand_eh_return): Strengthen local "around_label" from
rtx to rtx_code_label *.
(convert_to_eh_region_ranges): Strengthen locals "iter",
"last_action_insn", "first_no_action_insn",
"first_no_action_insn_before_switch",
"last_no_action_insn_before_switch", from rtx to rtx_insn *.
2014-08-22 David Malcolm <dmalcolm@redhat.com>
* dwarf2out.c (last_var_location_insn): Strengthen this variable * dwarf2out.c (last_var_location_insn): Strengthen this variable
from rtx to rtx_insn *. from rtx to rtx_insn *.
(cached_next_real_insn): Likewise. (cached_next_real_insn): Likewise.
......
...@@ -950,9 +950,9 @@ assign_filter_values (void) ...@@ -950,9 +950,9 @@ assign_filter_values (void)
first instruction of some existing BB and return the newly first instruction of some existing BB and return the newly
produced block. */ produced block. */
static basic_block static basic_block
emit_to_new_bb_before (rtx seq, rtx insn) emit_to_new_bb_before (rtx_insn *seq, rtx insn)
{ {
rtx last; rtx_insn *last;
basic_block bb; basic_block bb;
edge e; edge e;
edge_iterator ei; edge_iterator ei;
...@@ -1021,7 +1021,7 @@ dw2_build_landing_pads (void) ...@@ -1021,7 +1021,7 @@ dw2_build_landing_pads (void)
for (i = 1; vec_safe_iterate (cfun->eh->lp_array, i, &lp); ++i) for (i = 1; vec_safe_iterate (cfun->eh->lp_array, i, &lp); ++i)
{ {
basic_block bb; basic_block bb;
rtx seq; rtx_insn *seq;
edge e; edge e;
if (lp == NULL || lp->post_landing_pad == NULL) if (lp == NULL || lp->post_landing_pad == NULL)
...@@ -1107,7 +1107,8 @@ static void ...@@ -1107,7 +1107,8 @@ static void
sjlj_mark_call_sites (void) sjlj_mark_call_sites (void)
{ {
int last_call_site = -2; int last_call_site = -2;
rtx insn, mem; rtx_insn *insn;
rtx mem;
for (insn = get_insns (); insn ; insn = NEXT_INSN (insn)) for (insn = get_insns (); insn ; insn = NEXT_INSN (insn))
{ {
...@@ -1115,7 +1116,7 @@ sjlj_mark_call_sites (void) ...@@ -1115,7 +1116,7 @@ sjlj_mark_call_sites (void)
eh_region r; eh_region r;
bool nothrow; bool nothrow;
int this_call_site; int this_call_site;
rtx before, p; rtx_insn *before, *p;
/* Reset value tracking at extended basic block boundaries. */ /* Reset value tracking at extended basic block boundaries. */
if (LABEL_P (insn)) if (LABEL_P (insn))
...@@ -1168,9 +1169,10 @@ sjlj_mark_call_sites (void) ...@@ -1168,9 +1169,10 @@ sjlj_mark_call_sites (void)
/* Construct the SjLj_Function_Context. */ /* Construct the SjLj_Function_Context. */
static void static void
sjlj_emit_function_enter (rtx dispatch_label) sjlj_emit_function_enter (rtx_code_label *dispatch_label)
{ {
rtx fn_begin, fc, mem, seq; rtx_insn *fn_begin, *seq;
rtx fc, mem;
bool fn_begin_outside_block; bool fn_begin_outside_block;
rtx personality = get_personality_function (current_function_decl); rtx personality = get_personality_function (current_function_decl);
...@@ -1248,7 +1250,7 @@ sjlj_emit_function_enter (rtx dispatch_label) ...@@ -1248,7 +1250,7 @@ sjlj_emit_function_enter (rtx dispatch_label)
the call to unwind_sjlj_unregister_libfunc if needed. */ the call to unwind_sjlj_unregister_libfunc if needed. */
void void
sjlj_emit_function_exit_after (rtx after) sjlj_emit_function_exit_after (rtx_insn *after)
{ {
crtl->eh.sjlj_exit_after = after; crtl->eh.sjlj_exit_after = after;
} }
...@@ -1256,7 +1258,7 @@ sjlj_emit_function_exit_after (rtx after) ...@@ -1256,7 +1258,7 @@ sjlj_emit_function_exit_after (rtx after)
static void static void
sjlj_emit_function_exit (void) sjlj_emit_function_exit (void)
{ {
rtx seq, insn; rtx_insn *seq, *insn;
start_sequence (); start_sequence ();
...@@ -1283,7 +1285,8 @@ sjlj_emit_dispatch_table (rtx dispatch_label, int num_dispatch) ...@@ -1283,7 +1285,8 @@ sjlj_emit_dispatch_table (rtx dispatch_label, int num_dispatch)
enum machine_mode unwind_word_mode = targetm.unwind_word_mode (); enum machine_mode unwind_word_mode = targetm.unwind_word_mode ();
enum machine_mode filter_mode = targetm.eh_return_filter_mode (); enum machine_mode filter_mode = targetm.eh_return_filter_mode ();
eh_landing_pad lp; eh_landing_pad lp;
rtx mem, seq, fc, before, exc_ptr_reg, filter_reg; rtx mem, fc, before, exc_ptr_reg, filter_reg;
rtx_insn *seq;
rtx first_reachable_label; rtx first_reachable_label;
basic_block bb; basic_block bb;
eh_region r; eh_region r;
...@@ -1341,7 +1344,8 @@ sjlj_emit_dispatch_table (rtx dispatch_label, int num_dispatch) ...@@ -1341,7 +1344,8 @@ sjlj_emit_dispatch_table (rtx dispatch_label, int num_dispatch)
for (i = 1; vec_safe_iterate (cfun->eh->lp_array, i, &lp); ++i) for (i = 1; vec_safe_iterate (cfun->eh->lp_array, i, &lp); ++i)
if (lp && lp->post_landing_pad) if (lp && lp->post_landing_pad)
{ {
rtx seq2, label; rtx_insn *seq2;
rtx label;
start_sequence (); start_sequence ();
...@@ -1455,7 +1459,7 @@ sjlj_build_landing_pads (void) ...@@ -1455,7 +1459,7 @@ sjlj_build_landing_pads (void)
num_dispatch = sjlj_assign_call_site_values (); num_dispatch = sjlj_assign_call_site_values ();
if (num_dispatch > 0) if (num_dispatch > 0)
{ {
rtx dispatch_label = gen_label_rtx (); rtx_code_label *dispatch_label = gen_label_rtx ();
int align = STACK_SLOT_ALIGNMENT (sjlj_fc_type_node, int align = STACK_SLOT_ALIGNMENT (sjlj_fc_type_node,
TYPE_MODE (sjlj_fc_type_node), TYPE_MODE (sjlj_fc_type_node),
TYPE_ALIGN (sjlj_fc_type_node)); TYPE_ALIGN (sjlj_fc_type_node));
...@@ -1483,7 +1487,7 @@ sjlj_build_landing_pads (void) ...@@ -1483,7 +1487,7 @@ sjlj_build_landing_pads (void)
align); align);
sjlj_mark_call_sites (); sjlj_mark_call_sites ();
sjlj_emit_function_enter (NULL_RTX); sjlj_emit_function_enter (NULL);
sjlj_emit_function_exit (); sjlj_emit_function_exit ();
} }
...@@ -1950,7 +1954,7 @@ can_nonlocal_goto (const_rtx insn) ...@@ -1950,7 +1954,7 @@ can_nonlocal_goto (const_rtx insn)
static unsigned int static unsigned int
set_nothrow_function_flags (void) set_nothrow_function_flags (void)
{ {
rtx insn; rtx_insn *insn;
crtl->nothrow = 1; crtl->nothrow = 1;
...@@ -2248,7 +2252,7 @@ expand_builtin_eh_return (tree stackadj_tree ATTRIBUTE_UNUSED, ...@@ -2248,7 +2252,7 @@ expand_builtin_eh_return (tree stackadj_tree ATTRIBUTE_UNUSED,
void void
expand_eh_return (void) expand_eh_return (void)
{ {
rtx around_label; rtx_code_label *around_label;
if (! crtl->eh.ehr_label) if (! crtl->eh.ehr_label)
return; return;
...@@ -2479,18 +2483,19 @@ emit_note_eh_region_end (rtx insn) ...@@ -2479,18 +2483,19 @@ emit_note_eh_region_end (rtx insn)
static unsigned int static unsigned int
convert_to_eh_region_ranges (void) convert_to_eh_region_ranges (void)
{ {
rtx insn, iter; rtx insn;
rtx_insn *iter;
rtx_note *note; rtx_note *note;
action_hash_type ar_hash (31); action_hash_type ar_hash (31);
int last_action = -3; int last_action = -3;
rtx last_action_insn = NULL_RTX; rtx_insn *last_action_insn = NULL;
rtx last_landing_pad = NULL_RTX; rtx last_landing_pad = NULL_RTX;
rtx first_no_action_insn = NULL_RTX; rtx_insn *first_no_action_insn = NULL;
int call_site = 0; int call_site = 0;
int cur_sec = 0; int cur_sec = 0;
rtx section_switch_note = NULL_RTX; rtx section_switch_note = NULL_RTX;
rtx first_no_action_insn_before_switch = NULL_RTX; rtx_insn *first_no_action_insn_before_switch = NULL;
rtx last_no_action_insn_before_switch = NULL_RTX; rtx_insn *last_no_action_insn_before_switch = NULL;
int saved_call_site_base = call_site_base; int saved_call_site_base = call_site_base;
vec_alloc (crtl->eh.action_record_data, 64); vec_alloc (crtl->eh.action_record_data, 64);
...@@ -2557,8 +2562,8 @@ convert_to_eh_region_ranges (void) ...@@ -2557,8 +2562,8 @@ convert_to_eh_region_ranges (void)
gcc_assert (last_action != -3 gcc_assert (last_action != -3
|| (last_action_insn || (last_action_insn
== last_no_action_insn_before_switch)); == last_no_action_insn_before_switch));
first_no_action_insn_before_switch = NULL_RTX; first_no_action_insn_before_switch = NULL;
last_no_action_insn_before_switch = NULL_RTX; last_no_action_insn_before_switch = NULL;
call_site_base++; call_site_base++;
} }
/* If we'd not seen a previous action (-3) or the previous /* If we'd not seen a previous action (-3) or the previous
...@@ -2573,7 +2578,7 @@ convert_to_eh_region_ranges (void) ...@@ -2573,7 +2578,7 @@ convert_to_eh_region_ranges (void)
note = emit_note_before (NOTE_INSN_EH_REGION_BEG, note = emit_note_before (NOTE_INSN_EH_REGION_BEG,
first_no_action_insn); first_no_action_insn);
NOTE_EH_HANDLER (note) = call_site; NOTE_EH_HANDLER (note) = call_site;
first_no_action_insn = NULL_RTX; first_no_action_insn = NULL;
} }
note = emit_note_eh_region_end (last_action_insn); note = emit_note_eh_region_end (last_action_insn);
...@@ -2606,7 +2611,7 @@ convert_to_eh_region_ranges (void) ...@@ -2606,7 +2611,7 @@ convert_to_eh_region_ranges (void)
{ {
first_no_action_insn_before_switch = first_no_action_insn; first_no_action_insn_before_switch = first_no_action_insn;
last_no_action_insn_before_switch = last_action_insn; last_no_action_insn_before_switch = last_action_insn;
first_no_action_insn = NULL_RTX; first_no_action_insn = NULL;
gcc_assert (last_action == -1); gcc_assert (last_action == -1);
last_action = -3; last_action = -3;
} }
......
...@@ -252,7 +252,7 @@ typedef tree (*duplicate_eh_regions_map) (tree, void *); ...@@ -252,7 +252,7 @@ typedef tree (*duplicate_eh_regions_map) (tree, void *);
extern hash_map<void *, void *> *duplicate_eh_regions extern hash_map<void *, void *> *duplicate_eh_regions
(struct function *, eh_region, int, duplicate_eh_regions_map, void *); (struct function *, eh_region, int, duplicate_eh_regions_map, void *);
extern void sjlj_emit_function_exit_after (rtx); extern void sjlj_emit_function_exit_after (rtx_insn *);
extern eh_region gen_eh_region_cleanup (eh_region); extern eh_region gen_eh_region_cleanup (eh_region);
extern eh_region gen_eh_region_try (eh_region); extern eh_region gen_eh_region_try (eh_region);
......
...@@ -144,10 +144,10 @@ typedef struct call_site_record_d *call_site_record; ...@@ -144,10 +144,10 @@ typedef struct call_site_record_d *call_site_record;
struct GTY(()) rtl_eh { struct GTY(()) rtl_eh {
rtx ehr_stackadj; rtx ehr_stackadj;
rtx ehr_handler; rtx ehr_handler;
rtx ehr_label; rtx_code_label *ehr_label;
rtx sjlj_fc; rtx sjlj_fc;
rtx sjlj_exit_after; rtx_insn *sjlj_exit_after;
vec<uchar, va_gc> *action_record_data; vec<uchar, va_gc> *action_record_data;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment