[Bug c/79973] New: atanh() constant-folds differently than it would evaluate at runtime
arigo at tunes dot org
gcc-bugzilla@gcc.gnu.org
Thu Mar 9 09:04:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79973
Bug ID: 79973
Summary: atanh() constant-folds differently than it would
evaluate at runtime
Product: gcc
Version: 6.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: arigo at tunes dot org
Target Milestone: ---
Created attachment 40930
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40930&action=edit
reproducer, linux x86-64, gcc -lm
atanh(x), where x is a variable that happens to contain the value 0.3,
evaluates to a slightly different result than atanh(0.3) constant-folded at
computation time. While this is allowed---and this may be yet another
duplicate of Bug 323---I still find it surprizing when there is no extra
computation involved and I'm running on a x86-64 (and not the 32-bit x86 fpu).
See the reproducer.
Platform: Linux 64, gcc 6.3.1 20170109.
Compile the reproducer without any optimization (gcc -lm filename.c). To
reproduce with optimizations, you need to work harder to hide the value of x
from the atanh(x), but the same occurs then.
More information about the Gcc-bugs
mailing list