NaN/Inf tests fail with the IntelLLVM compiler in Release builds
- 主要言語
- C++
- スター
- 18.1k
- フォーク
- 3.2k
- 平均マージ
- 20時間 36分
- マージ済み PR(30日)
- 1
説明
### Describe the issue
The Intel LLVM compiler uses **-fp-model=fast** by default, causing the NaN tests to fail.
It would be useful to use -fp-model=precise for abseil.
Non-test
```
[build] /home/niranjan/src/abseil-cpp/absl/flags/marshalling.cc:180:7: warning: explicit comparison with NaN in fast floating point mode [-Wtautological-constant-compare]
[build] if (std::isnan(v) || std::isinf(v)) return digit10_str;
[build] ^~~~~~~~~~~~~
```
Test
```
[build] In file included from /home/niranjan/src/abseil-cpp/absl/random/distributions_test.cc:15:
[build] In file included from /home/niranjan/src/abseil-cpp/absl/random/distributions.h:57:
[build] /home/niranjan/src/abseil-cpp/absl/random/beta_distribution.h:92:13: warning: explicit comparison with infinity in fast floating point mode [-Wtautological-constant-compare]
[build] if (std::isinf(a_) || std::isinf(b_)) {
[build] ^~~~~~~~~~~~~~
```
### Steps to reproduce the problem
See #1425 setting up the environment and running the tests.
### What version of Abseil are you using?
```
$ git rev-parse HEAD
88ca602a6e848f604b2f0ef7318471ffea2a2b6b
```
### What operating system and version are you using?
Linux and Windows.
### What compiler and version are you using?
```
$ icpx -v
Intel(R) oneAPI DPC++/C++ Compiler 2023.1.0 (2023.1.0.20230320)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/intel/oneapi/compiler/2023.1.0/linux/bin-llvm
Configuration file: /opt/intel/oneapi/compiler/2023.1.0/linux/bin-llvm/../bin/icpx.cfg
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/12
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/12
Candidate multilib: .;@m64
Selected multilib: .;@m64
```
### What build system are you using?
```
$ cmake --version
cmake version 3.25.1
CMake suite maintained and supported by Kitware (kitware.com/cmake).
```
### Additional context
_No response_
コントリビューションガイド
評価
この issue はまだ評価されていません。