[Mesa-dev] [PATCH] glsl: work around MinGW 7.x compiler bug

Eric Engestrom eric at engestrom.ch
Thu May 2 08:07:54 UTC 2019


On 2019-05-01 at 21:35, Brian Paul <brianp at vmware.com> wrote:
> I'm not sure what triggered this, but building with
> scons platform=windows toolchain=crossmingw machine=x86 build=profile
> with MinGW g++ 7.3 or 7.4 causes an internal compiler error.
> 
> We can work around it by forcing -O1 optimization.
> ---
>  src/compiler/glsl/builtin_variables.cpp | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/src/compiler/glsl/builtin_variables.cpp 
> b/src/compiler/glsl/builtin_variables.cpp
> index 17ee80c..1b9963a 100644
> --- a/src/compiler/glsl/builtin_variables.cpp
> +++ b/src/compiler/glsl/builtin_variables.cpp
> @@ -21,6 +21,21 @@
>   * DEALINGS IN THE SOFTWARE.
>   */
>  
> +
> +/**
> + * Building this file with MinGW g++ 7.3 or 7.4 with:
> + *   scons platform=windows toolchain=crossmingw machine=x86 
> build=profile
> + * triggers an internal compiler error.
> + * Overriding the optimization level to -O1 works around the issue.
> + * MinGW 5.3.1 does not seem to have the bug, neither does 8.3.  So 
> for now
> + * we're simply testing for version 7.x here.
> + */
> +#if defined(__MINGW32__) && __GNUC__ == 7
> +#warning "disabling optimizations for this file to work around 
> compiler bug in MiGW gcc 7.x"

Typo: s/MiGW/MinGW/

> +#pragma GCC optimize("O1")
> +#endif
> +
> +
>  #include "ir.h"
>  #include "ir_builder.h"
>  #include "linker.h"
> -- 
> 1.8.5.6
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list