On 13-02-07 7:27 PM, Jakub Jelinek wrote:
Hi!

As the following testcase shows, get_reload_reg could sometimes return
a reused reg in a wrong mode.  If curr_insn_input_reloads[i].input
and original have VOIDmode, they could compare equal (same integer
constant), yet mode might be different from
GET_MODE (curr_insn_input_reloads[i].reg).
If we need a wider reg than we already have, we can't reuse it easily,
but if we need a narrower one, we can just use a subreg of the wider one.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2013-02-07  Jakub Jelinek  <ja...@redhat.com>

        PR rtl-optimization/56195
        * lra-constraints.c (get_reload_reg): Don't reuse regs
        if they have smaller mode than requested, if they have
        wider mode than requested, try to return a SUBREG.

        * gcc.dg/torture/pr56195.c: New test.

Sure, Jakub.  Thanks.

Reply via email to