2016-10-12 14:32 GMT+03:00 Georg-Johann Lay <a...@gjlay.de>: > This patch introduces a new variable attribute "absdata". > > Reduced Tiny cores have only a limited range of addresses 0x40..0xbf which > can be handled by LDS / STS directly. The attribute allows the user to > assert that it is legitimate to use absolute addressing for such addresses > and that there is no need for bulky load of address + indirect addressing. > > Allowed addresses actually range from 0x0 to 0xbf because IN / OUT can > handle absolute addresses in the lower range 0x0..0x3f. > > Ok for trunk? >
Approved. Please apply. > Johann > > > gcc/ > * doc/extend.texi (AVR Variable Attributes) [absdata]: Document it. > * config/avr/avr.c (AVR_SYMBOL_FLAG_TINY_ABSDATA): New macro. > (avr_address_tiny_absdata_p): New static function. > (avr_legitimate_address_p, avr_legitimize_address) [AVR_TINY]: Use > it to determine validity of constant addresses. > (avr_attribute_table) [absdata]: New variable attribute... > (avr_handle_absdata_attribute): ...and handler. > (avr_decl_absdata_p): New static function. > (avr_encode_section_info) [AVR_TINY]: Use it to add flag > AVR_SYMBOL_FLAG_TINY_ABSDATA to respective symbols_refs. > (avr_address_cost) [AVR_TINY]: absdata addresses cost 2. > > gcc/testsuite/ > * lib/target-supports.exp (check_effective_target_avr_tiny): New > proc. > * gcc.target/avr/torture/tiny-absdata-1.c: New test.