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))
> continue;
> 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);
> continue;
> }
>
> 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?
>
> Thanks,
> Richard
>
>
> gcc/
> * 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
> accordingly.
I don't think this falls under "RTL optimizers", but the patch looks OK to me.
Can you please add a test case?
Ciao!
Steven