[tree-ssa] computed goto edges

law@redhat.com law@redhat.com
Wed Jul 2 20:31:00 GMT 2003


In message <wvlisqkwvc9.fsf@prospero.boston.redhat.com>, Jason Merrill writes:
 >make_goto_expr_edges says,
 >
 >      /* The RTL CFG code got this wrong.  A computed goto creates
 >         normal edges, except for one case.  Namely a computed goto
 >         in a nested function has an abnormal edge to the exit block
 >         (which is handled elsewhere).  */
 >
 >But how do you split critical edges from a computed goto like the ones in
 >gcc.c-torture/execute/920302-1.c?  You have code like
Hmmm, I must have been on drugs.  I'm not sure what led me to the
conclusion that the RTL code was wrong....

 >Interestingly, however, it is trying to add the same code on each of the
 >outgoing edges, so that the .optimized dump looks like
 >
 >...
 >  goto F.18;;
 >  ip = F.14;
 >  bp = F.13;
 >  ip = F.14;
 >  bp = F.13;
 >  bp = F.13;
 >  y:;;
 >...
 >
 >It seems like unssa should also detect the case where all incoming or
 >outgoing edges have the same phi node, so splitting is unnecessary.
Yea.  At one time I added (or at least explored) code to commonize 
edge insertions.  ie, if you had a bunch of edges with the same target
and the same copies, then you created a block and vectored those edges
to the single block.  With work something similar could probably be done
with common outgoing edges.

jeff




More information about the Gcc mailing list