aboutsummaryrefslogtreecommitdiff
path: root/gcc/resource.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/resource.c')
-rw-r--r--gcc/resource.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/gcc/resource.c b/gcc/resource.c
index dfd10f6..eb5374e 100644
--- a/gcc/resource.c
+++ b/gcc/resource.c
@@ -79,10 +79,10 @@ static HARD_REG_SET pending_dead_regs;
static void update_live_status (rtx, const_rtx, void *);
static int find_basic_block (rtx, int);
-static rtx next_insn_no_annul (rtx);
-static rtx find_dead_or_set_registers (rtx, struct resources*,
- rtx*, int, struct resources,
- struct resources);
+static rtx_insn *next_insn_no_annul (rtx_insn *);
+static rtx_insn *find_dead_or_set_registers (rtx_insn *, struct resources*,
+ rtx_insn **, int, struct resources,
+ struct resources);
/* Utility function called from mark_target_live_regs via note_stores.
It deadens any CLOBBERed registers and livens any SET registers. */
@@ -163,8 +163,8 @@ find_basic_block (rtx insn, int search_limit)
/* Similar to next_insn, but ignores insns in the delay slots of
an annulled branch. */
-static rtx
-next_insn_no_annul (rtx insn)
+static rtx_insn *
+next_insn_no_annul (rtx_insn *insn)
{
if (insn)
{
@@ -187,7 +187,7 @@ next_insn_no_annul (rtx insn)
insn = NEXT_INSN (insn);
if (insn && NONJUMP_INSN_P (insn)
&& GET_CODE (PATTERN (insn)) == SEQUENCE)
- insn = XVECEXP (PATTERN (insn), 0, 0);
+ insn = as_a <rtx_sequence *> (PATTERN (insn))->insn (0);
}
return insn;
@@ -308,7 +308,7 @@ mark_referenced_resources (rtx x, struct resources *res,
However, we may have moved some of the parameter loading insns
into the delay slot of this CALL. If so, the USE's for them
don't count and should be skipped. */
- rtx_insn *insn = PREV_INSN (x);
+ rtx_insn *insn = PREV_INSN (as_a <rtx_insn *> (x));
rtx_sequence *sequence = 0;
int seq_size = 0;
int i;
@@ -420,19 +420,19 @@ mark_referenced_resources (rtx x, struct resources *res,
Stop after passing a few conditional jumps, and/or a small
number of unconditional branches. */
-static rtx
-find_dead_or_set_registers (rtx target, struct resources *res,
- rtx *jump_target, int jump_count,
+static rtx_insn *
+find_dead_or_set_registers (rtx_insn *target, struct resources *res,
+ rtx_insn **jump_target, int jump_count,
struct resources set, struct resources needed)
{
HARD_REG_SET scratch;
- rtx insn, next;
- rtx jump_insn = 0;
+ rtx_insn *insn, *next;
+ rtx_insn *jump_insn = 0;
int i;
for (insn = target; insn; insn = next)
{
- rtx this_jump_insn = insn;
+ rtx_insn *this_jump_insn = insn;
next = NEXT_INSN (insn);
@@ -480,7 +480,7 @@ find_dead_or_set_registers (rtx target, struct resources *res,
of a call, so search for a JUMP_INSN in any position. */
for (i = 0; i < seq->len (); i++)
{
- this_jump_insn = seq->element (i);
+ this_jump_insn = seq->insn (i);
if (JUMP_P (this_jump_insn))
break;
}
@@ -497,14 +497,14 @@ find_dead_or_set_registers (rtx target, struct resources *res,
if (any_uncondjump_p (this_jump_insn)
|| ANY_RETURN_P (PATTERN (this_jump_insn)))
{
- next = JUMP_LABEL (this_jump_insn);
+ next = JUMP_LABEL_AS_INSN (this_jump_insn);
if (ANY_RETURN_P (next))
- next = NULL_RTX;
+ next = NULL;
if (jump_insn == 0)
{
jump_insn = insn;
if (jump_target)
- *jump_target = JUMP_LABEL (this_jump_insn);
+ *jump_target = JUMP_LABEL_AS_INSN (this_jump_insn);
}
}
else if (any_condjump_p (this_jump_insn))
@@ -569,7 +569,7 @@ find_dead_or_set_registers (rtx target, struct resources *res,
AND_COMPL_HARD_REG_SET (fallthrough_res.regs, scratch);
if (!ANY_RETURN_P (JUMP_LABEL (this_jump_insn)))
- find_dead_or_set_registers (JUMP_LABEL (this_jump_insn),
+ find_dead_or_set_registers (JUMP_LABEL_AS_INSN (this_jump_insn),
&target_res, 0, jump_count,
target_set, needed);
find_dead_or_set_registers (next,
@@ -880,14 +880,14 @@ return_insn_p (const_rtx insn)
init_resource_info () was invoked before we are called. */
void
-mark_target_live_regs (rtx insns, rtx target, struct resources *res)
+mark_target_live_regs (rtx_insn *insns, rtx_insn *target, struct resources *res)
{
int b = -1;
unsigned int i;
struct target_info *tinfo = NULL;
- rtx insn;
+ rtx_insn *insn;
rtx jump_insn = 0;
- rtx jump_target;
+ rtx_insn *jump_target;
HARD_REG_SET scratch;
struct resources set, needed;
@@ -965,7 +965,7 @@ mark_target_live_regs (rtx insns, rtx target, struct resources *res)
if (b != -1)
{
regset regs_live = DF_LR_IN (BASIC_BLOCK_FOR_FN (cfun, b));
- rtx start_insn, stop_insn;
+ rtx_insn *start_insn, *stop_insn;
/* Compute hard regs live at start of block. */
REG_SET_TO_HARD_REG_SET (current_live_regs, regs_live);
@@ -978,7 +978,7 @@ mark_target_live_regs (rtx insns, rtx target, struct resources *res)
if (NONJUMP_INSN_P (start_insn)
&& GET_CODE (PATTERN (start_insn)) == SEQUENCE)
- start_insn = XVECEXP (PATTERN (start_insn), 0, 0);
+ start_insn = as_a <rtx_sequence *> (PATTERN (start_insn))->insn (0);
if (NONJUMP_INSN_P (stop_insn)
&& GET_CODE (PATTERN (stop_insn)) == SEQUENCE)
@@ -1122,7 +1122,7 @@ mark_target_live_regs (rtx insns, rtx target, struct resources *res)
if (jump_insn)
{
struct resources new_resources;
- rtx stop_insn = next_active_insn (jump_insn);
+ rtx_insn *stop_insn = next_active_insn (jump_insn);
if (!ANY_RETURN_P (jump_target))
jump_target = next_active_insn (jump_target);