RFA: Tighten checking for 'X' constraints

Jakub Jelinek jakub@redhat.com
Wed Apr 16 12:15:00 GMT 2014


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



More information about the Gcc-patches mailing list