diff options
Diffstat (limited to 'gcc/sbitmap.c')
-rw-r--r-- | gcc/sbitmap.c | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/gcc/sbitmap.c b/gcc/sbitmap.c index f1d9c86ee30..554a4258076 100644 --- a/gcc/sbitmap.c +++ b/gcc/sbitmap.c @@ -514,12 +514,14 @@ sbitmap_intersection_of_succs (sbitmap dst, sbitmap *src, int bb) basic_block b = BASIC_BLOCK (bb); unsigned int set_size = dst->size; edge e; + unsigned ix; - for (e = b->succ; e != 0; e = e->succ_next) + for (e = NULL, ix = 0; ix < EDGE_COUNT (b->succs); ix++) { + e = EDGE_SUCC (b, ix); if (e->dest == EXIT_BLOCK_PTR) continue; - + sbitmap_copy (dst, src[e->dest->index]); break; } @@ -527,11 +529,12 @@ sbitmap_intersection_of_succs (sbitmap dst, sbitmap *src, int bb) if (e == 0) sbitmap_ones (dst); else - for (e = e->succ_next; e != 0; e = e->succ_next) + for (++ix; ix < EDGE_COUNT (b->succs); ix++) { unsigned int i; sbitmap_ptr p, r; + e = EDGE_SUCC (b, ix); if (e->dest == EXIT_BLOCK_PTR) continue; @@ -551,9 +554,11 @@ sbitmap_intersection_of_preds (sbitmap dst, sbitmap *src, int bb) basic_block b = BASIC_BLOCK (bb); unsigned int set_size = dst->size; edge e; + unsigned ix; - for (e = b->pred; e != 0; e = e->pred_next) + for (e = NULL, ix = 0; ix < EDGE_COUNT (b->preds); ix++) { + e = EDGE_PRED (b, ix); if (e->src == ENTRY_BLOCK_PTR) continue; @@ -564,11 +569,12 @@ sbitmap_intersection_of_preds (sbitmap dst, sbitmap *src, int bb) if (e == 0) sbitmap_ones (dst); else - for (e = e->pred_next; e != 0; e = e->pred_next) + for (++ix; ix < EDGE_COUNT (b->preds); ix++) { unsigned int i; sbitmap_ptr p, r; + e = EDGE_PRED (b, ix); if (e->src == ENTRY_BLOCK_PTR) continue; @@ -588,9 +594,11 @@ sbitmap_union_of_succs (sbitmap dst, sbitmap *src, int bb) basic_block b = BASIC_BLOCK (bb); unsigned int set_size = dst->size; edge e; + unsigned ix; - for (e = b->succ; e != 0; e = e->succ_next) + for (ix = 0; ix < EDGE_COUNT (b->succs); ix++) { + e = EDGE_SUCC (b, ix); if (e->dest == EXIT_BLOCK_PTR) continue; @@ -598,14 +606,15 @@ sbitmap_union_of_succs (sbitmap dst, sbitmap *src, int bb) break; } - if (e == 0) + if (ix == EDGE_COUNT (b->succs)) sbitmap_zero (dst); else - for (e = e->succ_next; e != 0; e = e->succ_next) + for (ix++; ix < EDGE_COUNT (b->succs); ix++) { unsigned int i; sbitmap_ptr p, r; + e = EDGE_SUCC (b, ix); if (e->dest == EXIT_BLOCK_PTR) continue; @@ -625,8 +634,9 @@ sbitmap_union_of_preds (sbitmap dst, sbitmap *src, int bb) basic_block b = BASIC_BLOCK (bb); unsigned int set_size = dst->size; edge e; + unsigned ix; - for (e = b->pred; e != 0; e = e->pred_next) + for (e = NULL, ix = 0; ix < EDGE_COUNT (b->preds); ix++) { if (e->src== ENTRY_BLOCK_PTR) continue; @@ -635,14 +645,15 @@ sbitmap_union_of_preds (sbitmap dst, sbitmap *src, int bb) break; } - if (e == 0) + if (ix == EDGE_COUNT (b->preds)) sbitmap_zero (dst); else - for (e = e->pred_next; e != 0; e = e->pred_next) + for (ix++; ix < EDGE_COUNT (b->preds); ix++) { unsigned int i; sbitmap_ptr p, r; + e = EDGE_PRED (b, ix); if (e->src == ENTRY_BLOCK_PTR) continue; |