The following patch fixes the P1 PR. The details can be found on https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65123
The patch was bootstrapped and tested on x86-64. There is no new test case as the PR is reported against a test in GCC testuite. Committed as rev.220946. 2015-02-24 Vladimir Makarov <vmaka...@redhat.com> PR rtl-optimization/65123 * lra-remat.c (operand_to_remat): Check hard regs in insn definition too.
Index: lra-remat.c =================================================================== --- lra-remat.c (revision 220916) +++ lra-remat.c (working copy) @@ -459,6 +459,16 @@ operand_to_remat (rtx_insn *insn) reg2 = reg2->next) if (reg2->type == OP_OUT && reg->regno == reg2->regno) return -1; + if (reg->regno < FIRST_PSEUDO_REGISTER) + for (struct lra_insn_reg *reg2 = static_id->hard_regs; + reg2 != NULL; + reg2 = reg2->next) + if (reg2->type == OP_OUT + && reg->regno <= reg2->regno + && (reg2->regno + < (reg->regno + + hard_regno_nregs[reg->regno][reg->biggest_mode]))) + return -1; } /* Find the rematerialization operand. */ int nop = static_id->n_operands;