summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorcrowl <crowl@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-01 21:02:15 +0000
committercrowl <crowl@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-01 21:02:15 +0000
commit0d21196387a8566f0b98f35adc355932393b670e (patch)
tree6a2b07bcbe69d6025168367c7ef581e376cca84c /gcc
parent41f4033b94a7a17e766e29386542f087ae0e2dfa (diff)
downloadgcc-0d21196387a8566f0b98f35adc355932393b670e.tar.gz
This patch renames sbitmap iterators to unify them with the bitmap iterators.
Remove the unused EXECUTE_IF_SET_IN_SBITMAP_REV, which has an unconventional interface. Rename the sbitmap_iter_* functions to match bitmap's bmp_iter_* functions. Add an additional parameter to the initialization and next functions to match the interface in bmp_iter_*. This extra parameter is mostly hidden by the use of the EXECUTE_IF macros. Rename the EXECUTE_IF_SET_IN_SBITMAP macro to EXECUTE_IF_SET_IN_BITMAP. Its implementation is now identical to that in bitmap.h. To prevent redefinition errors, both definitions are now guarded by #ifndef. An alternate strategy is to simply include bitmap.h from sbitmap.h. As this would increase build time, I have elected to use the #ifndef version. I do not have a strong preference here. The sbitmap_iterator type is still distinctly named because it is often declared in contexts where the bitmap type is not obvious. There are less than 40 uses of this type, so the burden to modify it when changing bitmap types is not large. Tested on x86-64, config-list.mk testing. Index: gcc/ChangeLog 2012-10-31 Lawrence Crowl <crowl@google.com> * sbitmap.h (sbitmap_iter_init): Rename bmp_iter_set_init and add unused parameter to match bitmap iterator. Update callers. (sbitmap_iter_cond): Rename bmp_iter_set. Update callers. (sbitmap_iter_next): Rename bmp_iter_next and add unused parameter to match bitmap iterator. Update callers. (EXECUTE_IF_SET_IN_SBITMAP_REV): Remove unused. (EXECUTE_IF_SET_IN_SBITMAP): Rename EXECUTE_IF_SET_IN_BITMAP and adjust to be identical to the definition in bitmap.h. Conditionalize the definition based on not having been defined. Update callers. * bitmap.h (EXECUTE_IF_SET_IN_BITMAP): Conditionalize the definition based on not having been defined. (To match the above.) git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193069 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog14
-rw-r--r--gcc/bitmap.h3
-rw-r--r--gcc/bt-load.c2
-rw-r--r--gcc/config/i386/i386.c2
-rw-r--r--gcc/ddg.c14
-rw-r--r--gcc/dse.c2
-rw-r--r--gcc/ebitmap.c12
-rw-r--r--gcc/ebitmap.h10
-rw-r--r--gcc/gcse.c8
-rw-r--r--gcc/ira-lives.c2
-rw-r--r--gcc/lower-subreg.c2
-rw-r--r--gcc/lra-lives.c2
-rw-r--r--gcc/modulo-sched.c10
-rw-r--r--gcc/sbitmap.c2
-rw-r--r--gcc/sbitmap.h48
-rw-r--r--gcc/sched-rgn.c2
-rw-r--r--gcc/tree-into-ssa.c10
-rw-r--r--gcc/tree-ssa-reassoc.c6
18 files changed, 73 insertions, 78 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b78d04268cd..7d963a8c058 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,17 @@
+2012-10-31 Lawrence Crowl <crowl@google.com>
+
+ * sbitmap.h (sbitmap_iter_init): Rename bmp_iter_set_init and add
+ unused parameter to match bitmap iterator. Update callers.
+ (sbitmap_iter_cond): Rename bmp_iter_set. Update callers.
+ (sbitmap_iter_next): Rename bmp_iter_next and add unused parameter to
+ match bitmap iterator. Update callers.
+ (EXECUTE_IF_SET_IN_SBITMAP_REV): Remove unused.
+ (EXECUTE_IF_SET_IN_SBITMAP): Rename EXECUTE_IF_SET_IN_BITMAP and
+ adjust to be identical to the definition in bitmap.h. Conditionalize
+ the definition based on not having been defined. Update callers.
+ * bitmap.h (EXECUTE_IF_SET_IN_BITMAP): Conditionalize the definition
+ based on not having been defined. (To match the above.)
+
2012-11-01 Lawrence Crowl <crowl@google.com>
* sbitmap.h (TEST_BIT): Rename bitmap_bit_p, normalizing parameter
diff --git a/gcc/bitmap.h b/gcc/bitmap.h
index 7ed5d745d1e..785ce3c48d7 100644
--- a/gcc/bitmap.h
+++ b/gcc/bitmap.h
@@ -682,10 +682,13 @@ bmp_iter_and_compl (bitmap_iterator *bi, unsigned *bit_no)
should be treated as a read-only variable as it contains loop
state. */
+#ifndef EXECUTE_IF_SET_IN_BITMAP
+/* See sbitmap.h for the other definition of EXECUTE_IF_SET_IN_BITMAP. */
#define EXECUTE_IF_SET_IN_BITMAP(BITMAP, MIN, BITNUM, ITER) \
for (bmp_iter_set_init (&(ITER), (BITMAP), (MIN), &(BITNUM)); \
bmp_iter_set (&(ITER), &(BITNUM)); \
bmp_iter_next (&(ITER), &(BITNUM)))
+#endif
/* Loop over all the bits set in BITMAP1 & BITMAP2, starting with MIN
and setting BITNUM to the bit number. ITER is a bitmap iterator.
diff --git a/gcc/bt-load.c b/gcc/bt-load.c
index 23dc997ca48..76a6e61aec9 100644
--- a/gcc/bt-load.c
+++ b/gcc/bt-load.c
@@ -721,7 +721,7 @@ link_btr_uses (btr_def *def_array, btr_user *use_array, sbitmap *bb_out,
reaching_defs,
btr_defset[reg - first_btr]);
}
- EXECUTE_IF_SET_IN_SBITMAP (reaching_defs_of_reg, 0, uid, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (reaching_defs_of_reg, 0, uid, sbi)
{
btr_def def = def_array[uid];
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index b389c098adf..fae300e4ce1 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -24815,7 +24815,7 @@ core2i7_first_cycle_multipass_backtrack (const void *_data,
sbitmap_iterator sbi;
gcc_assert (bitmap_last_set_bit (data->ready_try_change) < n_ready);
- EXECUTE_IF_SET_IN_SBITMAP (data->ready_try_change, 0, i, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (data->ready_try_change, 0, i, sbi)
{
ready_try[i] = 0;
}
diff --git a/gcc/ddg.c b/gcc/ddg.c
index 6ad61b6f42d..9d44ac89301 100644
--- a/gcc/ddg.c
+++ b/gcc/ddg.c
@@ -801,7 +801,7 @@ print_sccs (FILE *file, ddg_all_sccs_ptr sccs, ddg_ptr g)
for (i = 0; i < sccs->num_sccs; i++)
{
fprintf (file, "SCC number: %d\n", i);
- EXECUTE_IF_SET_IN_SBITMAP (sccs->sccs[i]->nodes, 0, u, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (sccs->sccs[i]->nodes, 0, u, sbi)
{
fprintf (file, "insn num %d\n", u);
print_rtl_single (file, g->nodes[u].insn);
@@ -893,7 +893,7 @@ create_scc (ddg_ptr g, sbitmap nodes)
bitmap_copy (scc->nodes, nodes);
/* Mark the backarcs that belong to this SCC. */
- EXECUTE_IF_SET_IN_SBITMAP (nodes, 0, u, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (nodes, 0, u, sbi)
{
ddg_edge_ptr e;
ddg_node_ptr n = &g->nodes[u];
@@ -977,7 +977,7 @@ find_successors (sbitmap succ, ddg_ptr g, sbitmap ops)
unsigned int i = 0;
sbitmap_iterator sbi;
- EXECUTE_IF_SET_IN_SBITMAP (ops, 0, i, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (ops, 0, i, sbi)
{
const sbitmap node_succ = NODE_SUCCESSORS (&g->nodes[i]);
bitmap_ior (succ, succ, node_succ);
@@ -996,7 +996,7 @@ find_predecessors (sbitmap preds, ddg_ptr g, sbitmap ops)
unsigned int i = 0;
sbitmap_iterator sbi;
- EXECUTE_IF_SET_IN_SBITMAP (ops, 0, i, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (ops, 0, i, sbi)
{
const sbitmap node_preds = NODE_PREDECESSORS (&g->nodes[i]);
bitmap_ior (preds, preds, node_preds);
@@ -1141,7 +1141,7 @@ find_nodes_on_paths (sbitmap result, ddg_ptr g, sbitmap from, sbitmap to)
change = 0;
bitmap_copy (workset, tmp);
bitmap_clear (tmp);
- EXECUTE_IF_SET_IN_SBITMAP (workset, 0, u, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (workset, 0, u, sbi)
{
ddg_edge_ptr e;
ddg_node_ptr u_node = &g->nodes[u];
@@ -1170,7 +1170,7 @@ find_nodes_on_paths (sbitmap result, ddg_ptr g, sbitmap from, sbitmap to)
change = 0;
bitmap_copy (workset, tmp);
bitmap_clear (tmp);
- EXECUTE_IF_SET_IN_SBITMAP (workset, 0, u, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (workset, 0, u, sbi)
{
ddg_edge_ptr e;
ddg_node_ptr u_node = &g->nodes[u];
@@ -1257,7 +1257,7 @@ longest_simple_path (struct ddg * g, int src, int dest, sbitmap nodes)
change = 0;
bitmap_copy (workset, tmp);
bitmap_clear (tmp);
- EXECUTE_IF_SET_IN_SBITMAP (workset, 0, u, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (workset, 0, u, sbi)
{
ddg_node_ptr u_node = &g->nodes[u];
diff --git a/gcc/dse.c b/gcc/dse.c
index 88f817625bc..d389a426593 100644
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -3414,7 +3414,7 @@ dse_step3 (bool for_spills)
/* For any block in an infinite loop, we must initialize the out set
to all ones. This could be expensive, but almost never occurs in
practice. However, it is common in regression tests. */
- EXECUTE_IF_SET_IN_SBITMAP (unreachable_blocks, 0, i, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (unreachable_blocks, 0, i, sbi)
{
if (bitmap_bit_p (all_blocks, i))
{
diff --git a/gcc/ebitmap.c b/gcc/ebitmap.c
index 8f2e9a687f2..334953204e3 100644
--- a/gcc/ebitmap.c
+++ b/gcc/ebitmap.c
@@ -438,7 +438,7 @@ bitmap_and_into (ebitmap dst, ebitmap src)
the result, AND'ing them. */
bitmap_and (dst->wordmask, dst->wordmask, src->wordmask);
- EXECUTE_IF_SET_IN_SBITMAP (dst->wordmask, 0, i, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (dst->wordmask, 0, i, sbi)
{
EBITMAP_ELT_TYPE tmpword = ebitmap_array_get (src, srceltindex++);
tmpword &= ebitmap_array_get (dst, dsteltindex++);
@@ -490,7 +490,7 @@ bitmap_and (ebitmap dst, ebitmap src1, ebitmap src2)
0);
bitmap_and (dst->wordmask, src1->wordmask, src2->wordmask);
- EXECUTE_IF_SET_IN_SBITMAP (dst->wordmask, 0, i, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (dst->wordmask, 0, i, sbi)
{
bool src1hasword, src2hasword;
@@ -598,7 +598,7 @@ bitmap_ior_into (ebitmap dst, ebitmap src)
newarraysize = src->numwords + dst->numwords;
newarray = XNEWVEC (EBITMAP_ELT_TYPE, newarraysize);
- EXECUTE_IF_SET_IN_SBITMAP (tempmask, 0, i, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (tempmask, 0, i, sbi)
{
bool dsthasword, srchasword;
@@ -707,7 +707,7 @@ bitmap_ior (ebitmap dst, ebitmap src1, ebitmap src2)
newarraysize = src1->numwords + src2->numwords;
newarray = XNEWVEC (EBITMAP_ELT_TYPE, newarraysize);
- EXECUTE_IF_SET_IN_SBITMAP (tempmask, 0, i, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (tempmask, 0, i, sbi)
{
bool src1hasword, src2hasword;
EBITMAP_ELT_TYPE tmpword;
@@ -803,7 +803,7 @@ bitmap_and_compl_into (ebitmap dst, ebitmap src)
if (src->numwords == 0)
return false;
- EXECUTE_IF_SET_IN_SBITMAP (dst->wordmask, 0, i, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (dst->wordmask, 0, i, sbi)
{
bool srchasword;
@@ -886,7 +886,7 @@ bitmap_and_compl (ebitmap dst, ebitmap src1, ebitmap src2)
newarraysize = src1->numwords;
newarray = XNEWVEC (EBITMAP_ELT_TYPE, newarraysize);
- EXECUTE_IF_SET_IN_SBITMAP (src1->wordmask, 0, i, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (src1->wordmask, 0, i, sbi)
{
bool src2hasword;
EBITMAP_ELT_TYPE tmpword;
diff --git a/gcc/ebitmap.h b/gcc/ebitmap.h
index 6e77d576fb4..fef3154baf4 100644
--- a/gcc/ebitmap.h
+++ b/gcc/ebitmap.h
@@ -94,8 +94,9 @@ typedef struct {
static inline void
ebitmap_iter_init (ebitmap_iterator *i, ebitmap bmp, unsigned int min)
{
- sbitmap_iter_init (&i->maskiter, bmp->wordmask,
- min / EBITMAP_ELT_BITS);
+ unsigned unused;
+ bmp_iter_set_init (&i->maskiter, bmp->wordmask,
+ min / EBITMAP_ELT_BITS, &unused);
i->size = bmp->numwords;
if (i->size == 0)
{
@@ -131,14 +132,15 @@ static inline bool
ebitmap_iter_cond (ebitmap_iterator *i, unsigned int *n)
{
unsigned int ourn = 0;
+ unsigned unused;
if (i->size == 0)
return false;
if (i->word == 0)
{
- sbitmap_iter_next (&i->maskiter);
- if (!sbitmap_iter_cond (&i->maskiter, &ourn))
+ bmp_iter_next (&i->maskiter, &unused);
+ if (!bmp_iter_set (&i->maskiter, &ourn))
return false;
i->bit_num = ourn * EBITMAP_ELT_BITS;
i->word = i->ptr[i->eltnum++];
diff --git a/gcc/gcse.c b/gcc/gcse.c
index b1048feb78e..d97ad34a498 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -1930,7 +1930,7 @@ prune_insertions_deletions (int n_elems)
needs to be inserted. */
for (i = 0; i < (unsigned) n_edges; i++)
{
- EXECUTE_IF_SET_IN_SBITMAP (pre_insert_map[i], 0, j, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (pre_insert_map[i], 0, j, sbi)
insertions[j]++;
}
@@ -1938,7 +1938,7 @@ prune_insertions_deletions (int n_elems)
edges. */
for (i = 0; i < (unsigned) last_basic_block; i++)
{
- EXECUTE_IF_SET_IN_SBITMAP (pre_delete_map[i], 0, j, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (pre_delete_map[i], 0, j, sbi)
deletions[j]++;
}
@@ -1952,7 +1952,7 @@ prune_insertions_deletions (int n_elems)
bitmap_set_bit (prune_exprs, j);
/* Now prune PRE_INSERT_MAP and PRE_DELETE_MAP based on PRUNE_EXPRS. */
- EXECUTE_IF_SET_IN_SBITMAP (prune_exprs, 0, j, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (prune_exprs, 0, j, sbi)
{
for (i = 0; i < (unsigned) n_edges; i++)
bitmap_clear_bit (pre_insert_map[i], j);
@@ -2943,7 +2943,7 @@ should_hoist_expr_to_dom (basic_block expr_bb, struct expr *expr,
pressure for basic blocks newly added in hoisted_bbs. */
if (flag_ira_hoist_pressure && !pred)
{
- EXECUTE_IF_SET_IN_SBITMAP (visited, 0, i, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (visited, 0, i, sbi)
if (!bitmap_bit_p (hoisted_bbs, i))
{
bitmap_set_bit (hoisted_bbs, i);
diff --git a/gcc/ira-lives.c b/gcc/ira-lives.c
index 7de047f7a27..78206f35381 100644
--- a/gcc/ira-lives.c
+++ b/gcc/ira-lives.c
@@ -1480,7 +1480,7 @@ remove_some_program_points_and_update_live_ranges (void)
map = (int *) ira_allocate (sizeof (int) * ira_max_point);
n = -1;
prev_born_p = prev_dead_p = false;
- EXECUTE_IF_SET_IN_SBITMAP (born_or_dead, 0, i, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (born_or_dead, 0, i, sbi)
{
born_p = bitmap_bit_p (born, i);
dead_p = bitmap_bit_p (dead, i);
diff --git a/gcc/lower-subreg.c b/gcc/lower-subreg.c
index 1949ec14faa..7fbba70fc01 100644
--- a/gcc/lower-subreg.c
+++ b/gcc/lower-subreg.c
@@ -1589,7 +1589,7 @@ decompose_multiword_subregs (bool decompose_copies)
of a basic block, split those blocks now. Note that we only handle
the case where splitting a load has caused multiple possibly trapping
loads to appear. */
- EXECUTE_IF_SET_IN_SBITMAP (sub_blocks, 0, i, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (sub_blocks, 0, i, sbi)
{
rtx insn, end;
edge fallthru;
diff --git a/gcc/lra-lives.c b/gcc/lra-lives.c
index f03e8ef9b7e..64643459af0 100644
--- a/gcc/lra-lives.c
+++ b/gcc/lra-lives.c
@@ -789,7 +789,7 @@ remove_some_program_points_and_update_live_ranges (void)
map = XCNEWVEC (int, lra_live_max_point);
n = -1;
prev_born_p = prev_dead_p = false;
- EXECUTE_IF_SET_IN_SBITMAP (born_or_dead, 0, i, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (born_or_dead, 0, i, sbi)
{
born_p = bitmap_bit_p (born, i);
dead_p = bitmap_bit_p (dead, i);
diff --git a/gcc/modulo-sched.c b/gcc/modulo-sched.c
index b9e6d983132..2d7c9e932a4 100644
--- a/gcc/modulo-sched.c
+++ b/gcc/modulo-sched.c
@@ -615,7 +615,7 @@ schedule_reg_move (partial_schedule_ptr ps, int i_reg_move,
/* Handle the dependencies between the move and previously-scheduled
successors. */
- EXECUTE_IF_SET_IN_SBITMAP (move->uses, 0, u, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (move->uses, 0, u, sbi)
{
this_insn = ps_rtl_insn (ps, u);
this_latency = insn_latency (move->insn, this_insn);
@@ -829,7 +829,7 @@ apply_reg_moves (partial_schedule_ptr ps)
unsigned int i_use;
sbitmap_iterator sbi;
- EXECUTE_IF_SET_IN_SBITMAP (move->uses, 0, i_use, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (move->uses, 0, i_use, sbi)
{
replace_rtx (ps->g->nodes[i_use].insn, move->old_reg, move->new_reg);
df_insn_rescan (ps->g->nodes[i_use].insn);
@@ -2664,7 +2664,7 @@ find_max_asap (ddg_ptr g, sbitmap nodes)
int result = -1;
sbitmap_iterator sbi;
- EXECUTE_IF_SET_IN_SBITMAP (nodes, 0, u, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (nodes, 0, u, sbi)
{
ddg_node_ptr u_node = &g->nodes[u];
@@ -2686,7 +2686,7 @@ find_max_hv_min_mob (ddg_ptr g, sbitmap nodes)
int result = -1;
sbitmap_iterator sbi;
- EXECUTE_IF_SET_IN_SBITMAP (nodes, 0, u, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (nodes, 0, u, sbi)
{
ddg_node_ptr u_node = &g->nodes[u];
@@ -2715,7 +2715,7 @@ find_max_dv_min_mob (ddg_ptr g, sbitmap nodes)
int result = -1;
sbitmap_iterator sbi;
- EXECUTE_IF_SET_IN_SBITMAP (nodes, 0, u, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (nodes, 0, u, sbi)
{
ddg_node_ptr u_node = &g->nodes[u];
diff --git a/gcc/sbitmap.c b/gcc/sbitmap.c
index 757d7501b32..191c8263a28 100644
--- a/gcc/sbitmap.c
+++ b/gcc/sbitmap.c
@@ -656,7 +656,7 @@ bitmap_first_set_bit (const_sbitmap bmap)
unsigned int n = 0;
sbitmap_iterator sbi;
- EXECUTE_IF_SET_IN_SBITMAP (bmap, 0, n, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (bmap, 0, n, sbi)
return n;
return -1;
}
diff --git a/gcc/sbitmap.h b/gcc/sbitmap.h
index 02e3c8147c8..96590d4e176 100644
--- a/gcc/sbitmap.h
+++ b/gcc/sbitmap.h
@@ -45,7 +45,7 @@ along with GCC; see the file COPYING3. If not see
* cardinality : sbitmap_popcount
* choose_one : bitmap_first_set_bit /
bitmap_last_set_bit
- * forall : EXECUTE_IF_SET_IN_SBITMAP
+ * forall : EXECUTE_IF_SET_IN_BITMAP
* set_copy : bitmap_copy / bitmap_copy_n
* set_intersection : bitmap_and
* set_union : bitmap_ior
@@ -177,7 +177,8 @@ typedef struct {
MIN. */
static inline void
-sbitmap_iter_init (sbitmap_iterator *i, const_sbitmap bmp, unsigned int min)
+bmp_iter_set_init (sbitmap_iterator *i, const_sbitmap bmp,
+ unsigned int min, unsigned *bit_no ATTRIBUTE_UNUSED)
{
i->word_num = min / (unsigned int) SBITMAP_ELT_BITS;
i->bit_num = min;
@@ -196,7 +197,7 @@ sbitmap_iter_init (sbitmap_iterator *i, const_sbitmap bmp, unsigned int min)
false. */
static inline bool
-sbitmap_iter_cond (sbitmap_iterator *i, unsigned int *n)
+bmp_iter_set (sbitmap_iterator *i, unsigned int *n)
{
/* Skip words that are zeros. */
for (; i->word == 0; i->word = i->ptr[i->word_num])
@@ -222,7 +223,7 @@ sbitmap_iter_cond (sbitmap_iterator *i, unsigned int *n)
/* Advance to the next bit. */
static inline void
-sbitmap_iter_next (sbitmap_iterator *i)
+bmp_iter_next (sbitmap_iterator *i, unsigned *bit_no ATTRIBUTE_UNUSED)
{
i->word >>= 1;
i->bit_num++;
@@ -232,38 +233,13 @@ sbitmap_iter_next (sbitmap_iterator *i)
iteration, N is set to the index of the bit being visited. ITER is
an instance of sbitmap_iterator used to iterate the bitmap. */
-#define EXECUTE_IF_SET_IN_SBITMAP(SBITMAP, MIN, N, ITER) \
- for (sbitmap_iter_init (&(ITER), (SBITMAP), (MIN)); \
- sbitmap_iter_cond (&(ITER), &(N)); \
- sbitmap_iter_next (&(ITER)))
-
-#define EXECUTE_IF_SET_IN_SBITMAP_REV(SBITMAP, N, CODE) \
-do { \
- unsigned int word_num_; \
- unsigned int bit_num_; \
- unsigned int size_ = (SBITMAP)->size; \
- SBITMAP_ELT_TYPE *ptr_ = (SBITMAP)->elms; \
- \
- for (word_num_ = size_; word_num_ > 0; word_num_--) \
- { \
- SBITMAP_ELT_TYPE word_ = ptr_[word_num_ - 1]; \
- \
- if (word_ != 0) \
- for (bit_num_ = SBITMAP_ELT_BITS; bit_num_ > 0; bit_num_--) \
- { \
- SBITMAP_ELT_TYPE _mask = (SBITMAP_ELT_TYPE)1 << (bit_num_ - 1);\
- \
- if ((word_ & _mask) != 0) \
- { \
- word_ &= ~ _mask; \
- (N) = (word_num_ - 1) * SBITMAP_ELT_BITS + bit_num_ - 1;\
- CODE; \
- if (word_ == 0) \
- break; \
- } \
- } \
- } \
-} while (0)
+#ifndef EXECUTE_IF_SET_IN_BITMAP
+/* See bitmap.h for the other definition of EXECUTE_IF_SET_IN_BITMAP. */
+#define EXECUTE_IF_SET_IN_BITMAP(BITMAP, MIN, BITNUM, ITER) \
+ for (bmp_iter_set_init (&(ITER), (BITMAP), (MIN), &(BITNUM)); \
+ bmp_iter_set (&(ITER), &(BITNUM)); \
+ bmp_iter_next (&(ITER), &(BITNUM)))
+#endif
inline void sbitmap_free (sbitmap map)
{
diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c
index 4334a62908f..46edff864a1 100644
--- a/gcc/sched-rgn.c
+++ b/gcc/sched-rgn.c
@@ -342,7 +342,7 @@ extract_edgelst (sbitmap set, edgelst *el)
el->nr_members = 0;
/* Iterate over each word in the bitset. */
- EXECUTE_IF_SET_IN_SBITMAP (set, 0, i, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (set, 0, i, sbi)
{
edgelst_table[edgelst_last++] = rgn_edges[i];
el->nr_members++;
diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c
index 3098e1f1ffc..c5789663f8a 100644
--- a/gcc/tree-into-ssa.c
+++ b/gcc/tree-into-ssa.c
@@ -2673,12 +2673,12 @@ prepare_names_to_update (bool insert_phi_p)
/* First process names in NEW_SSA_NAMES. Otherwise, uses of old
names may be considered to be live-in on blocks that contain
definitions for their replacements. */
- EXECUTE_IF_SET_IN_SBITMAP (new_ssa_names, 0, i, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (new_ssa_names, 0, i, sbi)
prepare_def_site_for (ssa_name (i), insert_phi_p);
/* If an old name is in NAMES_TO_RELEASE, we cannot remove it from
OLD_SSA_NAMES, but we have to ignore its definition site. */
- EXECUTE_IF_SET_IN_SBITMAP (old_ssa_names, 0, i, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (old_ssa_names, 0, i, sbi)
{
if (names_to_release == NULL || !bitmap_bit_p (names_to_release, i))
prepare_def_site_for (ssa_name (i), insert_phi_p);
@@ -2738,7 +2738,7 @@ dump_update_ssa (FILE *file)
fprintf (file, "N_i -> { O_1 ... O_j } means that N_i replaces "
"O_1, ..., O_j\n\n");
- EXECUTE_IF_SET_IN_SBITMAP (new_ssa_names, 0, i, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (new_ssa_names, 0, i, sbi)
dump_names_replaced_by (file, ssa_name (i));
}
@@ -3242,7 +3242,7 @@ update_ssa (unsigned update_flags)
for traversal. */
sbitmap tmp = sbitmap_alloc (SBITMAP_SIZE (old_ssa_names));
bitmap_copy (tmp, old_ssa_names);
- EXECUTE_IF_SET_IN_SBITMAP (tmp, 0, i, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (tmp, 0, i, sbi)
insert_updated_phi_nodes_for (ssa_name (i), dfs, blocks_to_update,
update_flags);
sbitmap_free (tmp);
@@ -3266,7 +3266,7 @@ update_ssa (unsigned update_flags)
/* Reset the current definition for name and symbol before renaming
the sub-graph. */
- EXECUTE_IF_SET_IN_SBITMAP (old_ssa_names, 0, i, sbi)
+ EXECUTE_IF_SET_IN_BITMAP (old_ssa_names, 0, i, sbi)
get_ssa_name_ann (ssa_name (i))->info.current_def = NULL_TREE;
FOR_EACH_VEC_ELT (tree, symbols_to_rename, i, sym)
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index 3be33ed4a7b..3503c6411a6 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -1324,7 +1324,7 @@ undistribute_ops_list (enum tree_code opcode,
ctable = htab_create (15, oecount_hash, oecount_eq, NULL);
subops = XCNEWVEC (VEC (operand_entry_t, heap) *,
VEC_length (operand_entry_t, *ops));
- EXECUTE_IF_SET_IN_SBITMAP (candidates, 0, i, sbi0)
+ EXECUTE_IF_SET_IN_BITMAP (candidates, 0, i, sbi0)
{
gimple oedef;
enum tree_code oecode;
@@ -1389,7 +1389,7 @@ undistribute_ops_list (enum tree_code opcode,
the common operand in their inner chain. */
bitmap_clear (candidates2);
nr_candidates2 = 0;
- EXECUTE_IF_SET_IN_SBITMAP (candidates, 0, i, sbi0)
+ EXECUTE_IF_SET_IN_BITMAP (candidates, 0, i, sbi0)
{
gimple oedef;
enum tree_code oecode;
@@ -1431,7 +1431,7 @@ undistribute_ops_list (enum tree_code opcode,
print_generic_expr (dump_file, oe1->op, 0);
}
zero_one_operation (&oe1->op, c->oecode, c->op);
- EXECUTE_IF_SET_IN_SBITMAP (candidates2, first+1, i, sbi0)
+ EXECUTE_IF_SET_IN_BITMAP (candidates2, first+1, i, sbi0)
{
gimple sum;
oe2 = VEC_index (operand_entry_t, *ops, i);