On Tue, 2014-08-12 at 16:01 -0600, Jeff Law wrote:
> On 08/06/14 11:19, David Malcolm wrote:
> > 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.
> OK.

Thanks; fixed up uses of as_a_nullable to safe_as_a, and committed to
trunk as r214180, having verified
bootstrap&regrtest on x86_64-unknown-linux-gnu (Fedora 20) albeit in
combination with patches 9-29, and verified that it builds standalone
with 10 targets.

Am attaching what I committed.


Index: gcc/ChangeLog
===================================================================
--- gcc/ChangeLog	(revision 214179)
+++ gcc/ChangeLog	(revision 214180)
@@ -1,5 +1,11 @@
 2014-08-19  David Malcolm  <dmalc...@redhat.com>
 
+	* emit-rtl.h (get_insns): Strengthen return type from rtx to
+	rtx_insn *, adding a checked cast for now.
+	(get_last_insn): Likewise.
+
+2014-08-19  David Malcolm  <dmalc...@redhat.com>
+
 	* rtl.h (gen_label_rtx): Strengthen return type from rtx to
 	rtx_code_label *.
 
Index: gcc/emit-rtl.h
===================================================================
--- gcc/emit-rtl.h	(revision 214179)
+++ gcc/emit-rtl.h	(revision 214180)
@@ -77,10 +77,11 @@
 
 /* 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 safe_as_a <rtx_insn *> (insn);
 }
 
 /* Specify a new insn as the first in the chain.  */
@@ -94,10 +95,11 @@
 
 /* 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 safe_as_a <rtx_insn *> (insn);
 }
 
 /* Specify a new insn as the last in the chain.  */

Reply via email to