Here is a simple testcase: [ampere:/tmp]$ cat test.c #include <math.h> #include <stdio.h> int main() { printf("%lf\n", pow(-INFINITY, NAN)); return 0; } [ampere:/tmp]$ gcc -o test test.c -std=c99 -lm [ampere:/tmp]$ ./test inf Note that the problem is present on x86_64 and powerpc, but not on i386.
Testing a patch.
http://sources.redhat.com/ml/libc-hacker/2007-03/msg00000.html
Fixed in cvs.
Subject: Bug 4069 CVSROOT: /cvs/glibc Module name: libc Branch: glibc-2_5-branch Changes by: jakub@sourceware.org 2007-07-12 14:58:06 Modified files: . : ChangeLog math : libm-test.inc sysdeps/i386/fpu: e_pow.S e_powf.S e_powl.S sysdeps/ieee754/dbl-64: e_pow.c sysdeps/x86_64/fpu: e_powl.S Log message: 2007-03-01 Jakub Jelinek <jakub@redhat.com> [BZ #4069] * sysdeps/ieee754/dbl-64/e_pow.c (__ieee754_pow): Check for NaN earlier. * math/libm-test.inc (pow_test): Add more tests involving NaNs. * sysdeps/i386/fpu/e_powf.S (__ieee754_powf): Avoid invalid exception for x qNaN and y either +-inf or non-integer value. * sysdeps/i386/fpu/e_pow.S (__ieee754_pow): Likewise. * sysdeps/i386/fpu/e_powl.S (__ieee754_powl): Likewise. * sysdeps/x86_64/fpu/e_powl.S (__ieee754_powl): Likewise. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/libc/ChangeLog.diff?cvsroot=glibc&only_with_tag=glibc-2_5-branch&r1=1.10362.2.50&r2=1.10362.2.51 http://sourceware.org/cgi-bin/cvsweb.cgi/libc/math/libm-test.inc.diff?cvsroot=glibc&only_with_tag=glibc-2_5-branch&r1=1.73&r2=1.73.2.1 http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/i386/fpu/e_pow.S.diff?cvsroot=glibc&only_with_tag=glibc-2_5-branch&r1=1.7&r2=1.7.2.1 http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/i386/fpu/e_powf.S.diff?cvsroot=glibc&only_with_tag=glibc-2_5-branch&r1=1.7&r2=1.7.2.1 http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/i386/fpu/e_powl.S.diff?cvsroot=glibc&only_with_tag=glibc-2_5-branch&r1=1.7&r2=1.7.2.1 http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/ieee754/dbl-64/e_pow.c.diff?cvsroot=glibc&only_with_tag=glibc-2_5-branch&r1=1.13&r2=1.13.8.1 http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/x86_64/fpu/e_powl.S.diff?cvsroot=glibc&only_with_tag=glibc-2_5-branch&r1=1.2&r2=1.2.8.1