Ultimately, the underlying fields should become rtx_insn *, but for now we
can do this with a checked cast.

Note to self:
  config/m32c/m32c.c: m32c_leaf_function_p directly manipulates
  x_first_insn and x_last_insn, using sequence_stack.

gcc/
        * emit-rtl.h (get_insns): Strengthen return type from rtx to
        rtx_insn *, adding a checked cast for now.
        (get_last_insn): Likewise.
---
 gcc/emit-rtl.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/gcc/emit-rtl.h b/gcc/emit-rtl.h
index c72c24f..f97ac49 100644
--- a/gcc/emit-rtl.h
+++ b/gcc/emit-rtl.h
@@ -74,10 +74,11 @@ extern bool need_atomic_barrier_p (enum memmodel, bool);
 
 /* Return the first insn of the current sequence or current function.  */
 
-static inline rtx
+static inline rtx_insn *
 get_insns (void)
 {
-  return crtl->emit.x_first_insn;
+  rtx insn = crtl->emit.x_first_insn;
+  return as_a_nullable <rtx_insn *> (insn);
 }
 
 /* Specify a new insn as the first in the chain.  */
@@ -91,10 +92,11 @@ set_first_insn (rtx insn)
 
 /* Return the last insn emitted in current sequence or current function.  */
 
-static inline rtx
+static inline rtx_insn *
 get_last_insn (void)
 {
-  return crtl->emit.x_last_insn;
+  rtx insn = crtl->emit.x_last_insn;
+  return as_a_nullable <rtx_insn *> (insn);
 }
 
 /* Specify a new insn as the last in the chain.  */
-- 
1.8.5.3

Reply via email to