From 9af96a6d318bee7840a8d6da35dcac47ba52bc1c Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Tue, 7 Jan 2014 17:04:34 -0500
Subject: [PATCH 089/159] FIXME: final arg of compare_and_jump_seq

---
 gcc/loop-unroll.c   |  8 +++++---
 gcc/loop-unswitch.c | 24 ++++++++++++++----------
 gcc/rtl.h           |  3 ++-
 3 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/gcc/loop-unroll.c b/gcc/loop-unroll.c
index 16b0f8d..8318b8f 100644
--- a/gcc/loop-unroll.c
+++ b/gcc/loop-unroll.c
@@ -1096,7 +1096,9 @@ split_edge_and_insert (edge e, rtx insns)
 static void
 unroll_loop_runtime_iterations (struct loop *loop)
 {
-  rtx old_niter, niter, init_code, branch_code, tmp;
+  rtx old_niter, niter, init_code;
+  rtx_base_insn branch_code;
+  rtx tmp;
   unsigned i, j, p;
   basic_block preheader, *body, swtch, ezc_swtch;
   sbitmap wont_exit;
@@ -1213,7 +1215,7 @@ unroll_loop_runtime_iterations (struct loop *loop)
       preheader = split_edge (loop_preheader_edge (loop));
       branch_code = compare_and_jump_seq (copy_rtx (niter), GEN_INT (j), EQ,
 					  block_label (preheader), p,
-					  NULL_RTX);
+					  NULL_RTX_BASE_INSN);
 
       /* We rely on the fact that the compare and jump cannot be optimized out,
 	 and hence the cfg we create is correct.  */
@@ -1236,7 +1238,7 @@ unroll_loop_runtime_iterations (struct loop *loop)
       preheader = split_edge (loop_preheader_edge (loop));
       branch_code = compare_and_jump_seq (copy_rtx (niter), const0_rtx, EQ,
 					  block_label (preheader), p,
-					  NULL_RTX);
+					  NULL_RTX_BASE_INSN);
       gcc_assert (branch_code != NULL_RTX);
 
       swtch = split_edge_and_insert (single_succ_edge (swtch), branch_code);
diff --git a/gcc/loop-unswitch.c b/gcc/loop-unswitch.c
index 827dc44..0b4a7c4 100644
--- a/gcc/loop-unswitch.c
+++ b/gcc/loop-unswitch.c
@@ -77,19 +77,21 @@ along with GCC; see the file COPYING3.  If not see
   containing subloops would not be very large compared to complications
   with handling this case.  */
 
-static struct loop *unswitch_loop (struct loop *, basic_block, rtx, rtx);
+static struct loop *unswitch_loop (struct loop *, basic_block, rtx,
+				   rtx_base_insn);
 static bool unswitch_single_loop (struct loop *, rtx, int);
-static rtx may_unswitch_on (basic_block, struct loop *, rtx *);
+static rtx may_unswitch_on (basic_block, struct loop *, rtx_base_insn *);
 
 /* Prepare a sequence comparing OP0 with OP1 using COMP and jumping to LABEL if
    true, with probability PROB.  If CINSN is not NULL, it is the insn to copy
    in order to create a jump.  */
 
-rtx
+rtx_base_insn
 compare_and_jump_seq (rtx op0, rtx op1, enum rtx_code comp, rtx_code_label label,
-		      int prob, rtx cinsn)
+		      int prob, rtx_base_insn cinsn)
 {
-  rtx seq, jump, cond;
+  rtx_base_insn seq, jump;
+  rtx cond;
   enum machine_mode mode;
 
   mode = GET_MODE (op0);
@@ -162,7 +164,7 @@ unswitch_loops (void)
    compares loop invariant cc mode register, return the jump in CINSN.  */
 
 static rtx
-may_unswitch_on (basic_block bb, struct loop *loop, rtx *cinsn)
+may_unswitch_on (basic_block bb, struct loop *loop, rtx_base_insn *cinsn)
 {
   rtx test, at, op[2], stest;
   struct rtx_iv iv;
@@ -262,7 +264,8 @@ unswitch_single_loop (struct loop *loop, rtx cond_checked, int num)
   basic_block *bbs;
   struct loop *nloop;
   unsigned i;
-  rtx cond, rcond = NULL_RTX, conds, rconds, acond, cinsn;
+  rtx cond, rcond = NULL_RTX, conds, rconds, acond;
+  rtx_base_insn cinsn;
   int repeat;
   edge e;
   HOST_WIDE_INT iterations;
@@ -319,7 +322,7 @@ unswitch_single_loop (struct loop *loop, rtx cond_checked, int num)
   do
     {
       repeat = 0;
-      cinsn = NULL_RTX;
+      cinsn = NULL_RTX_BASE_INSN;
 
       /* Find a bb to unswitch on.  */
       bbs = get_loop_body (loop);
@@ -399,13 +402,14 @@ unswitch_single_loop (struct loop *loop, rtx cond_checked, int num)
    NULL, it is the insn in that COND is compared.  */
 
 static struct loop *
-unswitch_loop (struct loop *loop, basic_block unswitch_on, rtx cond, rtx cinsn)
+unswitch_loop (struct loop *loop, basic_block unswitch_on, rtx cond,
+	       rtx_base_insn cinsn)
 {
   edge entry, latch_edge, true_edge, false_edge, e;
   basic_block switch_bb, unswitch_on_alt;
   struct loop *nloop;
   int irred_flag, prob;
-  rtx seq;
+  rtx_base_insn seq;
 
   /* Some sanity checking.  */
   gcc_assert (flow_bb_inside_loop_p (loop, unswitch_on));
diff --git a/gcc/rtl.h b/gcc/rtl.h
index fecd88a..1e7c4e0 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -3109,7 +3109,8 @@ extern void get_mode_bounds (enum machine_mode, int, enum machine_mode,
 
 /* In loop-unswitch.c  */
 extern rtx reversed_condition (rtx);
-extern rtx compare_and_jump_seq (rtx, rtx, enum rtx_code, rtx_code_label, int, rtx);
+extern rtx_base_insn compare_and_jump_seq (rtx, rtx, enum rtx_code,
+					   rtx_code_label, int, rtx_base_insn);
 
 /* In loop-iv.c  */
 extern rtx canon_condition (rtx);
-- 
1.7.11.7

