This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix PRs middle-end/15014 and middle-end/16973,removing labels with their address taken
On Sun, 2004-10-10 at 11:52, Andrew Pinski wrote:
> On Oct 5, 2004, at 6:35 PM, Jeffrey A Law wrote:
> >> ChangeLog:
> >> * tre-cfg.c (make_edges): After making the edges but before
> >> cleaning up the cfg, make an edge from the first BB to ever
> >> BB which we take the address of the label.
> > If we're going to allow this, then I would strongly recommend
> > against this approach to the problem. Instead just move
> > these labels to the start of their nearest following block that
> > is reachable.
> Actually this was easier than I thought.
> And here is the patch which fixes this problem, the way you recommended.
> I had forgot that remove_bb was actually doing the removal of
> OK? Bootstrapped and tested on PPC-darwin.
> Andrew Pinski
> * tree-cfg.c (remove_bb): If we have a label expression in the
> basic block and the label we have taken the address, move the
> label expression to the basic block which is previous in the
> linked list.
> (tree_verify_flow_info): Fix printing out the label name of the
> problematic label expression.
It appears that you move the label to the start of the previous
block, which is probably OK. I would have moved the label to
the start of the next block which would probably have been less
disruptive in terms of the location of the label. However, given
the label is not reachable in the flow sense that's probably OK.