Created
July 8, 2016 05:32
-
-
Save cmuratori/48ab8f6a6d78196e1323d4a0796e7732 to your computer and use it in GitHub Desktop.
Microsoft Visual Studio 2012 Internal Compiler Error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Put this in a .c file and cl it to cause the internal compiler error. It also crashes as a .cpp, but you have to extern "C" the declarations. | |
typedef union __m128 {float m128_f32[4];} __m128; | |
__m128 _mm_load_ps(float const *); | |
void _mm_store_ps(float *, __m128); | |
void main(void) {_mm_store_ps(0, _mm_load_ps(0));} |
It turns out that your code is missing a decltype in the definition of the __m128 type:
typedef union __declspec(intrin_type) __m128 {float m128_f32[4];} __m128;
extern "C" __m128 _mm_load_ps(float const *);
extern "C" void _mm_store_ps(float *, __m128);
void main() { _mm_store_ps(0, _mm_load_ps(0)); }
If you add __declspec(intrin_type)
then it will work as expected. Or just use #include <intrin.h>
to get all the definitions loaded for you.
That said, our compiler should never crash on legal or illegal code. We’ll fix that. Thanks for the report!
Yes, we know :) That is where this GIST came from in the first place:
"Today's fun discovery: removing the __declspec's from the definition of __m128 causes MSVC to ICE on any SSE intrinsic."
https://twitter.com/cmuratori/status/751284570297806851
- Casey
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the bug report! We'll look into it. You say it crashes every version of VC++, not just 2012?