1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
  
     | 
    
      From e4d7c2f46d8bbfc9b310cd62ec0ea84939b389dc Mon Sep 17 00:00:00 2001
From: Devin Matthews <damatthews@smu.edu>
Date: Tue, 24 Jun 2025 15:38:15 -0500
Subject: 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.
(cherry picked from commit 36effd70b6a323856d98b17dda9cc3afd181b658)
---
 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(+)
diff --git a/CREDITS b/CREDITS
index 0969974d..3809ee0b 100644
--- a/CREDITS
+++ b/CREDITS
@@ -52,6 +52,7 @@ but many others have contributed code, ideas, and feedback, including
   Jean-Michel Hautbois     @jhautbois
   Ian Henriksen            @insertinterestingnamehere (The University of Texas at Austin)
   Greg Henry                                          (Intel)
+  Christopher Hillenbrand  @chillenb
   Minh Quan Ho             @hominhquan
   Matthew Honnibal         @honnibal
   Stefan Husmann           @stefanhusmann
diff --git a/kernels/haswell/3/sup/bli_gemmsup_rv_haswell_asm_d6x8m.c b/kernels/haswell/3/sup/bli_gemmsup_rv_haswell_asm_d6x8m.c
index c5927c3d..0a68285c 100644
--- a/kernels/haswell/3/sup/bli_gemmsup_rv_haswell_asm_d6x8m.c
+++ b/kernels/haswell/3/sup/bli_gemmsup_rv_haswell_asm_d6x8m.c
@@ -33,6 +33,13 @@
 
 */
 
+// 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
diff --git a/kernels/haswell/3/sup/bli_gemmsup_rv_haswell_asm_d6x8n.c b/kernels/haswell/3/sup/bli_gemmsup_rv_haswell_asm_d6x8n.c
index cb784d6a..a794e6a3 100644
--- a/kernels/haswell/3/sup/bli_gemmsup_rv_haswell_asm_d6x8n.c
+++ b/kernels/haswell/3/sup/bli_gemmsup_rv_haswell_asm_d6x8n.c
@@ -33,6 +33,13 @@
 
 */
 
+// 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
diff --git a/kernels/haswell/3/sup/bli_gemmsup_rv_haswell_asm_s6x16m.c b/kernels/haswell/3/sup/bli_gemmsup_rv_haswell_asm_s6x16m.c
index de2b71c4..eaf7b7bd 100644
--- a/kernels/haswell/3/sup/bli_gemmsup_rv_haswell_asm_s6x16m.c
+++ b/kernels/haswell/3/sup/bli_gemmsup_rv_haswell_asm_s6x16m.c
@@ -33,6 +33,13 @@
 
 */
 
+// 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
diff --git a/kernels/haswell/3/sup/bli_gemmsup_rv_haswell_asm_s6x16n.c b/kernels/haswell/3/sup/bli_gemmsup_rv_haswell_asm_s6x16n.c
index 456866b2..16c90d40 100644
--- a/kernels/haswell/3/sup/bli_gemmsup_rv_haswell_asm_s6x16n.c
+++ b/kernels/haswell/3/sup/bli_gemmsup_rv_haswell_asm_s6x16n.c
@@ -33,6 +33,13 @@
 
 */
 
+// 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
-- 
2.30.2
 
     |