diff options
author | liuhongt <hongtao.liu@intel.com> | 2020-10-26 20:46:42 +0800 |
---|---|---|
committer | liuhongt <hongtao.liu@intel.com> | 2020-11-04 13:06:32 +0800 |
commit | 2e0aa43fc6ae689c595902310baec604e7e0d695 (patch) | |
tree | 31a62ed7fb7e9699e169f994db289b256d687411 /gcc/ira.c | |
parent | db8b3e148d5cc5358cd48886e5334bd50d2d3317 (diff) | |
download | gcc-2e0aa43fc6ae689c595902310baec604e7e0d695.zip gcc-2e0aa43fc6ae689c595902310baec604e7e0d695.tar.gz gcc-2e0aa43fc6ae689c595902310baec604e7e0d695.tar.bz2 |
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.
Diffstat (limited to 'gcc/ira.c')
-rw-r--r-- | gcc/ira.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1845,6 +1845,7 @@ ira_setup_alts (rtx_insn *insn) default: { enum constraint_num cn = lookup_constraint (p); + rtx mem = NULL; switch (get_constraint_type (cn)) { case CT_REGISTER: @@ -1867,8 +1868,12 @@ ira_setup_alts (rtx_insn *insn) goto op_success; case CT_MEMORY: + mem = op; + /* Fall through. */ case CT_SPECIAL_MEMORY: - if (MEM_P (extract_mem_from_operand (op))) + if (!mem) + mem = extract_mem_from_operand (op); + if (MEM_P (mem)) goto op_success; win_p = true; break; |