This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]