This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix -fcompare-debug issue in reload1 (PR debug/46252)
On Tue, Nov 02, 2010 at 07:42:43PM +0100, Eric Botcazou wrote:
> > delete_dead_insn removes unused preceeding insn, but will not do that
> > if there are debug insns in between.
> > Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for
> > trunk?
> > 2010-11-01 Jakub Jelinek <firstname.lastname@example.org>
> > PR debug/46252
> > * rtl.h (prev_real_nondebug_insn): New prototype.
> > * emit-rtl.c (prev_real_nondebug_insn): New function.
> > * reload1.c (delete_dead_insn): Use it instead of
> > prev_real_insn.
> > * cfgcleanup.c (try_head_merge_bb): Likewise.
> The question is, shouldn't prev_real_insn (and next_real_insn) avoid returning
> a DEBUG_INSN in the first place? The remaining use of prev_real_insn seems
> to want prev_real_nondebug_insn as well.
For prev_real_insn I think you're right, the remaining two uses also do want
to skip debug insns. For next_real_insn I'm not that sure, it is used e.g.
in the scheduler where we want to see debug insns.
Having prev_real_insn skip debug insns and next_real_insn not skip them
would be inconsistent though.