From 2e0aa43fc6ae689c595902310baec604e7e0d695 Mon Sep 17 00:00:00 2001 From: liuhongt Date: Mon, 26 Oct 2020 20:46:42 +0800 Subject: Don't extract memory from operand for normal memory constraint. gcc/ChangeLog PR target/97540 * ira.c: (ira_setup_alts): Extract memory from operand only for special memory constraint. * recog.c (asm_operand_ok): Ditto. * lra-constraints.c (process_alt_operands): MEM_P is required for normal memory constraint. gcc/testsuite/ChangeLog * gcc.target/i386/pr97540.c: New test. --- gcc/lra-constraints.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/lra-constraints.c') diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index 22e7075..fbc47ba 100644 --- a/gcc/lra-constraints.c +++ b/gcc/lra-constraints.c @@ -2428,7 +2428,8 @@ process_alt_operands (int only_alternative) break; case CT_MEMORY: - if (satisfies_memory_constraint_p (op, cn)) + if (MEM_P (op) + && satisfies_memory_constraint_p (op, cn)) win = true; else if (spilled_pseudo_p (op)) win = true; -- cgit v1.1