This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix up get_reload_reg (PR rtl-optimization/56195)


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 <jakub@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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]