You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
#include "config.h"
#include "system.h"
/* If we have already seen an exit, mark this by the edge that
surely does not occur as any exit. */
if (loop->single_exit)
- loop->single_exit = EDGE_SUCC (ENTRY_BLOCK_PTR, 0);
+ loop->single_exit = single_succ_edge (ENTRY_BLOCK_PTR);
else
loop->single_exit = e;
}
if (!loop)
continue;
- if (loop->single_exit == EDGE_SUCC (ENTRY_BLOCK_PTR, 0))
+ if (loop->single_exit == single_succ_edge (ENTRY_BLOCK_PTR))
loop->single_exit = NULL;
}
{
alloc_aux_for_block (jump, sizeof (int));
HEADER_BLOCK (jump) = 0;
- alloc_aux_for_edge (EDGE_PRED (jump, 0), sizeof (int));
- LATCH_EDGE (EDGE_PRED (jump, 0)) = 0;
- set_immediate_dominator (CDI_DOMINATORS, jump, EDGE_PRED (jump, 0)->src);
+ alloc_aux_for_edge (single_pred_edge (jump), sizeof (int));
+ LATCH_EDGE (single_pred_edge (jump)) = 0;
+ set_immediate_dominator (CDI_DOMINATORS, jump, single_pred (jump));
}
/* A callback for make_forwarder block, to redirect all edges except for
HEADER_BLOCK (header) = num_latches;
}
- if (HEADER_BLOCK (EDGE_SUCC (ENTRY_BLOCK_PTR, 0)->dest))
+ if (HEADER_BLOCK (single_succ (ENTRY_BLOCK_PTR)))
{
basic_block bb;
/* We could not redirect edges freely here. On the other hand,
we can simply split the edge from entry block. */
- bb = split_edge (EDGE_SUCC (ENTRY_BLOCK_PTR, 0));
+ bb = split_edge (single_succ_edge (ENTRY_BLOCK_PTR));
- alloc_aux_for_edge (EDGE_SUCC (bb, 0), sizeof (int));
- LATCH_EDGE (EDGE_SUCC (bb, 0)) = 0;
+ alloc_aux_for_edge (single_succ_edge (bb), sizeof (int));
+ LATCH_EDGE (single_succ_edge (bb)) = 0;
alloc_aux_for_block (bb, sizeof (int));
HEADER_BLOCK (bb) = 0;
}
/* Gets exit edges of a LOOP, returning their number in N_EDGES. */
edge *
-get_loop_exit_edges (const struct loop *loop, unsigned int *n_edges)
+get_loop_exit_edges (const struct loop *loop, unsigned int *num_edges)
{
edge *edges, e;
unsigned i, n;
if (!flow_bb_inside_loop_p (loop, e->dest))
n++;
edges = xmalloc (n * sizeof (edge));
- *n_edges = n;
+ *num_edges = n;
n = 0;
for (i = 0; i < loop->num_nodes; i++)
FOR_EACH_EDGE (e, ei, body[i]->succs)
if (loops->parray[i]->num_nodes != sizes[i])
{
- error ("Size of loop %d should be %d, not %d.",
+ error ("size of loop %d should be %d, not %d",
i, sizes[i], loops->parray[i]->num_nodes);
err = 1;
}
for (j = 0; j < loop->num_nodes; j++)
if (!flow_bb_inside_loop_p (loop, bbs[j]))
{
- error ("Bb %d do not belong to loop %d.",
+ error ("bb %d do not belong to loop %d",
bbs[j]->index, i);
err = 1;
}
if ((loops->state & LOOPS_HAVE_PREHEADERS)
&& EDGE_COUNT (loop->header->preds) != 2)
{
- error ("Loop %d's header does not have exactly 2 entries.", i);
+ error ("loop %d's header does not have exactly 2 entries", i);
err = 1;
}
if (loops->state & LOOPS_HAVE_SIMPLE_LATCHES)
{
- if (EDGE_COUNT (loop->latch->succs) != 1)
+ if (!single_succ_p (loop->latch))
{
- error ("Loop %d's latch does not have exactly 1 successor.", i);
+ error ("loop %d's latch does not have exactly 1 successor", i);
err = 1;
}
- if (EDGE_SUCC (loop->latch, 0)->dest != loop->header)
+ if (single_succ (loop->latch) != loop->header)
{
- error ("Loop %d's latch does not have header as successor.", i);
+ error ("loop %d's latch does not have header as successor", i);
err = 1;
}
if (loop->latch->loop_father != loop)
{
- error ("Loop %d's latch does not belong directly to it.", i);
+ error ("loop %d's latch does not belong directly to it", i);
err = 1;
}
}
if (loop->header->loop_father != loop)
{
- error ("Loop %d's header does not belong directly to it.", i);
+ error ("loop %d's header does not belong directly to it", i);
err = 1;
}
if ((loops->state & LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS)
&& (loop_latch_edge (loop)->flags & EDGE_IRREDUCIBLE_LOOP))
{
- error ("Loop %d's latch is marked as part of irreducible region.", i);
+ error ("loop %d's latch is marked as part of irreducible region", i);
err = 1;
}
}
if ((bb->flags & BB_IRREDUCIBLE_LOOP)
&& !TEST_BIT (irreds, bb->index))
{
- error ("Basic block %d should be marked irreducible.", bb->index);
+ error ("basic block %d should be marked irreducible", bb->index);
err = 1;
}
else if (!(bb->flags & BB_IRREDUCIBLE_LOOP)
&& TEST_BIT (irreds, bb->index))
{
- error ("Basic block %d should not be marked irreducible.", bb->index);
+ error ("basic block %d should not be marked irreducible", bb->index);
err = 1;
}
FOR_EACH_EDGE (e, ei, bb->succs)
if ((e->flags & EDGE_IRREDUCIBLE_LOOP)
&& !(e->flags & (EDGE_ALL_FLAGS + 1)))
{
- error ("Edge from %d to %d should be marked irreducible.",
+ error ("edge from %d to %d should be marked irreducible",
e->src->index, e->dest->index);
err = 1;
}
else if (!(e->flags & EDGE_IRREDUCIBLE_LOOP)
&& (e->flags & (EDGE_ALL_FLAGS + 1)))
{
- error ("Edge from %d to %d should not be marked irreducible.",
+ error ("edge from %d to %d should not be marked irreducible",
e->src->index, e->dest->index);
err = 1;
}
if (loop->single_exit
&& loop->single_exit != e)
{
- error ("Wrong single exit %d->%d recorded for loop %d.",
+ error ("wrong single exit %d->%d recorded for loop %d",
loop->single_exit->src->index,
loop->single_exit->dest->index,
loop->num);
- error ("Right exit is %d->%d.",
+ error ("right exit is %d->%d",
e->src->index, e->dest->index);
err = 1;
}
if (sizes[i] == 1
&& !loop->single_exit)
{
- error ("Single exit not recorded for loop %d.", loop->num);
+ error ("single exit not recorded for loop %d", loop->num);
err = 1;
}
if (sizes[i] != 1
&& loop->single_exit)
{
- error ("Loop %d should not have single exit (%d -> %d).",
+ error ("loop %d should not have single exit (%d -> %d)",
loop->num,
loop->single_exit->src->index,
loop->single_exit->dest->index);