Commit 84c672b9 by Jeff Law Committed by Jeff Law

tree-ssa-phiopt.c (value_replacement): Handle the case where the desired edge…

tree-ssa-phiopt.c (value_replacement): Handle the case where the desired edge out of COND_BLOCK reaches OTHER_BLOCK...

	* tree-ssa-phiopt.c (value_replacement): Handle the case where
	the desired edge out of COND_BLOCK reaches OTHER_BLOCK rather than
	BB directly.

From-SVN: r82031
parent 0aea6467
2004-05-19 Jeff Law <law@redhat.com>
* tree-ssa-phiopt.c (value_replacement): Handle the case where
the desired edge out of COND_BLOCK reaches OTHER_BLOCK rather than
BB directly.
2004-05-19 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz> 2004-05-19 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
PR c++/15463 PR c++/15463
......
...@@ -464,7 +464,20 @@ value_replacement (basic_block bb, tree phi, tree arg0, tree arg1) ...@@ -464,7 +464,20 @@ value_replacement (basic_block bb, tree phi, tree arg0, tree arg1)
edge e; edge e;
tree arg; tree arg;
/* For NE_EXPR, we want to build an assignment result = arg where
arg is the PHI argument associated with the true edge. For
EQ_EXPR we want the PHI argument associated with the false edge. */
e = (TREE_CODE (cond) == NE_EXPR ? true_edge : false_edge); e = (TREE_CODE (cond) == NE_EXPR ? true_edge : false_edge);
/* Unfortunately, E may not reach BB (it may instead have gone to
OTHER_BLOCK). If that is the case, then we want the single outgoing
edge from OTHER_BLOCK which reaches BB and represents the desired
path from COND_BLOCK. */
if (e->dest == other_block)
e = e->dest->succ;
/* Now we know the incoming edge to BB that has the argument for the
RHS of our new assignment statement. */
if (PHI_ARG_EDGE (phi, 0) == e) if (PHI_ARG_EDGE (phi, 0) == e)
arg = arg0; arg = arg0;
else else
......
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