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

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

The boost libraries use the following inline assembly:

 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; }; } 

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.


3 posts / novo 0
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.

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.


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


Deixar um comentário

Faça login para adicionar um comentário. Não é membro? Inscreva-se hoje mesmo