2008/5/20 Ian Lance Taylor <[EMAIL PROTECTED]>: > "Mohamed Shafi" <[EMAIL PROTECTED]> writes: > >> For the 16 bit target that i am currently porting can have only >> positive offsets less than 0x100. (unsigned 8 bit) for offset >> addressing mode. > > I would expect reload to be able to handle this kind of thing anyhow, > assuming you define GO_IF_LEGITIMATE_ADDRESS correctly. reload should > automatically try loading an out of range offset into a register.
No. Reload can't do it in any cases. Reload can do it in many cases but not in all. Mohamed look to: - avr/avr.h: LEGITIMIZE_RELOAD_ADDRESS - avr/avr.md: *movqi - avr/avr.c: out_movqi_mr_r Here I have emulated infinite displacement. Bad things happened while many reloads occurs on insn with big displacement (0xff,0xfe). Also, while reload generate local variable (spill to stack slot) and you have an insn with address like [SP+0xff]. Denis.