[vorbis-dev] Re: [vorbis] bug in glibc 2.1.2 and older

Monty xiphmont at xiph.org
Mon Jun 26 12:37:45 PDT 2000

> I have solved this problem in the splay mp3 decoder with this:
> In the header:
> #if (__GNUC__ < 2 || ( __GNUC__ == 2 && __GNUC_MINOR__ < 91 ) )
> #warning "inline code disabled! (buggy egcs version)"
> #undef __NO_MATH_INLINES
> #define __NO_MATH_INLINES 1
> #endif

Insufficient!  The bug is *not* in the compiler.  It is in the glibc headers.
I can make bleededing edge GCC break very easily with the bad glibc.

> #include <math.h>
> In the makefile:
> CXXFLAGS=@CXXFLAGS@ -fno-strength-reduce 
> (Opt level is 2)

Not needed in vorbis.  My code doesn't break in strength reduction (and this 
option is only needed if you're doing non-ANSI 'optimizations' in your C)

> and in the excutable:
> pow(6.0,3.0);
> Then it did work.

All you did was cause a shift in optimization that changed FPU stack usage, 
giving the illusion of the problem going away.  If you'd done none of that but 
just a printf() of the value after the pow() it would also appear to have 
fixed the bug (by forcing a float store, also reducing the stack usage).


--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/

More information about the Vorbis-dev mailing list