http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55695



             Bug #: 55695

           Summary: Miscompilation of pow() & sqrt() using musl libc

    Classification: Unclassified

           Product: gcc

           Version: 4.8.0

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: c

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: o...@ojab.ru





Created attachment 28966

  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28966

Preprocessed source



I'm trying to build spandsp using musl libc and found that sqrt() & pow()

compilation is broken when using <tgmath.h> with gcc-4.8, but no errors with

gcc-4.2.4.

Preprocessed source are the same using both gcc versions (can be found in the

attached file).

According to the one of the musl developers, it can be related to the "tgmath

__RETCAST magic" http://www.openwall.com/lists/musl/2012/12/14/6

musl's tgmath.h source can be found at

http://git.musl-libc.org/cgit/musl/tree/include/tgmath.h



/bin/sh ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. 

-I/usr/include/libxml2 -DNDEBUG -msse2 -Wunused-but-set-variable -std=gnu99

-ffast-math -Wall -Wunused-variable -Wwrite-strings -Wstrict-prototypes

-Wmissing-prototypes -fvisibility=hidden -DHAVE_VISIBILITY=1  -pedantic -MT

awgn.lo -MD -MP -MF .deps/awgn.Tpo -c -o awgn.lo awgn.c

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/libxml2 -DNDEBUG

-msse2 -Wunused-but-set-variable -std=gnu99 -ffast-math -Wall -Wunused-variable

-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -fvisibility=hidden

-DHAVE_VISIBILITY=1 -pedantic -MT awgn.lo -MD -MP -MF .deps/awgn.Tpo -c awgn.c 

-fPIC -DPIC -o .libs/awgn.o

awgn.c: In function 'awgn_init_dbov':

awgn.c:109:5: error: void value not ignored as it ought to be

     s->rms = pow(10.0, level/20.0)*32768.0;

     ^

awgn.c: In function 'awgn':

awgn.c:165:9: error: void value not ignored as it ought to be

         fac = sqrt(-2.0*log(r)/r);

         ^

awgn.c:165:9: error: void value not ignored as it ought to be

awgn.c:165:9: error: void value not ignored as it ought to be

awgn.c:165:9: error: void value not ignored as it ought to be







Please tell me if any other info is needed.

Reply via email to