diff options
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/basic-block.h | 2 | ||||
-rw-r--r-- | gcc/cfg.c | 40 | ||||
-rw-r--r-- | gcc/cfglayout.c | 5 |
4 files changed, 40 insertions, 14 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 202ded1..2125c09 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2003-03-10 Michael Matz <matz@suse.de> + + * cfg.c (unchecked_make_edge): New. + (cached_make_edge): Use it. + * basic-block.h (unchecked_make_edge): Declare. + * cfglayout.c (cfg_layout_duplicate_bb): Use it. + 2003-03-10 Richard Earnshaw <rearnsha@arm.com> * fpa.md: New file. Move all patterns relating to FPA co-processor diff --git a/gcc/basic-block.h b/gcc/basic-block.h index e62419f..fce7de5 100644 --- a/gcc/basic-block.h +++ b/gcc/basic-block.h @@ -345,6 +345,8 @@ extern void remove_fake_edges PARAMS ((void)); extern void add_noreturn_fake_exit_edges PARAMS ((void)); extern void connect_infinite_loops_to_exit PARAMS ((void)); extern int flow_call_edges_add PARAMS ((sbitmap)); +extern edge unchecked_make_edge PARAMS ((basic_block, + basic_block, int)); extern edge cached_make_edge PARAMS ((sbitmap *, basic_block, basic_block, int)); extern edge make_edge PARAMS ((basic_block, @@ -280,6 +280,32 @@ expunge_block (b) pool_free (bb_pool, b); } +/* Create an edge connecting SRC and DEST with flags FLAGS. Return newly + created edge. Use this only if you are sure that this edge can't + possibly already exist. */ + +edge +unchecked_make_edge (src, dst, flags) + basic_block src, dst; + int flags; +{ + edge e; + e = pool_alloc (edge_pool); + memset (e, 0, sizeof (*e)); + n_edges++; + + e->succ_next = src->succ; + e->pred_next = dst->pred; + e->src = src; + e->dest = dst; + e->flags = flags; + + src->succ = e; + dst->pred = e; + + return e; +} + /* Create an edge connecting SRC and DST with FLAGS optionally using edge cache CACHE. Return the new edge, NULL if already exist. */ @@ -320,19 +346,7 @@ cached_make_edge (edge_cache, src, dst, flags) break; } - - e = pool_alloc (edge_pool); - memset (e, 0, sizeof (*e)); - n_edges++; - - e->succ_next = src->succ; - e->pred_next = dst->pred; - e->src = src; - e->dest = dst; - e->flags = flags; - - src->succ = e; - dst->pred = e; + e = unchecked_make_edge (src, dst, flags); if (use_edge_cache) SET_BIT (edge_cache[src->index], dst->index); diff --git a/gcc/cfglayout.c b/gcc/cfglayout.c index 04ba2ec..1f4f8fc 100644 --- a/gcc/cfglayout.c +++ b/gcc/cfglayout.c @@ -980,7 +980,10 @@ cfg_layout_duplicate_bb (bb, e) new_bb->flags = bb->flags; for (s = bb->succ; s; s = s->succ_next) { - n = make_edge (new_bb, s->dest, s->flags); + /* Since we are creating edges from a new block to successors + of another block (which therefore are known to be disjoint), there + is no need to actually check for duplicated edges. */ + n = unchecked_make_edge (new_bb, s->dest, s->flags); n->probability = s->probability; if (new_count) /* Take care for overflows! */ |