Recently, we encountered incorrect value was got for some statement when optimization on in VS2015
But it is correct if disable it, need your help to check whether there is any problem for intel compiler.
attached is the source code and test program
What version of Intel Compiler are you using? Can you also provide the correct/incorrect values?
The version should be 2017, the serial number is J3GK-MBKSP4T6.
Attached you can find the detail description about the problem
Can you try out Intel® Parallel Studio XE 2019 to see if it solves the problem?
I have no license of Intel® Parallel Studio XE 2019, so how can I get trial version?
You can follow this page: https://software.intel.com/en-us/parallel-studio-xe/choose-download ;
For more complete information about compiler optimizations, see our Optimization Notice.