intel / intel/llvm

Wrong code generation in optimization mode.

Open
#7,230 2 comments 0 reactions 0 assignees View on GitHub
bug confirmed
Dominant language
LLVM
Stars
1.5k
Forks
854
Avg merge
3d 17h
Merged PRs (30d)
137

Description

**Describe the bug**
Different result for the code below from GCC/LLVM/ICPX(no opt) and ICPX with optimization.

**To Reproduce**
Please describe the steps to reproduce the behavior:

```
std::mt19937_64 rnd(123456);
std::uniform_int_distribution ds(0, 601080389UL);
std::int64_t sum = 0;
for(int64_t i = 0; i < 50000; i++) {
int64_t x = ds(rnd);
sum += x;
}

std::cout << sum << std::endl;
```
Compile code above with "icpx -O2 -g -DNDEBUG -std=gnu++14 " to get wrong result.

Expected consistent result.

**Environment (please complete the following information):**

- OS: Ubuntu 20.04
- Target device and vendor: general CPU no specific targets.
- DPC++ version: Intel(R) oneAPI DPC++/C++ Compiler 2022.2.0 (2022.2.0.20220730)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.