summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4>2013-10-31 16:00:38 +0000
committervmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4>2013-10-31 16:00:38 +0000
commit0244be3132f66bd9c87a5ab82334fa106df9c32f (patch)
tree1df522176b3ea2c9f93e301107111dccb047243b
parente2abbec1b277d16c9ab14a1fbf3bda7a42c8c28c (diff)
downloadppe42-gcc-0244be3132f66bd9c87a5ab82334fa106df9c32f.tar.gz
ppe42-gcc-0244be3132f66bd9c87a5ab82334fa106df9c32f.zip
2013-10-31 Vladimir Makarov <vmakarov@redhat.com>
* lra-constraints (process_alt_operands): Use the result elimination register for operand when matching constraints. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204267 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/lra-constraints.c27
2 files changed, 23 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 99a50346897..3da5361978f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2013-10-31 Vladimir Makarov <vmakarov@redhat.com>
+
+ * lra-constraints (process_alt_operands): Use the result
+ elimination register for operand when matching constraints.
+
2013-10-31 Jakub Jelinek <jakub@redhat.com>
* tree-vrp.c (maybe_set_nonzero_bits): New function.
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
index a2d348d8dfe..ee82c6f496c 100644
--- a/gcc/lra-constraints.c
+++ b/gcc/lra-constraints.c
@@ -1466,23 +1466,32 @@ process_alt_operands (int only_alternative)
function. */
for (nop = 0; nop < n_operands; nop++)
{
+ rtx reg;
+
op = no_subreg_reg_operand[nop] = *curr_id->operand_loc[nop];
/* The real hard regno of the operand after the allocation. */
hard_regno[nop] = get_hard_regno (op);
- operand_reg[nop] = op;
- biggest_mode[nop] = GET_MODE (operand_reg[nop]);
- if (GET_CODE (operand_reg[nop]) == SUBREG)
+ operand_reg[nop] = reg = op;
+ biggest_mode[nop] = GET_MODE (op);
+ if (GET_CODE (op) == SUBREG)
{
- operand_reg[nop] = SUBREG_REG (operand_reg[nop]);
+ operand_reg[nop] = reg = SUBREG_REG (op);
if (GET_MODE_SIZE (biggest_mode[nop])
- < GET_MODE_SIZE (GET_MODE (operand_reg[nop])))
- biggest_mode[nop] = GET_MODE (operand_reg[nop]);
+ < GET_MODE_SIZE (GET_MODE (reg)))
+ biggest_mode[nop] = GET_MODE (reg);
}
- if (REG_P (operand_reg[nop]))
- no_subreg_reg_operand[nop] = operand_reg[nop];
- else
+ if (! REG_P (reg))
operand_reg[nop] = NULL_RTX;
+ else if (REGNO (reg) >= FIRST_PSEUDO_REGISTER
+ || ((int) REGNO (reg)
+ == lra_get_elimination_hard_regno (REGNO (reg))))
+ no_subreg_reg_operand[nop] = reg;
+ else
+ operand_reg[nop] = no_subreg_reg_operand[nop]
+ /* Just use natural mode for elimination result. It should
+ be enough for extra constraints hooks. */
+ = regno_reg_rtx[hard_regno[nop]];
}
/* The constraints are made of several alternatives. Each operand's
OpenPOWER on IntegriCloud