summaryrefslogtreecommitdiff
path: root/gcc/lra-constraints.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2013-01-29 07:47:38 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2013-01-29 07:47:38 +0000
commit26d37ce2ed0ec6d735e6453528b49974eae29660 (patch)
treebf73d49798603b7cda5fa78d4b6f41f2eae2abea /gcc/lra-constraints.c
parent26003052293947e0dc703c3367b4b22a8811d478 (diff)
downloadgcc-26d37ce2ed0ec6d735e6453528b49974eae29660.tar.gz
2013-01-29 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 195526 using svnmerge.py git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@195528 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lra-constraints.c')
-rw-r--r--gcc/lra-constraints.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
index 01c8cf143cf..03728b78f42 100644
--- a/gcc/lra-constraints.c
+++ b/gcc/lra-constraints.c
@@ -1847,11 +1847,27 @@ process_alt_operands (int only_alternative)
int const_to_mem = 0;
bool no_regs_p;
+ /* If this alternative asks for a specific reg class, see if there
+ is at least one allocatable register in that class. */
no_regs_p
= (this_alternative == NO_REGS
|| (hard_reg_set_subset_p
(reg_class_contents[this_alternative],
lra_no_alloc_regs)));
+
+ /* For asms, verify that the class for this alternative is possible
+ for the mode that is specified. */
+ if (!no_regs_p && REG_P (op) && INSN_CODE (curr_insn) < 0)
+ {
+ int i;
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ if (HARD_REGNO_MODE_OK (i, mode)
+ && in_hard_reg_set_p (reg_class_contents[this_alternative], mode, i))
+ break;
+ if (i == FIRST_PSEUDO_REGISTER)
+ winreg = false;
+ }
+
/* If this operand accepts a register, and if the
register class has at least one allocatable register,
then this operand can be reloaded. */
@@ -2742,10 +2758,6 @@ curr_insn_transform (void)
swap_operands (commutative);
}
- /* The operands don't meet the constraints. goal_alt describes the
- alternative that we could reach by reloading the fewest operands.
- Reload so as to fit it. */
-
if (! alt_p && ! sec_mem_p)
{
/* No alternative works with reloads?? */