Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
9 Views

Strange thread crash (inline, loop unrolling)

Hi, I am experiencing strange compilation issue, quick code overview:

Version: Intel C++ 11.1.046

void check_block_sse2(unsigned int *data_d, unsigned int pwd_len, int charset_len, int keys_per_thread, int* result)
{
for(int key_pos=0;key_pos {
check_block_sse2_inline(key_pos, data_d, pwd_len, charset_len, keys_per_thread, result);
}
}


__forceinline void check_block_sse2_inline(int key_pos, unsigned int *data_d, unsigned int pwd_len, int charset_len, int keys_per_thread, int* result)
{
//Do calculate 12 MD5 hashes via SSE2 intrinsincs, alot of code skipped
//Result hashes are in a_int e.t.c
for(int i=0;i checkHashList(a_int,b_int,c_int,d_int,result[key_pos+i]);
}

__forceinline void checkHashList(unsigned int a, unsigned int b,unsigned int c, unsigned int d, int &result)
{
//If I uncomment next line - everything works as expected.
//If it is commented - thread silently exits
//for(int i=0;i<2;i++)
if(a==b)
result = KEY_FOUND;
}

Any clues what might cause it?
If there is no __forceinline it works fine anyway, but I really need this inlined for performance.

Basically, if there are some loops in checkHashList - it works fine, and my original non-simplified code in checkHashList with some while loops works fine, the problems is here only when I am getting rid of loops (for example, if I replace while with if - it starts to silently crash. No side effects).

I cannot find an error in disassembly, as it is inlined and kinda scrambled due to loop unrolling (and again, without inlining it is fine).

Any clues?
0 Kudos
2 Replies
Highlighted
Moderator
9 Views

what options are used for compiling?

also there're newer updates available 11.1.051. Please try it.
You can download from our registration center or the eval center.

Jennifer
0 Kudos
Highlighted
Beginner
9 Views

/c /O3 /Og /Oi /Ot /Qipo /I "D:myworkcuda64tkinclude" /I "g:mytoolsPOCOFoundationinclude" /I "g:mytoolsPOCOUtilinclude" /I "g:mytoolsboost" /I "d:myworkstream64ATI Brook+ 1.4.0_betasdkinclude" /I "c:Program Files (x86)IntelCompilerC++10.1.029EM64TInclude2" /D "POCO_STATIC" /D "WIN32" /D "_CONSOLE" /D "CPU" /D "_SECURE_SCL=0" /D "_VC80_UPGRADE=0x0710" /D "_MBCS" /EHsc /MT /GS- /arch:SSE2 /fp:fast /Fo"x64Release/" /W3 /nologo /Wp64 /Zi

I'll try latest version and will report back, in about 12-18 hours.
0 Kudos