1

I have a Windows x64 C++ program which is compiled by MSVC 12 without AVX support (no /arch:AVX in compile options).

And I have a crash report from one customer with Core i7 4700MQ on Win7. Exception code is c000001d (illegal instruction), and exception offset points to "vmovd r9,xmm0" instruction inside sin() function. I've tried two different builds with this user and in both cases it points to this same instruction.

Looks like msvc library version of sin() intrinsic have special AVX code path even if compiled without AVX support. And this code works fine on older i3 processors which didn't have AVX.

So what can cause this exception on this particular i7? Same code is running without any problems for many customers with wide rage of CPUs.

Maybe AVX can be somehow disabled in OS settings/BIOS and sin() code fails to check this? Or maybe there was some OS update which added AVX support and without it any AVX code triggers c000001d?

Mysticial
  • 464,885
  • 45
  • 335
  • 332
Ryhor Spivak
  • 253
  • 1
  • 8
  • 2
    Maybe related: https://connect.microsoft.com/VisualStudio/Feedback/Details/987093, https://connect.microsoft.com/VisualStudio/Feedback/Details/981479 – Mysticial Oct 09 '14 at 17:58
  • But 4700MQ *does* support AVX, right? – harold Oct 09 '14 at 17:59
  • 1
    @Mysticial yes, OS was a cause. This user was running Win7 version prior SP1 and AVX support was added only in SP1. Somehow I was thinking MSVC 12 is making code compatible down to Vista. But looks like min spec is Win7 SP1. – Ryhor Spivak Oct 10 '14 at 07:01
  • Mysticial's second link, however, uses Win7 SP1 and it has a similar problem. – Z boson Oct 10 '14 at 07:42

1 Answers1

0

If that's code in a dynamically linked library then the compile options for your code don't matter much. The dll could well be doing dispatch to different implementations based on the return value of cpuid to determine if avx is available and falling back to an sse version if not.

vmovd r9,xmm0

looks like a legal instruction on a corei7 to me.

http://www.felixcloutier.com/x86/MOVD:MOVQ.html

Hal
  • 1,061
  • 7
  • 20