Fix assertion error when debug=yes and optimize=yes (#810)
authoryjf2002ghty <47345902+yjf2002ghty@users.noreply.github.com>
Wed, 10 Jul 2024 13:12:50 +0000 (21:12 +0800)
committerGitHub <noreply@github.com>
Wed, 10 Jul 2024 13:12:50 +0000 (15:12 +0200)
.github/workflows/stockfish.yml
src/Makefile

index 3a40bf7..7a66034 100644 (file)
@@ -46,7 +46,7 @@ jobs:
       - name: Download required packages
         run: |
           sudo apt update
-          sudo apt install expect valgrind g++-multilib
+          sudo apt install expect valgrind g++-multilib llvm
 
       - name: Download the used network from the fishtest framework
         run: |
@@ -74,6 +74,12 @@ jobs:
           make -j2 ARCH=x86-32 optimize=no debug=yes build
           ../tests/signature.sh $benchref
 
+      - name: Test debug x86-32 profile build (Optimization on, All features)
+        run: |
+          export CXXFLAGS=""
+          make clean
+          make -j2 ARCH=x86-32 optimize=yes all=yes largeboards=yes debug=yes profile-build
+
       - name: Test x86-32 build
         run: |
           make clean
@@ -107,6 +113,12 @@ jobs:
           make -j2 ARCH=x86-64-modern optimize=no debug=yes build
           ../tests/signature.sh $benchref
 
+      - name: Test debug x86-64-modern profile build (Optimization on, All features)
+        run: |
+          export CXXFLAGS=""
+          make clean
+          make -j2 ARCH=x86-64-modern optimize=yes all=yes largeboards=yes debug=yes profile-build
+
       - name: Test x86-64-modern build
         run: |
           make clean
index 4fe4095..823649f 100644 (file)
@@ -524,7 +524,7 @@ endif
 ### 3.3 Optimization
 ifeq ($(optimize),yes)
 
-       CXXFLAGS += -O3
+       CXXFLAGS += -O3 -fno-strict-aliasing
 
        ifeq ($(comp),gcc)
                ifeq ($(OS), Android)