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

MSVC 2013 ICC 15.0: interlocked instructions do not make memory barrier for optimization?

Marián__VooDooMan__M
New Contributor II
313 Views
Greetings, I have my own very fast critical section implementation with interlocked intrinsic functions. It seems to be failing. I guess ICC IPO optimizer should invalidate program/variable state when it encounters interlocked intrinsic function, even when they are volatile and not so.
0 Kudos
2 Replies
Light_Intel
Moderator
313 Views

Can you please elaborate what exactly is failing? A test case would do nicely.

0 Kudos
Marián__VooDooMan__M
New Contributor II
313 Views
I am using MSVC's functions like "InterlockedIncrement(&m_lock_cnt);" which are opaque so compiler should assume that state was changed. Anyway, it was either a bug in ICC 15, or in my code. However the latest update of ICC 15 is working perfectly, and the problem disappeared. Please, disregard this issue.
0 Kudos
Reply