Commit e61d7b78 by Kazu Hirata Committed by Kazu Hirata

tree-cfg.c (thread_jumps): Use a do-while loop instead of a loop with goto.

	* tree-cfg.c (thread_jumps): Use a do-while loop instead of a
	loop with goto.

From-SVN: r89276
parent e836a5a2
2004-10-19 Kazu Hirata <kazu@cs.umass.edu>
* tree-cfg.c (thread_jumps): Use a do-while loop instead of a
loop with goto.
2004-10-19 Kazu Hirata <kazu@cs.umass.edu>
* expr.c (expand_assignment): Remove the last argument.
Change the return type to void.
* expr.h: Update the prototype of expand_assignment.
......
......@@ -3781,7 +3781,8 @@ thread_jumps (void)
FOR_EACH_BB (bb)
bb_ann (bb)->forwardable = tree_forwarder_block_p (bb);
restart:
do
{
rerun = false;
FOR_EACH_BB (bb)
{
......@@ -3846,7 +3847,8 @@ thread_jumps (void)
nodes that will need updating. */
dest = last->src;
/* That might mean that no forwarding at all is possible. */
/* That might mean that no forwarding at all is
possible. */
if (dest == e->dest)
{
ei_next (&ei);
......@@ -3864,7 +3866,9 @@ thread_jumps (void)
/* Update the profile. */
if (profile_status != PROFILE_ABSENT)
for (curr = old_dest; curr != dest; curr = EDGE_SUCC (curr, 0)->dest)
for (curr = old_dest;
curr != dest;
curr = EDGE_SUCC (curr, 0)->dest)
{
curr->frequency -= freq;
if (curr->frequency < 0)
......@@ -3879,9 +3883,10 @@ thread_jumps (void)
if (!old)
{
/* Update PHI nodes. We know that the new argument should
have the same value as the argument associated with LAST.
Otherwise we would have changed our target block above. */
/* Update PHI nodes. We know that the new argument
should have the same value as the argument
associated with LAST. Otherwise we would have
changed our target block above. */
for (phi = phi_nodes (dest); phi; phi = PHI_CHAIN (phi))
{
arg = phi_arg_from_edge (phi, last);
......@@ -3907,14 +3912,15 @@ thread_jumps (void)
/* Update the dominators. */
if (dom_info_available_p (CDI_DOMINATORS))
{
/* If the dominator of the destination was in the path, set its
dominator to the start of the redirected edge. */
/* If the dominator of the destination was in the
path, set its dominator to the start of the
redirected edge. */
if (get_immediate_dominator (CDI_DOMINATORS, old_dest) == NULL)
set_immediate_dominator (CDI_DOMINATORS, old_dest, bb);
/* Now proceed like if we forwarded just over one edge at a time.
Algorithm for forwarding edge S --> A over edge A --> B then
is
/* Now proceed like if we forwarded just over one
edge at a time. Algorithm for forwarding edge
S --> A over edge A --> B then is
if (idom (B) == A
&& !dominated_by (S, B))
......@@ -3939,15 +3945,15 @@ thread_jumps (void)
}
/* If we succeeded in threading a jump at BB, update the
forwardable mark as BB may have become a new forwarder block.
This could happen if we have a useless "if" statement whose
two arms eventually merge without any intervening
statements. */
forwardable mark as BB may have become a new forwarder
block. This could happen if we have a useless "if"
statement whose two arms eventually merge without any
intervening statements. */
if (this_jump_threaded && tree_forwarder_block_p (bb))
bb_ann (bb)->forwardable = rerun = true;
}
if (rerun)
goto restart;
}
while (rerun);
return retval;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment