Closed nasenbaer43 closed 6 years ago
Have you been able to repro this with an earlier Visual Studio? It looks like a compiler bug from your repro...
Thanks for your reply. And nice idea... Changing the toolset to VS 2015 works. Starting to love all the new bugs in VS 2017 :(
Anyway thanks for your help.
Alright, so please file this as a bug against the compiler at VS Connect.
My test suite passes fine on VS 2017 (15.3) Win32 Debug, but it obviously doesn't cover every possible usage. I realize this is mostly just a test, but what happens if you use XMVECTORF32
instead of XMVectorSet
for the vector constants?
Done. See https://developercommunity.visualstudio.com/content/problem/110426/c-compiler-bug-invalid-sse2-code-alignment.html in case I missed something.
Using XMVECTORF32 didn't help:
DirectX::XMMATRIX identity = DirectX::XMMatrixIdentity(); static const DirectX::XMVECTORF32 mousepos1 = { 400.0f, 200.0f, 0.00999999978f, 0.0f }; auto mouseposTest = DirectX::XMVector3Unproject(mousepos1, 0.0f, 0.0f, 1600.0f, 600.0f, 0.00999999978f, 1000.0f, identity, identity, identity);
still crashes
Just had a look at your test suite: all the tests ran fine... However in your solution you set Program Database (/Zi) instead of Program Database for Edit And Continue (/ZI) which I'm using. Changing the setting removes the bug.
Ah, definitely include that detail in the bug report.
Note that the compiler team has seen this bug and repro'd it with 15.3. It didn't happen in the 15.2 compiler.
Note that this still repros with 2017 (15.4)
Hi, I'm getting crashes in XMVector3Unproject although I'm only using stack allocated variables, e.g. NO XMVECTOR or XMMATRIX as a member variable (see Test3() below). I tried both WinSDKs 8.1 and the newest 10.xyz one, DirectXMath version 310 / 307. Haven't tried your newest github one yet. Compiler is VS 2017 Enterprise 15.3. Debug x86 native Win32.
Here is a small repro ( I also attached the repro as a solution)
Edit: Just tested the newest version. Still crashes. Note: I forgot to set SSE2 in the attached repro. However setting it to SSE2 still crashes. Fast (/fp:fast) or Precise (/fp:precise) doesn't matter either. However using (/arch:AVX) does not crash, unfortunately not every customer of mine is able to use AVX. I don't know whether AVX does have different alignment requirements or there really is a bug. Of course x64 works like a charm.
Crash.zip