Skip to content
Snippets Groups Projects
user avatar
H.J. Lu authored
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.
9407058a
History
Name Last commit Last update
..