Analysis of Brad's GCSE problem with computed gotos.

Brad Lucier lucier@math.purdue.edu
Fri Dec 1 23:29:00 GMT 2000


Michael:

I've been going through flow.c, gcse.c, etc., trying to find out what to do.

It seems that one should really use insert_insn_on_edge from flow.c
to add the pattern to the abnormal edge in pre_edge_insert.  (It seems
that you should use insert_insn_on_edge to add *all* patterns to *all*
edges.) It supposedly does the right thing, splitting the edge if necessary 
(well, commit_one_edge_insertion does the splitting).  Then at the end of
pre_edge_insert, call commit_edge_insertions to update all the
inserted instructions.

There seems to be a problem in optimize_mode_switching in lcm.c that
is similar to what you found in pre_edge_insert in gcse.c, in that instructions
are just inserted at the end of the previous block for ABNORMAL_EDGEs.
This should seem to use the insert_insn_on_edge/commit_edge_insertions
machinery, too, for abnormal edges.  It already uses it for some normal
edges (see line 1235), so I don't see why it wouldn't work for abnormal
edges, too.


More information about the Gcc mailing list