This is the mail archive of the
mailing list for the GCC project.
Re: RFA: Fix debug-insn sensitivity in RA
- From: Steven Bosscher <stevenb dot gcc at gmail dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>, Vladimir Makarov <vmakarov at redhat dot com>, "rdsandiford at googlemail dot com" <rdsandiford at googlemail dot com>
- Date: Sat, 7 Sep 2013 13:22:06 +0200
- Subject: Re: RFA: Fix debug-insn sensitivity in RA
- Authentication-results: sourceware.org; auth=none
- References: <87a9jpj8mq dot fsf at talisman dot default>
On Sat, Sep 7, 2013 at 11:14 AM, Richard Sandiford wrote:
> The problem seems to be split across IRA and LRA. In IRA we have:
> FOR_EACH_BB (bb)
> FOR_BB_INSNS (bb, insn)
> if (! INSN_P (insn))
> for_each_rtx (&insn, set_paradoxical_subreg, (void *)pdx_subregs);
> which sets pdx_subregs[R] if R is used in a paradoxical subreg, followed by:
> /* Don't set reg (if pdx_subregs[regno] == true) equivalent to a mem. */
> if (MEM_P (src) && pdx_subregs[regno])
> note_stores (set, no_equiv, NULL);
> I think this should only happen when a paradoxical subreg is seen
> in a nondebug insn.
Agreed. Otherwise these debug insns would have influence on the
generated code and that's not supposed to happen.
> The patch below fixes the wide-int problem for me. Bootstrapped &
> regression-tested on trunk for x86_64-linux-gnu. OK to install?
> * ira.c (update_equiv_regs): Only call set_paradoxical_subreg
> for non-debug insns.
> * lra.c (new_insn_reg): Take the containing insn as a parameter.
> Only modify lra_reg_info.biggest_mode if it's non-debug insn.
> (collect_non_operand_hard_regs, add_regs_to_insn_regno_info): Update
I don't think this falls under "RTL optimizers", but the patch looks OK to me.
Can you please add a test case?