[flac-dev] [PATCH] Re: Bug in FLAC or in GCC or somewhere else?

Erik de Castro Lopo mle+la at mega-nerd.com
Sun Jun 15 03:35:34 PDT 2014


lvqcl wrote:

> It seems that it's a bug in GCC: it cannot correctly calculate the value
> of 'elems * (1. - RMS_PERCENTILE)' in the line
> 
>      upper = (Int32_t) ceil (elems * (1. - RMS_PERCENTILE));
> 
> Since elems * (1. - RMS_PERCENTILE) == elems * (1. - 0.95) ==
>   == elems * 0.05 == elems / 20.0   it is possible to replace ceil(...)
> with (elems / 20 + (elems % 20) ? 1 : 0).
> 
> Patch attached.

Patch applied.

Thanks,
Erik
-- 
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/


More information about the flac-dev mailing list