[patch] PR20648

Steven Bosscher stevenb@suse.de
Tue Mar 29 13:30:00 GMT 2005


Hi,

This is my proposed fix for PR20648.  We tried to redirect an abnormal
edge while unfactoring a computed goto.

Before duplicate_computed_gotos we had something like this:

BB1: pred ...
     succ BB2 (abnormal, eh)
  goto BB2;

BB2: pred BB1 (abnormal, eh)
     succ ...
  goto *somewhere;

and we tried to turn that into

BB1: pred ...
     succ ...
  goto *somewhere;

but cfg_layout_redirect_edge_and_branch refused to forward the
abnormal edge to "somewhere", and we ICEd.

Fixed by just not unfactoring blocks with incoming abnormal edges.
There is no C/C++ test case, only a Java test case (many thanks to
Tom Tromey), so I'm not sure what to do here.  But at least, with
this patch I can bootstrap and test again on ia64-unknown-linux-gnu.
There were no new regressions.

OK for mainline?
The bug may be latent on the GCC 4.0 branch.  If this works out OK
on mainline, is the patch also OK for 4.0 after a few days?

Gr.
Steven

        PR middle-end/20648
        * bb-reorder.c (duplicate_computed_gotos): Do not unfactor
        a computed goto if the edge to the computed goto block has
        incoming abnormal edges.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t
Type: application/octet-stream
Size: 1016 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20050329/c73f17a0/attachment.obj>


More information about the Gcc-patches mailing list