All in-tree users of shorten_branches now pass in an rtx_insn *, so we
can eliminate the cast from rtx.

gcc/
        * output.h (shorten_branches): Strengthen param from rtx to
        rtx_insn *.

        * final.c (shorten_branches): Likewise, renaming param back from
        "uncast_first" to "first", and dropping the checked cast from rtx
        to rtx_insn *.

        * genattr.c (gen_attr): Likewise when writing out the prototype of
        shorten_branches.
---
 gcc/final.c   | 3 +--
 gcc/genattr.c | 2 +-
 gcc/output.h  | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/gcc/final.c b/gcc/final.c
index 22d75c3..0ef0bbb 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -899,9 +899,8 @@ make_pass_compute_alignments (gcc::context *ctxt)
    slots.  */
 
 void
-shorten_branches (rtx uncast_first)
+shorten_branches (rtx_insn *first)
 {
-  rtx_insn *first = as_a_nullable <rtx_insn *> (uncast_first);
   rtx_insn *insn;
   int max_uid;
   int i;
diff --git a/gcc/genattr.c b/gcc/genattr.c
index 44550c0..d2d12e0 100644
--- a/gcc/genattr.c
+++ b/gcc/genattr.c
@@ -65,7 +65,7 @@ gen_attr (rtx attr)
   if (! strcmp (XSTR (attr, 0), "length"))
     {
       puts ("\
-extern void shorten_branches (rtx);\n\
+extern void shorten_branches (rtx_insn *);\n\
 extern int insn_default_length (rtx);\n\
 extern int insn_min_length (rtx);\n\
 extern int insn_variable_length_p (rtx);\n\
diff --git a/gcc/output.h b/gcc/output.h
index 0b63737..05e7666 100644
--- a/gcc/output.h
+++ b/gcc/output.h
@@ -50,7 +50,7 @@ extern int get_attr_min_length (rtx);
 
 /* Make a pass over all insns and compute their actual lengths by shortening
    any branches of variable length if possible.  */
-extern void shorten_branches (rtx);
+extern void shorten_branches (rtx_insn *);
 
 /* Output assembler code for the start of a function,
    and initialize some of the variables in this file
-- 
1.8.5.3

Reply via email to