2012/3/19 Georg-Johann Lay <a...@gjlay.de>:
> Georg-Johann Lay wrote:
>> The problem with the PR is that lower-subreg.c happily splits multi-byte
>> from address spaces without knowing anything about the additional costs this
>> The TARGET_MODE_DEPENDENT_ADDRESS_P hook cannot be used for 16-bit addresses
>> because that hook is not sensitive to address spaces, but is is used for the
>> 24-bit address space to avoid subreg lowering for PSImode.
>> For the 16-bit address spaces the mov expander now assigns the address
>> by hand as post-increment.
>> Luckily, post-increment is the only addressing mode that makes sense with the
>> non-generic address spaces and there is no choice for the address register
>> resp. addressing mode, anyway...
>> This patch does not fix the PR issue, of course, it just avoids subreg
>> by using/pretending mode-dependent addresses.
>> Ok for trunk?
>> PR rtl-optimization/52543
>> * config/avr/avr.c (avr_mode_dependent_address_p): New function.
>> (TARGET_MODE_DEPENDENT_ADDRESS_P): New define.
>> * config/avr/avr.md (unspec): Add UNSPEC_LPM.
>> (load_<mode>_libgcc): Use UNSPEC_LPM instead of MEM.
>> (mov<mode>): For multi-byte move from non-generic
>> 16-bit address spaces: Expand to use Z++ as address for
>> inline code and use UNSPEC_LPM (Z) for code from libgcc.
>> (load<mode>_libgcc): Remove expander.
>> (split-lpmx): Remove split.