diff options
author | liuhongt <hongtao.liu@intel.com> | 2020-09-26 15:08:32 +0800 |
---|---|---|
committer | liuhongt <hongtao.liu@intel.com> | 2020-10-22 10:28:56 +0800 |
commit | 4de7b010038933dd6ca96bf186ca49f243d0def6 (patch) | |
tree | f6564cb47f71a34dfe28aa96dfc8f3e70b5a270d /gcc/recog.c | |
parent | 76835dca95ab9f3f106a0db1e6152ad0740b38b3 (diff) | |
download | gcc-4de7b010038933dd6ca96bf186ca49f243d0def6.zip gcc-4de7b010038933dd6ca96bf186ca49f243d0def6.tar.gz gcc-4de7b010038933dd6ca96bf186ca49f243d0def6.tar.bz2 |
Extend special_memory_constraint.
For operand with special_memory_constraint, there could be a wrapper
for memory_operand. Extract mem for operand for conditional judgement
like MEM_P, also for record_address_regs.
gcc/ChangeLog:
PR target/87767
* ira-costs.c (record_operand_costs): Extract memory operand
from recog_data.operand[i] for record_address_regs.
(record_reg_classes): Extract memory operand from OP for
conditional judgement MEM_P.
* ira.c (ira_setup_alts): Ditto.
* lra-constraints.c (extract_mem_from_operand): New function.
(satisfies_memory_constraint_p): Extract memory operand from
OP for decompose_mem_address, return false when there's no
memory operand inside OP.
(process_alt_operands): Remove MEM_P (op) since it would be
judged in satisfies_memory_constraint_p.
* recog.c (asm_operand_ok): Extract memory operand from OP for
judgement of memory_operand (OP, VOIDmode).
(constrain_operands): Don't unwrapper unary operator when
there's memory operand inside.
* rtl.h (extract_mem_from_operand): New decl.
Diffstat (limited to 'gcc/recog.c')
-rw-r--r-- | gcc/recog.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/recog.c b/gcc/recog.c index ce83b7f..d3552ec 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -1798,7 +1798,8 @@ asm_operand_ok (rtx op, const char *constraint, const char **constraints) case CT_MEMORY: case CT_SPECIAL_MEMORY: /* Every memory operand can be reloaded to fit. */ - result = result || memory_operand (op, VOIDmode); + result = result || memory_operand (extract_mem_from_operand (op), + VOIDmode); break; case CT_ADDRESS: @@ -2584,7 +2585,9 @@ constrain_operands (int strict, alternative_mask alternatives) /* A unary operator may be accepted by the predicate, but it is irrelevant for matching constraints. */ - if (UNARY_P (op)) + /* For special_memory_operand, there could be a memory operand inside, + and it would cause a mismatch for constraint_satisfied_p. */ + if (UNARY_P (op) && op == extract_mem_from_operand (op)) op = XEXP (op, 0); if (GET_CODE (op) == SUBREG) |