aboutsummaryrefslogtreecommitdiff
path: root/gcc/flow.c
diff options
context:
space:
mode:
authorKazu Hirata <kazu@cs.umass.edu>2004-10-18 15:11:31 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2004-10-18 15:11:31 +0000
commita2041967826c644f860ec12c6f32214b1e3d3899 (patch)
treee0aded8319864b2cb6fac4df0732bb5ee1995039 /gcc/flow.c
parent2ddfd02523ee86ac14fd053bee5a7c30f6f1f602 (diff)
downloadgcc-a2041967826c644f860ec12c6f32214b1e3d3899.zip
gcc-a2041967826c644f860ec12c6f32214b1e3d3899.tar.gz
gcc-a2041967826c644f860ec12c6f32214b1e3d3899.tar.bz2
basic-block.h (reg_set_iterator): New.
* basic-block.h (reg_set_iterator): New. (EXECUTE_IF_SET_IN_REG_SET): Make it iterator style. (EXECUTE_IF_AND_COMPL_IN_REG_SET): Likewise. (EXECUTE_IF_AND_IN_REG_SET): Likewise. * caller-save.c (save_call_clobbered_regs): Adjust to the new style. * cfgcleanup.c (thread_jump): Likewise. * cfgrtl.c (safe_insert_insn_on_edge): Likewise. * conflict.c (conflict_graph_compute): Likewise. * flow.c (verify_local_live_at_start, update_life_info, initialize_uninitialized_subregs, propagate_one_insn, init_propagate_block_info, free_propagate_block_info, propagate_block, dump_regset): Likewise. * global.c (global_conflicts): Likewise. * graph.c (start_bb): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (load_mems): Likewise. * reload1.c (compute_use_by_pseudos, order_regs_for_reload, find_reg, finish_spills): Likewise. * resource.c (mark_target_live_regs): Likewise. * sched-deps.c (sched_analyze_insn): Likewise. * sched-rgn.c (sched-rgn.c): Likewise. * config/frv/frv.c (frv_ifcvt_modify_tests): Likewise. From-SVN: r89226
Diffstat (limited to 'gcc/flow.c')
-rw-r--r--gcc/flow.c101
1 files changed, 57 insertions, 44 deletions
diff --git a/gcc/flow.c b/gcc/flow.c
index 4914d72..4ea30a7 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -521,11 +521,12 @@ verify_local_live_at_start (regset new_live_at_start, basic_block bb)
else
{
int i;
+ reg_set_iterator rsi;
/* Find the set of changed registers. */
XOR_REG_SET (new_live_at_start, bb->global_live_at_start);
- EXECUTE_IF_SET_IN_REG_SET (new_live_at_start, 0, i,
+ EXECUTE_IF_SET_IN_REG_SET (new_live_at_start, 0, i, rsi)
{
/* No registers should die. */
if (REGNO_REG_SET_P (bb->global_live_at_start, i))
@@ -540,7 +541,7 @@ verify_local_live_at_start (regset new_live_at_start, basic_block bb)
}
/* Verify that the now-live register is wider than word_mode. */
verify_wide_reg (i, bb);
- });
+ }
}
}
@@ -680,13 +681,15 @@ update_life_info (sbitmap blocks, enum update_life_extent extent, int prop_flags
if (prop_flags & PROP_REG_INFO)
{
+ reg_set_iterator rsi;
+
/* The only pseudos that are live at the beginning of the function
are those that were not set anywhere in the function. local-alloc
doesn't know how to handle these correctly, so mark them as not
local to any one basic block. */
EXECUTE_IF_SET_IN_REG_SET (ENTRY_BLOCK_PTR->global_live_at_end,
- FIRST_PSEUDO_REGISTER, i,
- { REG_BASIC_BLOCK (i) = REG_BLOCK_GLOBAL; });
+ FIRST_PSEUDO_REGISTER, i, rsi)
+ REG_BASIC_BLOCK (i) = REG_BLOCK_GLOBAL;
/* We have a problem with any pseudoreg that lives across the setjmp.
ANSI says that if a user variable does not change in value between
@@ -697,14 +700,14 @@ update_life_info (sbitmap blocks, enum update_life_extent extent, int prop_flags
that hard reg where this pseudo is dead, thus clobbering the pseudo.
Conclusion: such a pseudo must not go in a hard reg. */
EXECUTE_IF_SET_IN_REG_SET (regs_live_at_setjmp,
- FIRST_PSEUDO_REGISTER, i,
- {
- if (regno_reg_rtx[i] != 0)
- {
- REG_LIVE_LENGTH (i) = -1;
- REG_BASIC_BLOCK (i) = REG_BLOCK_UNKNOWN;
- }
- });
+ FIRST_PSEUDO_REGISTER, i, rsi)
+ {
+ if (regno_reg_rtx[i] != 0)
+ {
+ REG_LIVE_LENGTH (i) = -1;
+ REG_BASIC_BLOCK (i) = REG_BLOCK_UNKNOWN;
+ }
+ }
}
if (reg_deaths)
{
@@ -1369,8 +1372,9 @@ initialize_uninitialized_subregs (void)
{
basic_block bb = e->dest;
regset map = bb->global_live_at_start;
- EXECUTE_IF_SET_IN_REG_SET (map,
- FIRST_PSEUDO_REGISTER, reg,
+ reg_set_iterator rsi;
+
+ EXECUTE_IF_SET_IN_REG_SET (map, FIRST_PSEUDO_REGISTER, reg, rsi)
{
int uid = REGNO_FIRST_UID (reg);
rtx i;
@@ -1398,7 +1402,7 @@ initialize_uninitialized_subregs (void)
did_something = 1;
}
}
- });
+ }
}
if (did_something)
@@ -1671,8 +1675,11 @@ propagate_one_insn (struct propagate_block_info *pbi, rtx insn)
record this for them. */
if (CALL_P (insn) && (flags & PROP_REG_INFO))
- EXECUTE_IF_SET_IN_REG_SET (pbi->reg_live, 0, i,
- { REG_N_CALLS_CROSSED (i)++; });
+ {
+ reg_set_iterator rsi;
+ EXECUTE_IF_SET_IN_REG_SET (pbi->reg_live, 0, i, rsi)
+ REG_N_CALLS_CROSSED (i)++;
+ }
/* Record sets. Do this even for dead instructions, since they
would have killed the values if they hadn't been deleted. */
@@ -1878,6 +1885,8 @@ init_propagate_block_info (basic_block bb, regset live, regset local_set,
= gen_rtx_fmt_ee (inv_cond,
GET_MODE (cond_true), XEXP (cond_true, 0),
XEXP (cond_true, 1));
+ reg_set_iterator rsi;
+
if (GET_CODE (XEXP (set_src, 1)) == PC)
{
rtx t = cond_false;
@@ -1888,25 +1897,24 @@ init_propagate_block_info (basic_block bb, regset live, regset local_set,
SET_REGNO_REG_SET (pbi->reg_cond_reg, REGNO (reg));
/* For each such register, mark it conditionally dead. */
- EXECUTE_IF_SET_IN_REG_SET
- (diff, 0, i,
- {
- struct reg_cond_life_info *rcli;
- rtx cond;
-
- rcli = xmalloc (sizeof (*rcli));
-
- if (REGNO_REG_SET_P (bb_true->global_live_at_start, i))
- cond = cond_false;
- else
- cond = cond_true;
- rcli->condition = cond;
- rcli->stores = const0_rtx;
- rcli->orig_condition = cond;
-
- splay_tree_insert (pbi->reg_cond_dead, i,
- (splay_tree_value) rcli);
- });
+ EXECUTE_IF_SET_IN_REG_SET (diff, 0, i, rsi)
+ {
+ struct reg_cond_life_info *rcli;
+ rtx cond;
+
+ rcli = xmalloc (sizeof (*rcli));
+
+ if (REGNO_REG_SET_P (bb_true->global_live_at_start, i))
+ cond = cond_false;
+ else
+ cond = cond_true;
+ rcli->condition = cond;
+ rcli->stores = const0_rtx;
+ rcli->orig_condition = cond;
+
+ splay_tree_insert (pbi->reg_cond_dead, i,
+ (splay_tree_value) rcli);
+ }
}
}
@@ -1966,11 +1974,13 @@ free_propagate_block_info (struct propagate_block_info *pbi)
{
int num = pbi->insn_num;
int i;
+ reg_set_iterator rsi;
- EXECUTE_IF_SET_IN_REG_SET (pbi->reg_live, 0, i,
- { REG_LIVE_LENGTH (i) += num - reg_deaths[i];
- reg_deaths[i] = 0;
- });
+ EXECUTE_IF_SET_IN_REG_SET (pbi->reg_live, 0, i, rsi)
+ {
+ REG_LIVE_LENGTH (i) += num - reg_deaths[i];
+ reg_deaths[i] = 0;
+ }
}
if (pbi->reg_next_use)
free (pbi->reg_next_use);
@@ -2009,11 +2019,12 @@ propagate_block (basic_block bb, regset live, regset local_set,
if (flags & PROP_REG_INFO)
{
int i;
+ reg_set_iterator rsi;
/* Process the regs live at the end of the block.
Mark them as not local to any one basic block. */
- EXECUTE_IF_SET_IN_REG_SET (live, 0, i,
- { REG_BASIC_BLOCK (i) = REG_BLOCK_GLOBAL; });
+ EXECUTE_IF_SET_IN_REG_SET (live, 0, i, rsi)
+ REG_BASIC_BLOCK (i) = REG_BLOCK_GLOBAL;
}
/* Scan the block an insn at a time from end to beginning. */
@@ -4135,19 +4146,21 @@ void
dump_regset (regset r, FILE *outf)
{
int i;
+ reg_set_iterator rsi;
+
if (r == NULL)
{
fputs (" (nil)", outf);
return;
}
- EXECUTE_IF_SET_IN_REG_SET (r, 0, i,
+ EXECUTE_IF_SET_IN_REG_SET (r, 0, i, rsi)
{
fprintf (outf, " %d", i);
if (i < FIRST_PSEUDO_REGISTER)
fprintf (outf, " [%s]",
reg_names[i]);
- });
+ }
}
/* Print a human-readable representation of R on the standard error