[Patch,AVR]: Hack around PR rtl-optimization/52543

Georg-Johann Lay avr@gjlay.de
Fri Mar 9 18:47:00 GMT 2012


The problem with the PR is that lower-subreg.c happily splits multi-byte moves
from address spaces without knowing anything about the additional costs this is
causing.

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 register
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 lowering
by using/pretending mode-dependent addresses.

Ok for trunk?

Johann

	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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: addrspace-pr52543.diff
Type: text/x-patch
Size: 6887 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20120309/9980fb15/attachment.bin>


More information about the Gcc-patches mailing list