diff --git a/src/gallium/auxiliary/gallivm/lp_bld_conv.c b/src/gallium/auxiliary/gallivm/lp_bld_conv.c index c68b8850473..31affad2233 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_conv.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_conv.c @@ -78,6 +78,15 @@ #include "lp_bld_format.h" +/* the lp_test_format test fails on mingw/i686 at -O2 + * it is ok with gcc 9.3, but not for 10.2, assume broken for gcc>=10 + * ref https://gitlab.freedesktop.org/mesa/mesa/-/issues/3906 + */ + +#if defined(__MINGW32__) && !defined(__MINGW64__) && ((__GNUC__ * 100) + __GNUC_MINOR >= 1000) +#warning "disabling caller-saves optimization for this file to work around compiler bug" +#pragma GCC optimize("-fno-caller-saves") +#endif /** * Converts int16 half-float to float32