Mesa (master): llvmpipe: work around mingw compiler optimization bug
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Dec 7 17:28:30 UTC 2020
Module: Mesa
Branch: master
Commit: c4342755cc08c2dc3650bdeafa9c07f51b8b87f1
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c4342755cc08c2dc3650bdeafa9c07f51b8b87f1
Author: Michel Zou <xantares09 at hotmail.com>
Date: Thu Dec 3 22:18:55 2020 +0100
llvmpipe: work around mingw compiler optimization bug
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3906
Reviewed-by: Jose Fonseca <jfonseca at vmware.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7914>
---
src/gallium/auxiliary/gallivm/lp_bld_conv.c | 9 +++++++++
1 file changed, 9 insertions(+)
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
More information about the mesa-commit
mailing list