Open Quuxplusone opened 3 years ago
Bugzilla Link | PR50719 |
Status | NEW |
Importance | P enhancement |
Reported by | Shaohua Li (shaohua.li@inf.ethz.ch) |
Reported on | 2021-06-15 08:59:09 -0700 |
Last modified on | 2021-06-16 11:17:08 -0700 |
Version | 12.0 |
Hardware | PC Linux |
CC | blitzrakete@gmail.com, dgregor@apple.com, efriedma@quicinc.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk, zhendong.su@inf.ethz.ch |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also |
The C library pow() libcall is not correctly rounded. This means the result isn't predictable across targets, and across optimizations that use alternate methods to compute the result.
Here, the compiler is transforming the pow() libcall to the more efficient exp2() libcall. This is loosely equivalent, but the rounding is slightly different.
If you want predictable results, you should use your own implementation of pow() using operations using correctly rounded arithmetic.
You can use -fno-builtin to disable this sort of optimization.