This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: Tighten checking for 'X' constraints
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org, Robert Suchanek <Robert dot Suchanek at imgtec dot com>, rdsandiford at googlemail dot com
- Date: Wed, 16 Apr 2014 14:14:07 +0200
- Subject: Re: RFA: Tighten checking for 'X' constraints
- Authentication-results: sourceware.org; auth=none
- References: <87sipejow3 dot fsf at talisman dot default> <20140416092114 dot GE1817 at tucnak dot redhat dot com> <87fvldpnb3 dot fsf at sandifor-thinkpad dot stglab dot manchester dot uk dot ibm dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Apr 16, 2014 at 11:43:12AM +0100, Richard Sandiford wrote:
> "X" was defined against reload, which always reloaded MEM addresses
> to follow the appropriate base and index register classes. This was
> done as a first pass before matching against the constraints:
I think it would be fine if "X" had a MEM that isn't valid to replace
it say by (mem (scratch)) or similar.
What I think "X" is useful for is e.g. if you want to describe e.g. a
side-effect of inline-asm on certain location in memory, but don't really
need the address of that memory. Often "memory" is too big hammer,
people often say that certain inline-asm uses or sets or uses/sets or
clobbers say 100 byte long piece of memory somewhere, but the operand is
there solely to tell the compiler what memory it is.
I think "X" constraint is good for that if you aren't planning to actually
use the address anywhere. E.g. you call in inline-asm some function,
but the address construction is in the callee, there is no point to costly
compute the address in the caller (say for -fPIC).
Jakub