瀏覽代碼

Workaround GCC 6 & 7 ICE on armv7hl

Fixes #16100.
Rémi Verschelde 6 年之前
父節點
當前提交
2211d73300
共有 1 個文件被更改,包括 14 次插入0 次删除
  1. 14 0
      modules/gdnative/gdnative/variant.cpp

+ 14 - 0
modules/gdnative/gdnative/variant.cpp

@@ -37,8 +37,22 @@
 extern "C" {
 extern "C" {
 #endif
 #endif
 
 
+// Workaround GCC ICE on armv7hl which was affected GCC 6.0 up to 8.0 (GH-16100).
+// It was fixed upstream in 8.1, and a fix was backported to 7.4.
+// This can be removed once no supported distro ships with versions older than 7.4.
+#if defined(__arm__) && defined(__GNUC__) && !defined(__clang__) && \
+		(__GNUC__ == 6 || (__GNUC__ == 7 && __GNUC_MINOR__ < 4) || (__GNUC__ == 8 && __GNUC_MINOR__ < 1))
+#pragma GCC push_options
+#pragma GCC optimize("-O0")
+#endif
+
 #define memnew_placement_custom(m_placement, m_class, m_constr) _post_initialize(new (m_placement, sizeof(m_class), "") m_constr)
 #define memnew_placement_custom(m_placement, m_class, m_constr) _post_initialize(new (m_placement, sizeof(m_class), "") m_constr)
 
 
+#if defined(__arm__) && defined(__GNUC__) && !defined(__clang__) && \
+		(__GNUC__ == 6 || (__GNUC__ == 7 && __GNUC_MINOR__ < 4) || (__GNUC__ == 8 && __GNUC_MINOR__ < 1))
+#pragma GCC pop_options
+#endif
+
 // Constructors
 // Constructors
 
 
 godot_variant_type GDAPI godot_variant_get_type(const godot_variant *p_self) {
 godot_variant_type GDAPI godot_variant_get_type(const godot_variant *p_self) {