<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Looks good to me.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Reviewed-by: Jose Fonseca <jfonseca@vmware.com></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Brian Paul <brianp@vmware.com><br>
<b>Sent:</b> Wednesday, May 1, 2019 21:28<br>
<b>To:</b> mesa-dev@lists.freedesktop.org<br>
<b>Cc:</b> Neha Bhende; Jose Fonseca; Charmaine Lee<br>
<b>Subject:</b> [PATCH] glsl: work around MinGW 7.x compiler bug</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">I'm not sure what triggered this, but building with<br>
scons platform=windows toolchain=crossmingw machine=x86 build=profile<br>
with MinGW g++ 7.3 or 7.4 causes an internal compiler error.<br>
<br>
We can work around it by forcing -O1 optimization.<br>
---<br>
src/compiler/glsl/builtin_variables.cpp | 15 +++++++++++++++<br>
1 file changed, 15 insertions(+)<br>
<br>
diff --git a/src/compiler/glsl/builtin_variables.cpp b/src/compiler/glsl/builtin_variables.cpp<br>
index 17ee80c..1b9963a 100644<br>
--- a/src/compiler/glsl/builtin_variables.cpp<br>
+++ b/src/compiler/glsl/builtin_variables.cpp<br>
@@ -21,6 +21,21 @@<br>
* DEALINGS IN THE SOFTWARE.<br>
*/<br>
<br>
+<br>
+/**<br>
+ * Building this file with MinGW g++ 7.3 or 7.4 with:<br>
+ * scons platform=windows toolchain=crossmingw machine=x86 build=profile<br>
+ * triggers an internal compiler error.<br>
+ * Overriding the optimization level to -O1 works around the issue.<br>
+ * MinGW 5.3.1 does not seem to have the bug, neither does 8.3. So for now<br>
+ * we're simply testing for version 7.x here.<br>
+ */<br>
+#if defined(__MINGW32__) && __GNUC__ == 7<br>
+#warning "disabling optimizations for this file to work around compiler bug in MiGW gcc 7.x"<br>
+#pragma GCC optimize("O1")<br>
+#endif<br>
+<br>
+<br>
#include "ir.h"<br>
#include "ir_builder.h"<br>
#include "linker.h"<br>
-- <br>
1.8.5.6<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>