MSVC 2013 ICC 15.0: interlocked instructions do not make memory barrier for optimization?
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.
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.