diff options
-rw-r--r-- | gcc/ChangeLog | 38 | ||||
-rw-r--r-- | gcc/cfgcleanup.c | 7 | ||||
-rw-r--r-- | gcc/df-problems.c | 11 | ||||
-rw-r--r-- | gcc/df.h | 6 | ||||
-rw-r--r-- | gcc/ifcvt.c | 29 | ||||
-rw-r--r-- | gcc/loop-iv.c | 6 | ||||
-rw-r--r-- | gcc/rtl.h | 5 | ||||
-rw-r--r-- | gcc/rtlanal.c | 8 |
8 files changed, 79 insertions, 31 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3bfc551..49cd7ae 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,43 @@ 2014-08-26 David Malcolm <dmalcolm@redhat.com> + * rtl.h (canonicalize_condition): Strengthen param 1 from rtx to + rtx_insn * and param 4 from rtx * to rtx_insn **. + (get_condition): Strengthen param 1 from rtx to rtx_insn * and + param 2 from rtx * to rtx_insn **. + + * df.h (can_move_insns_across): Strengthen params 1-4 from rtx to + rtx_insn * and final param from rtx * to rtx_insn **. + + * cfgcleanup.c (try_head_merge_bb): Strengthen local "move_before" + from rtx to rtx_insn *. + (try_head_merge_bb): Likewise for both locals named "move_upto". + * df-problems.c (can_move_insns_across): Likewise for params + "from", "to", "across_from", "across_to" and locals "insn", + "next", "max_to". Strengthen param "pmove_upto" from rtx * to + rtx_insn **. + * ifcvt.c (struct noce_if_info): Strengthen field "cond_earliest" + from rtx to rtx_insn *. + (noce_get_alt_condition): Strengthen param "earliest" from rtx * + to rtx_insn **. Strengthen local "insn" from rtx to rtx_insn *. + (noce_try_minmax): Strengthen locals "earliest", "seq" from rtx to + rtx_insn *. + (noce_try_abs): Likewise. + (noce_get_condition): Likewise for param "jump". Strengthen param + "earliest" from rtx * to rtx_insn **. + (noce_find_if_block): Strengthen local "cond_earliest" from rtx to + rtx_insn *. + (find_cond_trap): Likewise. + (dead_or_predicable): Likewise for local "earliest". + * loop-iv.c (check_simple_exit): Likewise for local "at". Add + checked cast. + * rtlanal.c (canonicalize_condition): Likewise for param "insn" + and local "prev". Strengthen param "earliest" from rtx * to + rtx_insn **. + (get_condition): Strengthen param "jump" from rtx to rtx_insn * + Strengthen param "earliest" from rtx * to rtx_insn **. + +2014-08-26 David Malcolm <dmalcolm@redhat.com> + * fwprop.c (local_ref_killed_between_p): Strengthen params "from", "to" and local "insn" from rtx to rtx_insn *. diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c index 96ab4aa..2264b4b 100644 --- a/gcc/cfgcleanup.c +++ b/gcc/cfgcleanup.c @@ -2291,7 +2291,8 @@ try_head_merge_bb (basic_block bb) bool changed, moveall; unsigned ix; rtx_insn *e0_last_head; - rtx cond, move_before; + rtx cond; + rtx_insn *move_before; unsigned nedges = EDGE_COUNT (bb->succs); rtx_insn *jump = BB_END (bb); regset live, live_union; @@ -2455,7 +2456,7 @@ try_head_merge_bb (basic_block bb) with the final move. */ if (final_dest_bb != NULL) { - rtx move_upto; + rtx_insn *move_upto; moveall = can_move_insns_across (currptr[0], e0_last_head, move_before, jump, e0->dest, live_union, @@ -2490,7 +2491,7 @@ try_head_merge_bb (basic_block bb) do { - rtx move_upto; + rtx_insn *move_upto; moveall = can_move_insns_across (currptr[0], e0_last_head, move_before, jump, e0->dest, live_union, NULL, &move_upto); diff --git a/gcc/df-problems.c b/gcc/df-problems.c index 65f9b4c..305ed5d 100644 --- a/gcc/df-problems.c +++ b/gcc/df-problems.c @@ -3664,11 +3664,12 @@ simulate_backwards_to_point (basic_block bb, regset live, rtx point) is set to point at the last moveable insn in such a case. */ bool -can_move_insns_across (rtx from, rtx to, rtx across_from, rtx across_to, +can_move_insns_across (rtx_insn *from, rtx_insn *to, + rtx_insn *across_from, rtx_insn *across_to, basic_block merge_bb, regset merge_live, - regset other_branch_live, rtx *pmove_upto) + regset other_branch_live, rtx_insn **pmove_upto) { - rtx insn, next, max_to; + rtx_insn *insn, *next, *max_to; bitmap merge_set, merge_use, local_merge_live; bitmap test_set, test_use; unsigned i, fail = 0; @@ -3678,7 +3679,7 @@ can_move_insns_across (rtx from, rtx to, rtx across_from, rtx across_to, bool trapping_insns_in_across = false; if (pmove_upto != NULL) - *pmove_upto = NULL_RTX; + *pmove_upto = NULL; /* Find real bounds, ignoring debug insns. */ while (!NONDEBUG_INSN_P (from) && from != to) @@ -3754,7 +3755,7 @@ can_move_insns_across (rtx from, rtx to, rtx across_from, rtx across_to, the first insn in MERGE that sets a register in TEST_USE, or uses a register in TEST_SET. We also check for calls, trapping operations, and memory references. */ - max_to = NULL_RTX; + max_to = NULL; for (insn = from; ; insn = next) { if (CALL_P (insn)) @@ -1018,8 +1018,10 @@ extern void df_simulate_finalize_backwards (basic_block, bitmap); extern void df_simulate_initialize_forwards (basic_block, bitmap); extern void df_simulate_one_insn_forwards (basic_block, rtx, bitmap); extern void simulate_backwards_to_point (basic_block, regset, rtx); -extern bool can_move_insns_across (rtx, rtx, rtx, rtx, basic_block, regset, - regset, rtx *); +extern bool can_move_insns_across (rtx_insn *, rtx_insn *, + rtx_insn *, rtx_insn *, + basic_block, regset, + regset, rtx_insn **); /* Functions defined in df-scan.c. */ extern void df_scan_alloc (bitmap); diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index d5ae98b9..94b96f3 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -92,7 +92,7 @@ static rtx find_active_insn_after (basic_block, rtx); static basic_block block_fallthru (basic_block); static int cond_exec_process_insns (ce_if_block *, rtx, rtx, rtx, int, int); static rtx cond_exec_get_condition (rtx); -static rtx noce_get_condition (rtx, rtx *, bool); +static rtx noce_get_condition (rtx_insn *, rtx_insn **, bool); static int noce_operand_ok (const_rtx); static void merge_if_block (ce_if_block *); static int find_cond_trap (basic_block, edge, edge); @@ -783,7 +783,7 @@ struct noce_if_info rtx cond; /* New insns should be inserted before this one. */ - rtx cond_earliest; + rtx_insn *cond_earliest; /* Insns in the THEN and ELSE block. There is always just this one insns in those blocks. The insns are single_set insns. @@ -819,7 +819,7 @@ static rtx noce_emit_cmove (struct noce_if_info *, rtx, enum rtx_code, rtx, rtx, rtx, rtx); static int noce_try_cmove (struct noce_if_info *); static int noce_try_cmove_arith (struct noce_if_info *); -static rtx noce_get_alt_condition (struct noce_if_info *, rtx, rtx *); +static rtx noce_get_alt_condition (struct noce_if_info *, rtx, rtx_insn **); static int noce_try_minmax (struct noce_if_info *); static int noce_try_abs (struct noce_if_info *); static int noce_try_sign_mask (struct noce_if_info *); @@ -1754,9 +1754,10 @@ noce_try_cmove_arith (struct noce_if_info *if_info) static rtx noce_get_alt_condition (struct noce_if_info *if_info, rtx target, - rtx *earliest) + rtx_insn **earliest) { - rtx cond, set, insn; + rtx cond, set; + rtx_insn *insn; int reverse; /* If target is already mentioned in the known condition, return it. */ @@ -1906,8 +1907,8 @@ noce_get_alt_condition (struct noce_if_info *if_info, rtx target, static int noce_try_minmax (struct noce_if_info *if_info) { - rtx cond, earliest, target; - rtx_insn *seq; + rtx cond, target; + rtx_insn *earliest, *seq; enum rtx_code code, op; int unsignedp; @@ -2002,8 +2003,8 @@ noce_try_minmax (struct noce_if_info *if_info) static int noce_try_abs (struct noce_if_info *if_info) { - rtx cond, earliest, target, a, b, c; - rtx_insn *seq; + rtx cond, target, a, b, c; + rtx_insn *earliest, *seq; int negate; bool one_cmpl = false; @@ -2330,7 +2331,7 @@ noce_try_bitop (struct noce_if_info *if_info) THEN block of the caller, and we have to reverse the condition. */ static rtx -noce_get_condition (rtx jump, rtx *earliest, bool then_else_reversed) +noce_get_condition (rtx_insn *jump, rtx_insn **earliest, bool then_else_reversed) { rtx cond, set, tmp; bool reverse; @@ -3044,7 +3045,7 @@ noce_find_if_block (basic_block test_bb, edge then_edge, edge else_edge, bool then_else_reversed = false; rtx_insn *jump; rtx cond; - rtx cond_earliest; + rtx_insn *cond_earliest; struct noce_if_info if_info; /* We only ever should get here before reload. */ @@ -3698,7 +3699,8 @@ find_cond_trap (basic_block test_bb, edge then_edge, edge else_edge) basic_block else_bb = else_edge->dest; basic_block other_bb, trap_bb; rtx_insn *trap, *jump; - rtx cond, cond_earliest, seq; + rtx cond, seq; + rtx_insn *cond_earliest; enum rtx_code code; /* Locate the block with the trap instruction. */ @@ -4134,7 +4136,8 @@ dead_or_predicable (basic_block test_bb, basic_block merge_bb, { basic_block new_dest = dest_edge->dest; rtx_insn *head, *end, *jump; - rtx earliest = NULL_RTX, old_dest; + rtx_insn *earliest = NULL; + rtx old_dest; bitmap merge_set = NULL; /* Number of pending changes. */ int n_validated_changes = 0; diff --git a/gcc/loop-iv.c b/gcc/loop-iv.c index 7ff1acc..b83f8f8 100644 --- a/gcc/loop-iv.c +++ b/gcc/loop-iv.c @@ -2893,7 +2893,8 @@ static void check_simple_exit (struct loop *loop, edge e, struct niter_desc *desc) { basic_block exit_bb; - rtx condition, at; + rtx condition; + rtx_insn *at; edge ein; exit_bb = e->src; @@ -2931,8 +2932,7 @@ check_simple_exit (struct loop *loop, edge e, struct niter_desc *desc) /* Check that we are able to determine number of iterations and fill in information about it. */ - iv_number_of_iterations (loop, safe_as_a <rtx_insn *> (at), - condition, desc); + iv_number_of_iterations (loop, at, condition, desc); } /* Finds a simple exit of LOOP and stores its description into DESC. */ @@ -2672,11 +2672,12 @@ extern int insn_rtx_cost (rtx, bool); /* Given an insn and condition, return a canonical description of the test being made. */ -extern rtx canonicalize_condition (rtx, rtx, int, rtx *, rtx, int, int); +extern rtx canonicalize_condition (rtx_insn *, rtx, int, rtx_insn **, rtx, + int, int); /* Given a JUMP_INSN, return a canonical description of the test being made. */ -extern rtx get_condition (rtx, rtx *, int, int); +extern rtx get_condition (rtx_insn *, rtx_insn **, int, int); /* Information about a subreg of a hard register. */ struct subreg_info diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index 996e0f7..cf04709 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -4985,11 +4985,12 @@ insn_rtx_cost (rtx pat, bool speed) and at INSN. */ rtx -canonicalize_condition (rtx insn, rtx cond, int reverse, rtx *earliest, +canonicalize_condition (rtx_insn *insn, rtx cond, int reverse, + rtx_insn **earliest, rtx want_reg, int allow_cc_mode, int valid_at_insn_p) { enum rtx_code code; - rtx prev = insn; + rtx_insn *prev = insn; const_rtx set; rtx tem; rtx op0, op1; @@ -5254,7 +5255,8 @@ canonicalize_condition (rtx insn, rtx cond, int reverse, rtx *earliest, VALID_AT_INSN_P is the same as for canonicalize_condition. */ rtx -get_condition (rtx jump, rtx *earliest, int allow_cc_mode, int valid_at_insn_p) +get_condition (rtx_insn *jump, rtx_insn **earliest, int allow_cc_mode, + int valid_at_insn_p) { rtx cond; int reverse; |