[Bug middle-end/116331] Math function non-determinism due to constant folding of cos

2024-08-12 Thread carl at dehlin dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116331 --- Comment #6 from Carl Dehlin --- Thanks Jakub for your explanation. Indeed, the following program runs fine and confirms what you just said. Inspecting the assembly shows can both std::cos and __builtin_cos are substituted to a library call w

[Bug middle-end/116331] Math function non-determinism due to constant folding of cos

2024-08-12 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116331 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #5

[Bug middle-end/116331] Math function non-determinism due to constant folding of cos

2024-08-12 Thread carl at dehlin dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116331 --- Comment #4 from Carl Dehlin --- Found answer or 3) here: https://sourceware.org/glibc/manual/latest/html_mono/libc.html#Known-Maximum-Errors-in-Math-Functions . For x86_64 cos is accurate up to 1 ulp from the correctly rounded value. As I un

[Bug middle-end/116331] Math function non-determinism due to constant folding of cos

2024-08-11 Thread carl at dehlin dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116331 --- Comment #3 from Carl Dehlin --- Thanks Andrew for your quick response and confirmation of what is going on. After reading through all the excessive precision stuff I was so sure this related to it! Very interesting to see that floating poin

[Bug middle-end/116331] Math function non-determinism due to constant folding of cos

2024-08-11 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116331 Andrew Pinski changed: What|Removed |Added Resolution|--- |DUPLICATE Status|UNCONFIRME