[PATCH] Make the world a bit safer for cfglayout mode

Steven Bosscher stevenb.gcc@gmail.com
Sat Nov 25 11:22:00 GMT 2006

On 11/25/06, Roger Sayle <roger@eyesopen.com> wrote:
> On Fri, 24 Nov 2006, Steven Bosscher wrote:
> > >        * jump.c (mark_all_labels): Work in cfglayout mode.
> > >        * cfgcleanup.c (cleanup_cfg): Do not call delete_dead_jumptables
> > >        when in cfglayout mode, because there are no dead jumptables
> > >        visible.
> > >        * cfgrtl.c (commit_edge_insertions): Do not allow insertion
> > >        of instructions with control flow insns when in cfglayout mode.

Thank you!

> > +       for (insn = bb->il.rtl->header; insn; insn = NEXT_INSN (insn))
> > ...
> > +       for (insn = bb->il.rtl->footer; insn; insn = NEXT_INSN (insn))
> I'm a little surprised that we don't have BB_RTL_HEADER and BB_RTL_FOOTER
> macros to access these fields, but it looks like every where currently
> uses the above idiom.

There are people who wish to remove the BB_HEAD and BB_END macros
again...  I wouldn't mind adding BB_RTL_{HEADER,FOOTER}, but *very*
few passes would have to mess with the header/footer so maybe keeping
it this way is better, to discourage people from doing courageous

> Is there an easy way of identifying which passes insert RTL control flow
> insns on edges?

Sure, look through all insns in commit_one_edge_insertion and abort if
control_flow_insn_p returns true.


More information about the Gcc-patches mailing list