From 81dd96cd0ee62172635ad90caa60db69fab2906e Mon Sep 17 00:00:00 2001 From: yjf2002ghty <47345902+yjf2002ghty@users.noreply.github.com> Date: Wed, 10 Jul 2024 21:12:50 +0800 Subject: [PATCH] Fix assertion error when debug=yes and optimize=yes (#810) --- .github/workflows/stockfish.yml | 14 +++++++++++++- src/Makefile | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/stockfish.yml b/.github/workflows/stockfish.yml index 3a40bf7d0..7a6603475 100644 --- a/.github/workflows/stockfish.yml +++ b/.github/workflows/stockfish.yml @@ -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 diff --git a/src/Makefile b/src/Makefile index 4fe40955b..823649fb3 100644 --- a/src/Makefile +++ b/src/Makefile @@ -524,7 +524,7 @@ endif ### 3.3 Optimization ifeq ($(optimize),yes) - CXXFLAGS += -O3 + CXXFLAGS += -O3 -fno-strict-aliasing ifeq ($(comp),gcc) ifeq ($(OS), Android)