diff options
author | Jan Hubicka <hubicka@paru.cas.cz> | 1999-04-06 18:21:09 +0200 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 1999-04-06 09:21:09 -0700 |
commit | 1e7d57a3b1f7bcd100a632033a148995261b1b9c (patch) | |
tree | f94a640d6af468c10d7c52b0a1e86b204ba6f224 /gcc/flow.c | |
parent | 2454beafbaa21ee0ede1adb06625760ff41d1448 (diff) | |
download | gcc-1e7d57a3b1f7bcd100a632033a148995261b1b9c.zip gcc-1e7d57a3b1f7bcd100a632033a148995261b1b9c.tar.gz gcc-1e7d57a3b1f7bcd100a632033a148995261b1b9c.tar.bz2 |
Jan Hubicka <hubicka@paru.cas.cz>
Jan Hubicka <hubicka@paru.cas.cz>
* flow.c (split_edge) update correctly flow graph, disable
EDGE_CRITICAL flag on the split edge, update NUSES for new label.
From-SVN: r26222
Diffstat (limited to 'gcc/flow.c')
-rw-r--r-- | gcc/flow.c | 25 |
1 files changed, 17 insertions, 8 deletions
@@ -1180,6 +1180,7 @@ split_edge (edge_in) for (pp = &old_succ->pred; *pp != edge_in; pp = &(*pp)->pred_next) continue; *pp = edge_in->pred_next; + edge_in->pred_next = NULL; } /* Create the new structures. */ @@ -1207,9 +1208,18 @@ split_edge (edge_in) /* Wire them up. */ bb->pred = edge_in; bb->succ = edge_out; + edge_in->dest = bb; + edge_in->flags &= ~EDGE_CRITICAL; + + edge_out->pred_next = old_succ->pred; + edge_out->succ_next = NULL; edge_out->src = bb; edge_out->dest = old_succ; + edge_out->flags = EDGE_FALLTHRU; + edge_out->probability = REG_BR_PROB_BASE; + + old_succ->pred = edge_out; /* Tricky case -- if there existed a fallthru into the successor (and we're not it) we must add a new unconditional jump around @@ -1222,7 +1232,7 @@ split_edge (edge_in) if ((edge_in->flags & EDGE_FALLTHRU) == 0) { edge e; - for (e = old_succ->pred; e ; e = e->pred_next) + for (e = edge_out->pred_next; e ; e = e->pred_next) if (e->flags & EDGE_FALLTHRU) break; @@ -1236,7 +1246,6 @@ split_edge (edge_in) /* Non critical -- we can simply add a jump to the end of the existing predecessor. */ jump_block = e->src; - pos = jump_block->end; } else { @@ -1245,13 +1254,16 @@ split_edge (edge_in) call ourselves. */ jump_block = split_edge (e); e = jump_block->succ; - pos = jump_block->head; } - /* Now add the jump insn... */ - pos = emit_jump_insn_after (gen_jump (old_succ->head), pos); + /* Now add the jump insn ... */ + pos = emit_jump_insn_after (gen_jump (old_succ->head), + jump_block->end); jump_block->end = pos; emit_barrier_after (pos); + + /* ... let jump know that label is in use, ... */ + ++LABEL_NUSES (old_succ->head); /* ... and clear fallthru on the outgoing edge. */ e->flags &= ~EDGE_FALLTHRU; @@ -1331,9 +1343,6 @@ split_edge (edge_in) bb->head = new_label; } - /* In all cases, the new block falls through to the successor. */ - edge_out->flags = EDGE_FALLTHRU; - return bb; } |