File blis-gcc15-disable-slp-tree-vectorization.patch of Package blis

From 36effd70b6a323856d98b17dda9cc3afd181b658 Mon Sep 17 00:00:00 2001
From: Devin Matthews <damatthews@smu.edu>
Date: Tue, 24 Jun 2025 15:38:15 -0500
Subject: [PATCH] Apply temporary fix for gcc 15. (#874)

Details:
- As reported in #845, gcc 15 fails to build the haswell
  gemmsup kernels due to the use of rbp.
- As a temporary fix, disable slp-tree-vectorization in just
  the affected files.
- Thanks @loveshack for reporting and @chillenb for the suggested
  fix.
- Eventually, the kernels should be rewritten to avoid using rbp.
---
 CREDITS                                                   | 1 +
 kernels/haswell/3/sup/bli_gemmsup_rv_haswell_asm_d6x8m.c  | 7 +++++++
 kernels/haswell/3/sup/bli_gemmsup_rv_haswell_asm_d6x8n.c  | 7 +++++++
 kernels/haswell/3/sup/bli_gemmsup_rv_haswell_asm_s6x16m.c | 7 +++++++
 kernels/haswell/3/sup/bli_gemmsup_rv_haswell_asm_s6x16n.c | 7 +++++++
 5 files changed, 29 insertions(+)

Index: blis-2.0/kernels/haswell/3/sup/bli_gemmsup_rv_haswell_asm_d6x8m.c
===================================================================
--- blis-2.0.orig/kernels/haswell/3/sup/bli_gemmsup_rv_haswell_asm_d6x8m.c
+++ blis-2.0/kernels/haswell/3/sup/bli_gemmsup_rv_haswell_asm_d6x8m.c
@@ -40,6 +40,13 @@
 #pragma GCC optimize("-fno-tree-slp-vectorize")
 #endif
 
+// This avoids a known issue with GCC15 ("error: bp cannot be used in asm here", #845).
+// Only check for version 15 since this may be fixed in 16 (**fingers crossed**), and also
+// make sure the compiler isn't clang since it also confusingly defines __GNUC__
+#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ == 15
+#pragma GCC optimize("-fno-tree-slp-vectorize")
+#endif
+
 #include "blis.h"
 
 #define BLIS_ASM_SYNTAX_ATT
Index: blis-2.0/kernels/haswell/3/sup/bli_gemmsup_rv_haswell_asm_d6x8n.c
===================================================================
--- blis-2.0.orig/kernels/haswell/3/sup/bli_gemmsup_rv_haswell_asm_d6x8n.c
+++ blis-2.0/kernels/haswell/3/sup/bli_gemmsup_rv_haswell_asm_d6x8n.c
@@ -40,6 +40,13 @@
 #pragma GCC optimize("-fno-tree-slp-vectorize")
 #endif
 
+// This avoids a known issue with GCC15 ("error: bp cannot be used in asm here", #845).
+// Only check for version 15 since this may be fixed in 16 (**fingers crossed**), and also
+// make sure the compiler isn't clang since it also confusingly defines __GNUC__
+#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ == 15
+#pragma GCC optimize("-fno-tree-slp-vectorize")
+#endif
+
 #include "blis.h"
 
 #define BLIS_ASM_SYNTAX_ATT
Index: blis-2.0/kernels/haswell/3/sup/bli_gemmsup_rv_haswell_asm_s6x16m.c
===================================================================
--- blis-2.0.orig/kernels/haswell/3/sup/bli_gemmsup_rv_haswell_asm_s6x16m.c
+++ blis-2.0/kernels/haswell/3/sup/bli_gemmsup_rv_haswell_asm_s6x16m.c
@@ -40,6 +40,13 @@
 #pragma GCC optimize("-fno-tree-slp-vectorize")
 #endif
 
+// This avoids a known issue with GCC15 ("error: bp cannot be used in asm here", #845).
+// Only check for version 15 since this may be fixed in 16 (**fingers crossed**), and also
+// make sure the compiler isn't clang since it also confusingly defines __GNUC__
+#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ == 15
+#pragma GCC optimize("-fno-tree-slp-vectorize")
+#endif
+
 #include "blis.h"
 
 #define BLIS_ASM_SYNTAX_ATT
Index: blis-2.0/kernels/haswell/3/sup/bli_gemmsup_rv_haswell_asm_s6x16n.c
===================================================================
--- blis-2.0.orig/kernels/haswell/3/sup/bli_gemmsup_rv_haswell_asm_s6x16n.c
+++ blis-2.0/kernels/haswell/3/sup/bli_gemmsup_rv_haswell_asm_s6x16n.c
@@ -40,6 +40,13 @@
 #pragma GCC optimize("-fno-tree-slp-vectorize")
 #endif
 
+// This avoids a known issue with GCC15 ("error: bp cannot be used in asm here", #845).
+// Only check for version 15 since this may be fixed in 16 (**fingers crossed**), and also
+// make sure the compiler isn't clang since it also confusingly defines __GNUC__
+#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ == 15
+#pragma GCC optimize("-fno-tree-slp-vectorize")
+#endif
+
 #include "blis.h"
 
 #define BLIS_ASM_SYNTAX_ATT
openSUSE Build Service is sponsored by