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

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

orin
Beginner
398 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
398 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.
0 Kudos
orin
Beginner
398 Views
Hubert,

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

Orin.
0 Kudos
Reply