abseil / abseil/abseil-cpp

NaN/Inf tests fail with the IntelLLVM compiler in Release builds

Aperta
#1,451 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
C++
Stelle
18.1k
Fork
3.2k
Merge medio
20h 36m
PR unite (30g)
1

Descrizione

### 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_

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.