]> git.ipfire.org Git - thirdparty/gcc.git/commit
ix86: Don't use the 'm' constraint for x86_64_general_operand
authorH.J. Lu <hjl.tools@gmail.com>
Sun, 19 Dec 2021 16:47:03 +0000 (08:47 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 27 Dec 2021 13:27:06 +0000 (05:27 -0800)
commit9407058a430316db5299bc7867e4a31f900cd197
tree084c9fae36e32f13f8beea793a4ae220c276971f
parente078de24eae8253fd4f24342f65166b525dd99c6
ix86: Don't use the 'm' constraint for x86_64_general_operand

The 'm' constraint is defined with define_memory_constraint which allows
LRA to convert the operand to the form '(mem (reg X))', where X is a
base register.  To prevent LRA from generating '(mem (reg X))' from a
register:

1. Add a 'BM' constraint which is similar to the 'm' constraint, but
is defined with define_constraint.
2. Add a 'm' mode attribute which is mapped to the 'm' constraint for
general_operand and the 'BM' constraint for x86_64_general_operand.
3. Replace the 'm' constraint on <general_operand> with the '<m>'
constraint.
4. Replace the 'm' constraint on x86_64_general_operand with the 'BM'
constraint.

gcc/

PR target/103762
* config/i386/constraints.md (BM): New constraint.
* config/i386/i386.md (m): New mode attribute.
Replace the 'm' constraint on <general_operand> with the '<m>'
constraint.
Replace the 'm' constraint on x86_64_general_operand with the
'BM' constraint.

gcc/testsuite/

* gcc.target/i386/pr103762-1a.c: New test.
* gcc.target/i386/pr103762-1b.c: Likewise.
* gcc.target/i386/pr103762-1c.c: Likewise.
gcc/config/i386/constraints.md
gcc/config/i386/i386.md
gcc/testsuite/gcc.target/i386/pr103762-1a.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr103762-1b.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr103762-1c.c [new file with mode: 0644]