[Patch,AVR]: Clean up hard-coded SFR addresses
Georg-Johann Lay
avr@gjlay.de
Sat Feb 4 01:30:00 GMT 2012
>>This patch removes the define_constants from avr.md:
>>SREG_ADDR, SP_ADDR, RAMPZ_ADDR.
>>
>>The constants were not used in md directly and didn't take care of
>>afr_offset between RAM and I/O address.
>>
>>The replacement is a new structure avr_addr that holds RAM addresses
>>of respective SFRs and takes into account avr_current_arch->sfr_offset.
>>sfr_offset is the same for all architectures, but that may change in
>>the future.
>>
>>Tested without regression.
>>
>>Ok for trunk?
>
> In the struct avr_addr_t is there any reason why you didn't want to have
> the low and high bytes of the stack pointer in a union with the full
> stack pointer?
What would be the purpose of such a union?
Removing the .sp = .sp_l sugar? If so, then removing one of them
altogether is the clearest approach, imo.
Johann
More information about the Gcc-patches
mailing list