A latent bug - use of BRANCH_EDGE on trees.
Zdenek Dvorak
rakdver@atrey.karlin.mff.cuni.cz
Mon Oct 25 03:15:00 GMT 2004
Hello,
> > yes, this indeed is a problem. There are several solutions:
> >
> > 1) Let the caller pass the edge corresponding to the current
> > BRANCH_EDGE (switch_bb) to loopify
> > 2) Let BRANCH_EDGE check ir_type and use EDGE_{TRUE,FALSE}_FLAG for
> > trees.
> > 3) Let EDGE_FALSE_FLAG == EDGE_FALLTHRU
> >
> > I do not have any special preference here.
>
> Or
>
> 4. Do the following.
>
> if (ir_type ())
> /* We are in trees. */
> true_edge = ((EDGE_SUCC (switch_bb, 0)->flags & EDGE_TRUE_VALUE)
> ? EDGE_SUCC (switch_bb, 0)
> : EDGE_SUCC (switch_bb, 1));
> else
> /* We are in RTL. */
> true_edge = BRANCH_EDGE (switch_bb);
>
> loop_redirect_edge (true_edge, succ_bb);
>
> I guess!?
yes, but in general it is preferred not to expose such IR dependencies
directly in the high-level functions (i.e. the equivalent solution
2) is better).
Zdenek
More information about the Gcc
mailing list