This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Analysis of Brad's GCSE problem with computed gotos.
- To: matzmich at cs dot tu-berlin dot de (Michael Matz)
- Subject: Re: Analysis of Brad's GCSE problem with computed gotos.
- From: Brad Lucier <lucier at math dot purdue dot edu>
- Date: Sat, 2 Dec 2000 02:29:46 -0500 (EST)
- Cc: gcc at gcc dot gnu dot org, lucier at math dot purdue dot edu (Brad Lucier)
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.