gcc/
        * emit-rtl.c (last_call_insn): Strengthen return type from rtx to
        rtx_call_insn *.
        * rtl.h (is_a_helper <rtx_call_insn *>::test): New overload, accepting
        an rtx_insn *.
        (last_call_insn): Strengthen return type from rtx to
        rtx_call_insn *.
---
 gcc/emit-rtl.c |  6 +++---
 gcc/rtl.h      | 10 +++++++++-
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 5175284..39e73a2 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -3369,17 +3369,17 @@ prev_real_insn (rtx insn)
 /* Return the last CALL_INSN in the current list, or 0 if there is none.
    This routine does not look inside SEQUENCEs.  */
 
-rtx
+rtx_call_insn *
 last_call_insn (void)
 {
-  rtx insn;
+  rtx_insn *insn;
 
   for (insn = get_last_insn ();
        insn && !CALL_P (insn);
        insn = PREV_INSN (insn))
     ;
 
-  return insn;
+  return as_a_nullable <rtx_call_insn *> (insn);
 }
 
 /* Find the next insn after INSN that really does something.  This routine
diff --git a/gcc/rtl.h b/gcc/rtl.h
index e29cda3..85b725a 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -753,6 +753,14 @@ is_a_helper <rtx_call_insn *>::test (rtx rt)
 template <>
 template <>
 inline bool
+is_a_helper <rtx_call_insn *>::test (rtx_insn *insn)
+{
+  return CALL_P (insn);
+}
+
+template <>
+template <>
+inline bool
 is_a_helper <rtx_jump_table_data *>::test (rtx rt)
 {
   return JUMP_TABLE_DATA_P (rt);
@@ -2394,7 +2402,7 @@ extern rtx gen_use (rtx);
 extern rtx emit_use (rtx);
 extern rtx make_insn_raw (rtx);
 extern void add_function_usage_to (rtx, rtx);
-extern rtx last_call_insn (void);
+extern rtx_call_insn *last_call_insn (void);
 extern rtx_insn *previous_insn (rtx);
 extern rtx_insn *next_insn (rtx);
 extern rtx_insn *prev_nonnote_insn (rtx);
-- 
1.8.5.3

Reply via email to