RFA: fix avr gcc.dg/fixed-point/convert-accum-neg.c execution failure

Denis Chertykov chertykov@gmail.com
Mon Aug 26 16:49:00 GMT 2013


2013/8/26 Joern Rennecke <joern.rennecke@embecosm.com>:
> The gcc.dg/fixed-point/convert-accum-neg.c execution test fails for avr
> because for fractional integer to accumulator / integer conversions,
> the avr target rounds towards -infinity, whereas we are supposed to round
> towards 0.
>
> The attached patch implements rounding towards 0, and adds an option
> -mfract-convert-truncate to revert to the previous behaviour (for
> situations where smaller code is more important than proper rounding).
>
> Tested for atmega128-sim.
>
> OK to apply?
>
> 2013-06-25  Joern Rennecke  <joern.rennecke@embecosm.com>
>
>         * config/avr/avr.opt (mfract-convert-truncate): New option.
>         * config/avr/avr.c (avr_out_fract): Unless TARGET_FRACT_CONV_TRUNC
>         is set, round negative fractional integers according to n1169
>         when converting to integer types.
>

Approved.

Denis.



More information about the Gcc-patches mailing list