[flac-dev] PATCH: workaround for a GCC bug #61423, second version

lvqcl lvqcl.mail at gmail.com
Sat Jun 7 10:52:40 PDT 2014


Patch A: (gccbug-v2-a.patch)
It replaces fp code with integer. Basically it changed
ceil(x * (1.-0.95)) with (x/20 + x%20?1:0). This also slightly
changes calculated RG value, so test_replaygain.sh was also updated.

Why RG value differs? Because double(1.-0.95) > double(0.05).
If x==20 then ceil(x * (1.-0.95)) == 2, while ceil(x * 0.05) == 1
and (x/20 + x%20?1:0) == 1. So the new code behaves differently
than the old. But IMHO the new behavior is "more correct" than
the old one.



Patch B: (gccbug-v2-b.patch)
It adds -mfpmath=sse option to configure.ac after -msse2 option.
Should fix the bug according to
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61423#c2
According to my tests, it doesn't affect encoding speed.




Any of the two patches fix the problem here, so choose the better...
but I'd like to see both of them applied, just in case.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gccbug-v2-a.patch
Type: application/octet-stream
Size: 1725 bytes
Desc: not available
Url : http://lists.xiph.org/pipermail/flac-dev/attachments/20140607/30de0274/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gccbug-v2-b.patch
Type: application/octet-stream
Size: 300 bytes
Desc: not available
Url : http://lists.xiph.org/pipermail/flac-dev/attachments/20140607/30de0274/attachment-0001.obj 


More information about the flac-dev mailing list