Re: Compiler bug in the DDK--be aware of it

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Maybe a good work around for these issues could be using kernel exports instead of intrinsics.

--PA

<440gtx@xxxxxxxxx> wrote in message news:1155876350.014978.75500@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
John S wrote:
Just wondering. does this happen if you make LONG Init a global variable
instead of a local static and does the same problem exist if you used
InterlockedCompareExchange to set it to 1.

A global variable produces the same problem as a local static. However,
InterlockedCompareExchange (as well as InterlockedExchange) produced
good code under the same conditions. That is curious because the former
emits the cmpxchg instruction which has been the culprit up to now. So
still hard to define exactly what will trigger it.

Another interesting point is the problem is sensitive to the compiler
flags used. The flags set by the ddk build do trigger the problem
regardless if debug or release. So another hypothetical solution would
be to tweak the compiler flags though I haven't bothered to isolate
which one(s).



.



Relevant Pages