[avr,committed] Fix fixed-point conversion

Georg-Johann Lay avr@gjlay.de
Thu Jan 24 13:40:00 GMT 2013


Committed the following change:

http://gcc.gnu.org/r195424

	* config/avr/avr.c (avr_out_fract): Make register numbers that
	might be outside of source operand signed.


The problem occurs with fixed-point conversions to a wider mode and where the
input operand is in a small regno like r2:

src:  QQmode in r2
dest: DAmode in r2

avr.c:avr_out_fract loops over the registers and clears dest registers at the
low end that have no associated src register (zero-extension at the low end).

In the sample case the register numbers (variables s0, s1) drop below 0 and
must be signed for that reason.  Otherwise, some dest registers, starting at
2^{-16}, will not be cleared.


Johann



More information about the Gcc-patches mailing list