Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Failed While Enabling Swizzle #594

Closed
stronger1234 opened this issue Jan 1, 2017 · 6 comments
Closed

Build Failed While Enabling Swizzle #594

stronger1234 opened this issue Jan 1, 2017 · 6 comments
Assignees
Labels

Comments

@stronger1234
Copy link

Hello!
I'm building glm-0.9.8.3 using VS Community 2015 Update 3, enabling all test during CMake configuration and generation. Then, when the building came to "test-bug_ms_vec_static", it occurred a compiler internal error. Then I opened this test case and found it enables the SWIZZLE feature. Maybe this feature cause the compiler to use too much memory, but I've no idea how to fixed it. Is there any solution?

@Groovounet
Copy link
Member

Hi,

I am not seeing this issue in VS 2015 pro.
Can you declare GLM_FORCE_MESSAGES and report what the compiler returns?

Thanks,
Christophe

@Groovounet Groovounet self-assigned this Jan 3, 2017
@Groovounet
Copy link
Member

This said, this is a known bug and this is why this test was created. However, this doesn't prevent you to use GLM.

Thanks,
Christophe

@stronger1234
Copy link
Author

stronger1234 commented Jan 4, 2017

Thanks for your answer!
Swizzle is really a cool feature and I'm interesting in using it. But once I defined GLM_FORCE_SWIZZLE and declared some vec2/3/4 variables, the compiler would report this:

1>------ Build started: Project: xxx, Configuration: Debug Win32 ------
1> mycode.cpp
1>e:\xxx\xxx\mycode.cpp(2): fatal error C1001: An internal error has occurred in the compiler.
1> (compiler file 'msc1.cpp', line 1468)
1> To work around this problem, try simplifying or changing the program near the locations listed above.
1> Please choose the Technical Support command on the Visual C++
1> Help menu, or open the Technical Support help file for more information
1> INTERNAL COMPILER ERROR in 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\CL.exe'
1> Please choose the Technical Support command on the Visual C++
1> Help menu, or open the Technical Support help file for more information
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

-------------here is mycode.cpp --------------
#define GLM_FORCE_SWIZZLE
#include <glm/glm.hpp>
using namespace glm;
vec4 a;
void main() {
return;
}
------------ end of mycode.cpp -------------

And when I removed the macro GLM_FORCE_SWIZZLE, it compiled successfully. So it did prevent me from using Swizzle.

@Groovounet Groovounet reopened this Jan 4, 2017
@Groovounet
Copy link
Member

I could reproduce the issue... I'll look at it!

@Groovounet
Copy link
Member

This issue doesn't prevent you to use swizzle expressions.

The compiler bug only prevent to declare globals using GLM types.

I filled a bug to Microsoft a while ago...

Thanks,
Christophe

Groovounet added a commit that referenced this issue Jan 4, 2017
Groovounet added a commit that referenced this issue Jan 4, 2017
Groovounet added a commit that referenced this issue Jan 4, 2017
Groovounet added a commit that referenced this issue Jan 4, 2017
@Groovounet
Copy link
Member

Groovounet commented Jan 4, 2017

The following code building with Visual Studio 2015 SP3 in debug and x64 using language extension cause the Visual C++ compiler to crash.

struct vec2;

struct _swizzle
{
	char _buffer[1];
};

struct vec2
{
	constexpr vec2(float x, float y) :
		x(x), y(y)
	{}

	union
	{
		struct { float x, y; };
		struct { _swizzle xx; };
	};
};

// Visual C++ has a bug generating the error: fatal error C1001: An internal error has occurred in the compiler.
vec2 const Bar(1.f, 1.f);

int main()
{
	return 0;
}

I'll provide a workaround for GLM 0.9.8.4.

Thanks for reporting,
Christophe

@Groovounet Groovounet reopened this Jan 4, 2017
Groovounet added a commit that referenced this issue Jan 4, 2017
Groovounet added a commit that referenced this issue Jan 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants