llvmpipe: work around mingw compiler optimization bug

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3906

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7914>
This commit is contained in:
Michel Zou 2020-12-03 22:18:55 +01:00 committed by Marge Bot
parent ec3828add3
commit c4342755cc
1 changed files with 9 additions and 0 deletions

View File

@ -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