This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
ping^2 [PATCH 3/9] reload_reg_free(): don't clobber inherited registers
- From: Rask Ingemann Lambertsen <rask at sygehus dot dk>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 21 Aug 2007 13:23:30 +0200
- Subject: ping^2 [PATCH 3/9] reload_reg_free(): don't clobber inherited registers
- References: <20070730134217.GK25795@sygehus.dk> <20070730150822.GN25795@sygehus.dk>
On Mon, Jul 30, 2007 at 05:08:22PM +0200, Rask Ingemann Lambertsen wrote:
> In <URL:http://gcc.gnu.org/ml/gcc/2007-06/msg00269.html>, I described a
> case where reload allocates a a register for a RELOAD_FOR_OPADDR_ADDR
> and in doing so, picks a register inherited for a
> RELOAD_FOR_OPERAND_ADDRESS, thereby clobbering the register. This patch
> fixes it by adding a test for this case.
>
> This and the other two reload patches in this patch set were bootstrapped
> and tested together on x86_64-unknown-linux-gnu with no new failures. I also
> built and tested cross compilers for arm-unknown-elf, cris-axis-elf,
> m32c-unknown-elf, mipsisa64-unknown-elf, sh-unknown-elf and v850-unknown-elf
> with no new failures.
>
> Ok for trunk?
>
> 2007-07-30 Rask Ingemann Lambertsen <rask@sygehus.dk>
>
> * reload1.c (reload_reg_free_p): A register isn't free to use in
> RELOAD_FOR_OPADDR_ADDR when already inherited for use in
> RELOAD_FOR_OPERAND_ADDRESS.
>
> Index: gcc/reload1.c
> ===================================================================
> --- gcc/reload1.c (revision 127048)
> +++ gcc/reload1.c (working copy)
> @@ -4745,8 +4745,11 @@ reload_reg_free_p (unsigned int regno, i
> case RELOAD_FOR_OPADDR_ADDR:
> for (i = 0; i < reload_n_operands; i++)
> if (TEST_HARD_REG_BIT (reload_reg_used_in_input[i], regno))
> return 0;
> + if (TEST_HARD_REG_BIT (reload_reg_used_for_inherit, regno)
> + && TEST_HARD_REG_BIT (reload_reg_used_in_op_addr, regno))
> + return 0;
>
> return (!TEST_HARD_REG_BIT (reload_reg_used_in_op_addr_reload, regno));
>
> case RELOAD_FOR_OUTPUT:
>
> --
> Rask Ingemann Lambertsen