- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
is -O3 already expected to build correct code?
I found the page from 2009:
http://software.intel.com/en-us/articles/use-intel-compilers-successfully-for-6
"Using -O3, the compiler performs aggressive optimizations, and the
optimizer occasionally generates incorrect code."
We found another example for a misoptimisation.
(Attached is the sample Application.)
Compile the sample Application :
icpc -O3 test.cpp -o test
run it:
/test
dxx[0] = 2.885465e+01
Now exchange line 115 with line 116:
compile:
icpc -O3 test.cpp -o test
run:
./test
dxx[0] = 0.000000e+00
The problem goes away when building with -O2 or using
Intel 11.1 compiler.
So, if O3 should work, this is a bug. Otherwise this sample App
can be use to fix the problem.
regards,
Martin
is -O3 already expected to build correct code?
I found the page from 2009:
http://software.intel.com/en-us/articles/use-intel-compilers-successfully-for-6
"Using -O3, the compiler performs aggressive optimizations, and the
optimizer occasionally generates incorrect code."
We found another example for a misoptimisation.
(Attached is the sample Application.)
Compile the sample Application :
icpc -O3 test.cpp -o test
run it:
/test
dxx[0] = 2.885465e+01
Now exchange line 115 with line 116:
compile:
icpc -O3 test.cpp -o test
run:
./test
dxx[0] = 0.000000e+00
The problem goes away when building with -O2 or using
Intel 11.1 compiler.
So, if O3 should work, this is a bug. Otherwise this sample App
can be use to fix the problem.
regards,
Martin
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is the complete link to the Intel article quoted above:
Intel article
The optimization bug reported above is not seen with the 12.0.4 compiler on Windows (32 and 64 bit).
Intel article
The optimization bug reported above is not seen with the 12.0.4 compiler on Windows (32 and 64 bit).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I get same output when I swap lines 115 and 116 using icc12.0.4.191. Please upgrade your compiler.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page