This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Analysis of Brad's GCSE problem with computed gotos.


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]