Commit 0926539c by David Malcolm Committed by David Malcolm

Strengthen fields in struct sequence_stack and struct emit_status

gcc/
2014-08-26  David Malcolm  <dmalcolm@redhat.com>

	* function.h (struct sequence_stack): Strengthen fields "first"
	and "last" from rtx to rtx_insn *.
	(struct emit_status): Likewise for fields "x_first_insn" and
	"x_last_insn".

	* emit-rtl.h (get_insns): Remove now-redundant checked cast.
	(set_first_insn): Add checked cast.
	(get_last_insn): Remove now-redundant checked cast.
	(set_last_insn): Add checked cast.

	* config/m32c/m32c.c (m32c_leaf_function_p): Strengthen locals
	"saved_first" and "saved_last" from rtx to rtx_insn *.

From-SVN: r214537
parent 9152e0aa
2014-08-26 David Malcolm <dmalcolm@redhat.com> 2014-08-26 David Malcolm <dmalcolm@redhat.com>
* function.h (struct sequence_stack): Strengthen fields "first"
and "last" from rtx to rtx_insn *.
(struct emit_status): Likewise for fields "x_first_insn" and
"x_last_insn".
* emit-rtl.h (get_insns): Remove now-redundant checked cast.
(set_first_insn): Add checked cast.
(get_last_insn): Remove now-redundant checked cast.
(set_last_insn): Add checked cast.
* config/m32c/m32c.c (m32c_leaf_function_p): Strengthen locals
"saved_first" and "saved_last" from rtx to rtx_insn *.
2014-08-26 David Malcolm <dmalcolm@redhat.com>
* rtl.h (add_insn): Strengthen param from rtx to rtx_insn *. * rtl.h (add_insn): Strengthen param from rtx to rtx_insn *.
(unlink_insn_chain): Strengthen both params from rtx to (unlink_insn_chain): Strengthen both params from rtx to
rtx_insn *. rtx_insn *.
......
...@@ -4045,7 +4045,7 @@ m32c_encode_section_info (tree decl, rtx rtl, int first) ...@@ -4045,7 +4045,7 @@ m32c_encode_section_info (tree decl, rtx rtl, int first)
static int static int
m32c_leaf_function_p (void) m32c_leaf_function_p (void)
{ {
rtx saved_first, saved_last; rtx_insn *saved_first, *saved_last;
struct sequence_stack *seq; struct sequence_stack *seq;
int rv; int rv;
......
...@@ -80,8 +80,7 @@ extern bool need_atomic_barrier_p (enum memmodel, bool); ...@@ -80,8 +80,7 @@ extern bool need_atomic_barrier_p (enum memmodel, bool);
static inline rtx_insn * static inline rtx_insn *
get_insns (void) get_insns (void)
{ {
rtx insn = crtl->emit.x_first_insn; return crtl->emit.x_first_insn;
return safe_as_a <rtx_insn *> (insn);
} }
/* Specify a new insn as the first in the chain. */ /* Specify a new insn as the first in the chain. */
...@@ -90,7 +89,7 @@ static inline void ...@@ -90,7 +89,7 @@ static inline void
set_first_insn (rtx insn) set_first_insn (rtx insn)
{ {
gcc_checking_assert (!insn || !PREV_INSN (insn)); gcc_checking_assert (!insn || !PREV_INSN (insn));
crtl->emit.x_first_insn = insn; crtl->emit.x_first_insn = safe_as_a <rtx_insn *> (insn);
} }
/* Return the last insn emitted in current sequence or current function. */ /* Return the last insn emitted in current sequence or current function. */
...@@ -98,8 +97,7 @@ set_first_insn (rtx insn) ...@@ -98,8 +97,7 @@ set_first_insn (rtx insn)
static inline rtx_insn * static inline rtx_insn *
get_last_insn (void) get_last_insn (void)
{ {
rtx insn = crtl->emit.x_last_insn; return crtl->emit.x_last_insn;
return safe_as_a <rtx_insn *> (insn);
} }
/* Specify a new insn as the last in the chain. */ /* Specify a new insn as the last in the chain. */
...@@ -108,7 +106,7 @@ static inline void ...@@ -108,7 +106,7 @@ static inline void
set_last_insn (rtx insn) set_last_insn (rtx insn)
{ {
gcc_checking_assert (!insn || !NEXT_INSN (insn)); gcc_checking_assert (!insn || !NEXT_INSN (insn));
crtl->emit.x_last_insn = insn; crtl->emit.x_last_insn = safe_as_a <rtx_insn *> (insn);
} }
/* Return a number larger than any instruction's uid in this function. */ /* Return a number larger than any instruction's uid in this function. */
......
...@@ -34,8 +34,8 @@ along with GCC; see the file COPYING3. If not see ...@@ -34,8 +34,8 @@ along with GCC; see the file COPYING3. If not see
struct GTY(()) sequence_stack { struct GTY(()) sequence_stack {
/* First and last insns in the chain of the saved sequence. */ /* First and last insns in the chain of the saved sequence. */
rtx first; rtx_insn *first;
rtx last; rtx_insn *last;
struct sequence_stack *next; struct sequence_stack *next;
}; };
...@@ -52,8 +52,8 @@ struct GTY(()) emit_status { ...@@ -52,8 +52,8 @@ struct GTY(()) emit_status {
start_sequence saves both of these on `sequence_stack' and then starts start_sequence saves both of these on `sequence_stack' and then starts
a new, nested sequence of insns. */ a new, nested sequence of insns. */
rtx x_first_insn; rtx_insn *x_first_insn;
rtx x_last_insn; rtx_insn *x_last_insn;
/* Stack of pending (incomplete) sequences saved by `start_sequence'. /* Stack of pending (incomplete) sequences saved by `start_sequence'.
Each element describes one pending sequence. Each element describes one pending sequence.
......
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