Invalid address after reload

Jim Wilson wilson@tuliptree.org
Mon Mar 3 23:59:00 GMT 2008


Vander Aa Tom wrote:
> This fails the "legitimate address" constraint since I'm not allowing a
> mem inside another mem.

Sounds like a REG_OK_STRICT bug.  GO_IF_LEGITIMATE_ADDRESS should accept 
a pseudo-reg when !REG_OK_STRICT, and should reject a pseudo-reg when 
REG_OK_STRICT.  In reload, an unallocated pseudo-reg is really a memory 
reference in disguise.  This is typically handled by having two 
different versions of macros like REG_OK_FOR_BASE_P. 
GO_IF_LEGITIMATE_ADDRESS then uses these macros for its checks.  This is 
a common mistake in first time ports.

See also strict_memory_address_p in reload.c, and memory_address_p in 
recog.c.

Jim



More information about the Gcc mailing list