diff options
author | Steven Bosscher <steven@gcc.gnu.org> | 2013-01-24 10:30:26 +0000 |
---|---|---|
committer | Steven Bosscher <steven@gcc.gnu.org> | 2013-01-24 10:30:26 +0000 |
commit | e86c0101ae59b32c3f10edcca78398cbf8848eaa (patch) | |
tree | b1143716a295f25f560b0b981e81d773c0b72fc8 /gcc/lra-constraints.c | |
parent | 0e128cdc670e73b5834f3ce72f6ff66f470dc7a3 (diff) | |
download | gcc-e86c0101ae59b32c3f10edcca78398cbf8848eaa.zip gcc-e86c0101ae59b32c3f10edcca78398cbf8848eaa.tar.gz gcc-e86c0101ae59b32c3f10edcca78398cbf8848eaa.tar.bz2 |
re PR inline-asm/55934 (LRA inline asm error recovery)
gcc/
PR inline-asm/55934
* lra-assigns.c (assign_by_spills): Throw away the pattern of asms
that have operands with impossible constraints.
Add a FIXME for a speed-up opportunity.
* lra-constraints.c (process_alt_operands): Verify that a class
selected from constraints on asms is valid for the operand mode.
(curr_insn_transform): Remove incorrect comment.
testsuite/
PR inline-asm/55934
* gcc.target/i386/pr55934.c: New test.
From-SVN: r195420
Diffstat (limited to 'gcc/lra-constraints.c')
-rw-r--r-- | gcc/lra-constraints.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index 01c8cf1..03728b7 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?? */ |