Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

intel compiler updates - one step forward - three steps back

Petr_K_
Beginner
976 Views

I work for a major CFD vendor and recent compiler updates make us looking for an alternative compiler as fast as we can. Almost every update brings in new bugs - between internal compiler errors, that can be mostly handled by slightly changing the code and at least there is a clear indication what is going wrong to the worst possible thing - miscompiled code.Out software has over two millions lines of complex C++ code. The recent Intel 12.1 has bugs that are really bad and extremely hard to find because they only occur when /O3 is used. Disabling optimization fixes the problem, but generates impossibly slow code.The most recent bug miscompiles following trivial code:double const c0 = cos(a(0)), s0 = sin(a(0));double const c1 = cos(a(1)), s1 = sin(a(1));double const c2 = cos(a(2)), s2 = sin(a(2));std::cout << a << c0 << " " << c1 << " " << c2 << " " << s0 << " " << s1 << " " << s2 <<std::endl;The a is a structure of three numbers accessed via simple inline function double const& operator()(int const& i) const { return _data; }The output the compiler produces in this case with full optimization is(0.242077 0 0)0.970842 0.970842 0.970842 0.23972 0.23972 0.23972wih global optimization disabled (via #pragma optimize("g",off)the same fragment produces correct output(0.242077 0 0)0.970842 1 1 0.23972 0 0So there is clearly some aliasing logic completely wrong and ignoring anything but the first variable.Should I mention that these bugs are extremely time consuming to find (weeks to be precise) even with very detailed test suite.Optimization flags used:/O3 /Qtemplate-depth-100 /GR /EHsc -QaxAVX

0 Kudos
25 Replies
SergeyKostrov
Valued Contributor II
117 Views
Quoting Petr Kodl
I think the basic premise here is that this is a floating point problem - I do not think it is. The problem is
present regardless of the values assigned to the initial vector. The floating point just helps to trigger it
because some advanced optimizations kick in.
From my brief analysis it seems to have something to do with
overloaded inlined operator() - when the vector class is replaced with POD array[] it goes away...


Hi Petr, I would consider three cases when '/O3' is selected:

1. Problem with 'cout << ...'
2. Problem with 'const operator()(int )'
3. Problem with 'sin' and 'cos' functions

Problems 1 and 3 are alreadyreported by different users / developers.

Best regards,
Sergey

0 Kudos
Om_S_Intel
Employee
117 Views

The issue is fixed in Intel Compiler 13.0. I will update the users when the compiler is available for download.

0 Kudos
JenniferJ
Moderator
117 Views
Hello, The 13.0 has released now. You can download from the Intel Registration Center or the eval from the product site. the fix is also in 12.1, the update 12 have it. the package name is "w_ccompxe_p_12.1.12.369.exe". Jennifer
0 Kudos
SergeyKostrov
Valued Contributor II
117 Views
The issue is fixed in Intel Compiler 13.0. I will update the users when the compiler is available for download.


Could you provide some technical details on what was wrong, please? There are 3 possible sources of the problem.
These detailswould be useful for users of Intel C++ compiler 12.x. Thank you in advance.

0 Kudos
SergeyKostrov
Valued Contributor II
117 Views
>>...You can download from the Intel Registration Center or the eval from the product site. The fix is also in 12.1, >>the update 12 have it. The package name is "w_ccompxe_p_12.1.12.369.exe... . Thanks for the update, Jennifer.
0 Kudos
Reply