A latent bug - use of BRANCH_EDGE on trees.
Steven Bosscher
stevenb@suse.de
Mon Oct 25 06:26:00 GMT 2004
On Sunday 24 October 2004 21:16, Zdenek Dvorak wrote:
> 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).
But it's really, really ugly that we would call ir_type() in
BRANCH_EDGE. We just perhaps not use BRANCH_EDGE here in the
first place.
Gr.
Steven
More information about the Gcc
mailing list