This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH 034/236] next_cc0_user and prev_cc0_setter scaffolding
- From: David Malcolm <dmalcolm at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: David Malcolm <dmalcolm at redhat dot com>
- Date: Wed, 6 Aug 2014 13:20:13 -0400
- Subject: [PATCH 034/236] next_cc0_user and prev_cc0_setter scaffolding
- Authentication-results: sourceware.org; auth=none
- References: <1407345815-14551-1-git-send-email-dmalcolm at redhat dot com>
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.
---
gcc/emit-rtl.c | 12 ++++++------
gcc/rtl.h | 4 ++--
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 042694a..b64b276 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -3437,20 +3437,20 @@ prev_active_insn (rtx insn)
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 as_a_nullable <rtx_insn *> (XEXP (note, 0));
insn = next_nonnote_insn (insn);
if (insn && NONJUMP_INSN_P (insn) && GET_CODE (PATTERN (insn)) == SEQUENCE)
insn = XVECEXP (PATTERN (insn), 0, 0);
if (insn && INSN_P (insn) && reg_mentioned_p (cc0_rtx, PATTERN (insn)))
- return insn;
+ return as_a_nullable <rtx_insn *> (insn);
return 0;
}
@@ -3458,18 +3458,18 @@ next_cc0_user (rtx insn)
/* 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 as_a_nullable <rtx_insn *> (XEXP (note, 0));
insn = prev_nonnote_insn (insn);
gcc_assert (sets_cc0_p (PATTERN (insn)));
- return insn;
+ return as_a_nullable <rtx_insn *> (insn);
}
#endif
diff --git a/gcc/rtl.h b/gcc/rtl.h
index d519908..b4027aa 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -2418,8 +2418,8 @@ extern rtx_insn *next_real_insn (rtx);
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);
--
1.8.5.3