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

IPO and __asm

Black Belt
This is an FYI (ICC x64 Windows)

I have a C++ shell function that contains a significant sized __asm block. IOW the function with its 4 args (3 pointers and on intptr_t)immediately followed by __asm block and no code following __asm block until function exit. Cannot post function here. The function with __asm block is located in a different source file than the one that calls it.

Debug build works fine, but Release build craps out with memory access to location 8 error. The error occurs immediately at where the function is inlined in the caller. I suspect that one of the 4 fastcall registers got remapped causing my __asm code to break (under the assumption that the fast call registers are what they are supposed to be).

I can get the Release build to run without error if I __declspec(noinline) both the function init's source file and the function prototype of this function in the caller's source.

There is nobenefit for me to inline this function, however this code shouldhave worked regardless of being inlined or not.

Jim Dempsey
0 Kudos
0 Replies