Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
7679 Discussions

/debug:parallel causes boost::mutex to wait forever on ia32

orin
Beginner
258 Views

The boost libraries use the following inline assembly:

[bash] inline bool interlocked_bit_test_and_set(long* x,long bit) { __asm { mov eax,bit; mov edx,x; lock bts [edx],eax; setc al; }; } inline bool interlocked_bit_test_and_reset(long* x,long bit) { __asm { mov eax,bit; mov edx,x; lock btr [edx],eax; setc al; }; } [/bash]
When /debug:parallel is set, the setc al; is immediately followed by mov "eax, esp", trashing the intended return value and causing an attempt to lock the mutex to wait forever (unless the lowest 8 bits of esp happen to be 0 of course).

I have reported this as a bug against boost (https://svn.boost.org/trac/boost/ticket/6931) along with a simple fix (move al into a temporary bool and return the temporary). However, this probably isn't the only instance of such a construct out there... so IMO, the extra code that /debug:parallel inserts should not trash any registers.

Orin.

0 Kudos
2 Replies
Hubert_H_Intel
Employee
258 Views
Orin,
What's the reason for building with /debug:parallel? This option is for creating parallel debug checks used by the Intel IDB Debugger to detect data sharing event in OpenMP* parallelized code.
Regards, Hubert.
orin
Beginner
258 Views
Hubert,

See my reply in the other thread. I am actually using OpenMP.

Orin.
Reply