On Wed, 2014-08-13 at 11:55 -0600, Jeff Law wrote:
> On 08/06/14 11:20, David Malcolm wrote:
> > gcc/
> >     * rtl.h (next_cc0_user): Strengthen return type from rtx to
> >     rtx_insn *.
> >     (prev_cc0_setter): Likewise.
> >
> >     * emit-rtl.c (next_cc0_user): Strengthen return type from rtx to
> >     rtx_insn *, adding checked casts for now as necessary.
> >     (prev_cc0_setter): Likewise.
> OK.

Thanks.

Fixed up for as_a_nullable -> safe_as_a, and committed to trunk as
r214196, having bootstrapped&regrtested on x86_64-unknown-linux-gnu
(Fedora 20) albeit in combination with patches 30-39, and verified that
it builds standalone both for that target, and for pdp11-aout, the
latter to give coverage for HAVE_cc0.

Am attaching what I committed.
Index: gcc/ChangeLog
===================================================================
--- gcc/ChangeLog	(revision 214195)
+++ gcc/ChangeLog	(revision 214196)
@@ -1,5 +1,15 @@
 2014-08-19  David Malcolm  <dmalc...@redhat.com>
 
+	* rtl.h (next_cc0_user): Strengthen return type from rtx to
+	rtx_insn *.
+	(prev_cc0_setter): Likewise.
+
+	* emit-rtl.c (next_cc0_user): Strengthen return type from rtx to
+	rtx_insn *, adding checked casts for now as necessary.
+	(prev_cc0_setter): Likewise.
+
+2014-08-19  David Malcolm  <dmalc...@redhat.com>
+
 	* expr.h (emit_move_insn): Strengthen return type from rtx to
 	rtx_insn *.
 	(emit_move_insn_1): Likewise.
Index: gcc/emit-rtl.c
===================================================================
--- gcc/emit-rtl.c	(revision 214195)
+++ gcc/emit-rtl.c	(revision 214196)
@@ -3450,13 +3450,13 @@
 
    Return 0 if we can't find the insn.  */
 
-rtx
+rtx_insn *
 next_cc0_user (rtx insn)
 {
   rtx note = find_reg_note (insn, REG_CC_USER, NULL_RTX);
 
   if (note)
-    return XEXP (note, 0);
+    return safe_as_a <rtx_insn *> (XEXP (note, 0));
 
   insn = next_nonnote_insn (insn);
   if (insn && NONJUMP_INSN_P (insn) && GET_CODE (PATTERN (insn)) == SEQUENCE)
@@ -3463,7 +3463,7 @@
     insn = XVECEXP (PATTERN (insn), 0, 0);
 
   if (insn && INSN_P (insn) && reg_mentioned_p (cc0_rtx, PATTERN (insn)))
-    return insn;
+    return safe_as_a <rtx_insn *> (insn);
 
   return 0;
 }
@@ -3471,18 +3471,18 @@
 /* Find the insn that set CC0 for INSN.  Unless INSN has a REG_CC_SETTER
    note, it is the previous insn.  */
 
-rtx
+rtx_insn *
 prev_cc0_setter (rtx insn)
 {
   rtx note = find_reg_note (insn, REG_CC_SETTER, NULL_RTX);
 
   if (note)
-    return XEXP (note, 0);
+    return safe_as_a <rtx_insn *> (XEXP (note, 0));
 
   insn = prev_nonnote_insn (insn);
   gcc_assert (sets_cc0_p (PATTERN (insn)));
 
-  return insn;
+  return safe_as_a <rtx_insn *> (insn);
 }
 #endif
 
Index: gcc/rtl.h
===================================================================
--- gcc/rtl.h	(revision 214195)
+++ gcc/rtl.h	(revision 214196)
@@ -2440,8 +2440,8 @@
 extern rtx_insn *prev_active_insn (rtx);
 extern rtx_insn *next_active_insn (rtx);
 extern int active_insn_p (const_rtx);
-extern rtx next_cc0_user (rtx);
-extern rtx prev_cc0_setter (rtx);
+extern rtx_insn *next_cc0_user (rtx);
+extern rtx_insn *prev_cc0_setter (rtx);
 
 /* In emit-rtl.c  */
 extern int insn_line (const_rtx);

Reply via email to