Date: Wed, 19 Feb 2025 19:46:58 +0000 From: bugzilla-noreply@freebsd.org To: numerics@FreeBSD.org Subject: [Bug 284905] __builtin_powf produces incorrect result on FreeBSD Message-ID: <bug-284905-18636-Y7xOXE92dv@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-284905-18636@https.bugs.freebsd.org/bugzilla/>
index | next in thread | previous in thread | raw e-mail
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=284905 Dimitry Andric <dim@FreeBSD.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dim@FreeBSD.org --- Comment #1 from Dimitry Andric <dim@FreeBSD.org> --- The builtins seem to be behaving identically across clang and gcc: $ cat powtest.c #include <math.h> #include <stdio.h> int main(void) { float result = powf(10.0f, 11.0f); printf("result=%f (%g / %a)\n", result, result, result); return 0; } $ clang -O1 powtest.c -o powtest-clang $ ./powtest-clang result=99999997952.000000 (1e+11 / 0x1.74876ep+36) $ gcc -O1 powtest.c -o powtest-gcc $ ./powtest-gcc result=99999997952.000000 (1e+11 / 0x1.74876ep+36) Compare to when -fno-builtin is used: $ clang -fno-builtin -O1 powtest.c -o powtest-clang -lm $ ./powtest-clang result=100000006144.000000 (1e+11 / 0x1.74877p+36) $ gcc -fno-builtin -O1 powtest.c -o powtest-gcc -lm $ ./powtest-gcc result=100000006144.000000 (1e+11 / 0x1.74877p+36) Hence, the problem seems to be in libm, not in the compiler builtins. -- You are receiving this mail because: You are the assignee for the bug.home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-284905-18636-Y7xOXE92dv>
