From patchwork Tue Oct 23 20:06:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [lra] patch to prevent ASHIFT exchange and dead early clobber operand Date: Tue, 23 Oct 2012 10:06:34 -0000 From: Vladimir Makarov X-Patchwork-Id: 193564 Message-Id: <5086F8CA.3060801@redhat.com> To: gcc-patches The following patch prevents mistaken ASHIFT exchange found by Richard Sandiford and removes check early_clobber matching operand. The patch was successfully bootstrap on x86-64. Committed as rev. 192742. 2012-10-23 Vladimir Makarov * lra-constraints.c (extract_loc_address_regs): Don't swap ASHIFT operands. (process_alt_operands): Remove code for checking DEAD note for early clobber. Index: lra-constraints.c =================================================================== --- lra-constraints.c (revision 192702) +++ lra-constraints.c (working copy) @@ -639,7 +639,7 @@ extract_loc_address_regs (bool top_p, en rtx *arg0_loc = &XEXP (x, 0); enum rtx_code code0 = GET_CODE (*arg0_loc); - if (code0 == CONST_INT) + if (code0 == CONST_INT && code == MULT) arg0_loc = &XEXP (x, 1); extract_loc_address_regs (false, mode, as, arg0_loc, true, outer_code, code, modify_p, ad); @@ -1781,17 +1781,7 @@ process_alt_operands (int only_alternati match_p = false; if (operands_match_p (*curr_id->operand_loc[nop], *curr_id->operand_loc[m], m_hregno)) - { - /* We should reject matching of an early - clobber operand if the matching operand is - not dying in the insn. */ - if (! curr_static_id->operand[m].early_clobber - || operand_reg[nop] == NULL_RTX - || (find_regno_note (curr_insn, REG_DEAD, - REGNO (operand_reg[nop])) - != NULL_RTX)) - match_p = true; - } + match_p = true; if (match_p) { /* If we are matching a non-offsettable