[Patch,AVR]: Fix PR50449

Georg-Johann Lay avr@gjlay.de
Tue Sep 20 18:59:00 GMT 2011


This is fix for a minor performance regression introduced by my changes in
trunk r175956: To load a 32-bit constant like 1 into R2, 4.6 uses

     CLR  R2
     CLR  R3
     MOVW R4,R2
     INC  R2

whereas trunk prints the longer

     CLR  R2
     INC  R2
     CLR  R3
     CLR  R4
     CLR  R5

This patch fixes it.  The insns affected (*reload_insi and *reload_insf) whose
instruction length must be adjusted now use an insn attribute to express how
the adjustment has to be performed.


Tested without regressions.

Ok to commit?

Johann

	PR target/50449
	* config/avr/avr.md (adjust_len): New insn attribute.
	(*reload_insi, *reload_insf): Use it.
	(*movsi, *movsf): Use new interface of output_movsisf.
	* config/avr/avr-protos.h (output_movsisf): Change prototype.
	* config/avr/avr.c (output_movsisf): Ditto.
	(adjust_insn_length): Use insn attribute "adjust_len" to adjust
	lengths of insns *reload_insi, *reload_insf.
	(output_reload_insisf_1): New static function.
	(output_reload_insisf): Use it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr50449.diff
Type: text/x-patch
Size: 11039 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110920/4941f048/attachment.bin>


More information about the Gcc-patches mailing list