Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gcc gives warning when compiling on Raspberry Pi 5 #4932

Open
Torom opened this issue Dec 22, 2023 · 5 comments
Open

gcc gives warning when compiling on Raspberry Pi 5 #4932

Torom opened this issue Dec 22, 2023 · 5 comments
Labels
build needs-analysis Needs further analysis

Comments

@Torom
Copy link
Contributor

Torom commented Dec 22, 2023

Describe the issue

gcc compiles successfully, but gives the following warning:

In member function ‘propagate’,
    inlined from ‘propagate’ at nnue/nnue_architecture.h:107:23,
    inlined from ‘evaluate’ at nnue/evaluate_nnue.cpp:180:55:
nnue/layers/affine_transform_sparse_input.h:249:32: warning: ‘transformedFeatures’ may be used uninitialized [-Wmaybe-uninitialized]
  249 |             const invec_t in = vec_set_32(input32[i]);
      |                                ^
nnue/evaluate_nnue.cpp: In function ‘evaluate’:
nnue/evaluate_nnue.cpp:173:47: note: ‘transformedFeatures’ declared here
  173 |     alignas(alignment) TransformedFeatureType transformedFeatures[FeatureTransformer::BufferSize];
      |

Expected behavior

no warning

Steps to reproduce

$ make build ARCH=armv8 COMP=gcc

Anything else?

$ gcc --version
gcc (Ubuntu 13.2.0-4ubuntu3) 13.2.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Clang compiles without warning.

Operating system

Ubuntu Server 23.10

Stockfish version

fbdf5d9

@Sopel97
Copy link
Member

Sopel97 commented Dec 22, 2023

post the full makefile log

@Torom
Copy link
Contributor Author

Torom commented Dec 22, 2023

$ make build ARCH=armv8 COMP=gcc
Default net: nn-0000000000a0.nnue
nn-0000000000a0.nnue available : OK
Network validated

Config:
debug: 'no'
sanitize: 'none'
optimize: 'yes'
arch: 'armv8'
bits: '64'
kernel: 'Linux'
os: 'GNU/Linux'
prefetch: 'yes'
popcnt: 'yes'
pext: 'no'
sse: 'no'
mmx: 'no'
sse2: 'no'
ssse3: 'no'
sse41: 'no'
avx2: 'no'
avxvnni: 'no'
avx512: 'no'
vnni256: 'no'
vnni512: 'no'
neon: 'yes'
dotprod: 'no'
arm_version: '8'
target_windows: ''

Flags:
CXX: g++
CXXFLAGS:  -Wall -Wcast-qual -fno-exceptions -std=c++17  -pedantic -Wextra -Wshadow -Wmissing-declarations -DUSE_PTHREADS -DNDEBUG -O3 -funroll-loops -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -DGIT_SHA=fbdf5d94 -DGIT_DATE=20231222 -DARCH=armv8 -flto -flto-partition=one
LDFLAGS:   -Wl,--no-as-needed -lpthread  -Wall -Wcast-qual -fno-exceptions -std=c++17  -pedantic -Wextra -Wshadow -Wmissing-declarations -DUSE_PTHREADS -DNDEBUG -O3 -funroll-loops -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -DGIT_SHA=fbdf5d94 -DGIT_DATE=20231222 -DARCH=armv8 -flto -flto-partition=one -flto=jobserver

Testing config sanity. If this fails, try 'make help' ...

make ARCH=armv8 COMP=gcc all
make[1]: Entering directory '/home/torsten/chess/Stockfish_master/src'
g++  -Wall -Wcast-qual -fno-exceptions -std=c++17  -pedantic -Wextra -Wshadow -Wmissing-declarations -DUSE_PTHREADS -DNDEBUG -O3 -funroll-loops -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -DGIT_SHA=fbdf5d94 -DGIT_DATE=20231222 -DARCH=armv8 -flto -flto-partition=one   -c -o benchmark.o benchmark.cpp
g++  -Wall -Wcast-qual -fno-exceptions -std=c++17  -pedantic -Wextra -Wshadow -Wmissing-declarations -DUSE_PTHREADS -DNDEBUG -O3 -funroll-loops -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -DGIT_SHA=fbdf5d94 -DGIT_DATE=20231222 -DARCH=armv8 -flto -flto-partition=one   -c -o bitboard.o bitboard.cpp
g++  -Wall -Wcast-qual -fno-exceptions -std=c++17  -pedantic -Wextra -Wshadow -Wmissing-declarations -DUSE_PTHREADS -DNDEBUG -O3 -funroll-loops -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -DGIT_SHA=fbdf5d94 -DGIT_DATE=20231222 -DARCH=armv8 -flto -flto-partition=one   -c -o evaluate.o evaluate.cpp
g++  -Wall -Wcast-qual -fno-exceptions -std=c++17  -pedantic -Wextra -Wshadow -Wmissing-declarations -DUSE_PTHREADS -DNDEBUG -O3 -funroll-loops -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -DGIT_SHA=fbdf5d94 -DGIT_DATE=20231222 -DARCH=armv8 -flto -flto-partition=one   -c -o main.o main.cpp
g++  -Wall -Wcast-qual -fno-exceptions -std=c++17  -pedantic -Wextra -Wshadow -Wmissing-declarations -DUSE_PTHREADS -DNDEBUG -O3 -funroll-loops -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -DGIT_SHA=fbdf5d94 -DGIT_DATE=20231222 -DARCH=armv8 -flto -flto-partition=one   -c -o misc.o misc.cpp
g++  -Wall -Wcast-qual -fno-exceptions -std=c++17  -pedantic -Wextra -Wshadow -Wmissing-declarations -DUSE_PTHREADS -DNDEBUG -O3 -funroll-loops -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -DGIT_SHA=fbdf5d94 -DGIT_DATE=20231222 -DARCH=armv8 -flto -flto-partition=one   -c -o movegen.o movegen.cpp
g++  -Wall -Wcast-qual -fno-exceptions -std=c++17  -pedantic -Wextra -Wshadow -Wmissing-declarations -DUSE_PTHREADS -DNDEBUG -O3 -funroll-loops -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -DGIT_SHA=fbdf5d94 -DGIT_DATE=20231222 -DARCH=armv8 -flto -flto-partition=one   -c -o movepick.o movepick.cpp
g++  -Wall -Wcast-qual -fno-exceptions -std=c++17  -pedantic -Wextra -Wshadow -Wmissing-declarations -DUSE_PTHREADS -DNDEBUG -O3 -funroll-loops -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -DGIT_SHA=fbdf5d94 -DGIT_DATE=20231222 -DARCH=armv8 -flto -flto-partition=one   -c -o position.o position.cpp
g++  -Wall -Wcast-qual -fno-exceptions -std=c++17  -pedantic -Wextra -Wshadow -Wmissing-declarations -DUSE_PTHREADS -DNDEBUG -O3 -funroll-loops -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -DGIT_SHA=fbdf5d94 -DGIT_DATE=20231222 -DARCH=armv8 -flto -flto-partition=one   -c -o search.o search.cpp
g++  -Wall -Wcast-qual -fno-exceptions -std=c++17  -pedantic -Wextra -Wshadow -Wmissing-declarations -DUSE_PTHREADS -DNDEBUG -O3 -funroll-loops -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -DGIT_SHA=fbdf5d94 -DGIT_DATE=20231222 -DARCH=armv8 -flto -flto-partition=one   -c -o thread.o thread.cpp
g++  -Wall -Wcast-qual -fno-exceptions -std=c++17  -pedantic -Wextra -Wshadow -Wmissing-declarations -DUSE_PTHREADS -DNDEBUG -O3 -funroll-loops -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -DGIT_SHA=fbdf5d94 -DGIT_DATE=20231222 -DARCH=armv8 -flto -flto-partition=one   -c -o timeman.o timeman.cpp
g++  -Wall -Wcast-qual -fno-exceptions -std=c++17  -pedantic -Wextra -Wshadow -Wmissing-declarations -DUSE_PTHREADS -DNDEBUG -O3 -funroll-loops -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -DGIT_SHA=fbdf5d94 -DGIT_DATE=20231222 -DARCH=armv8 -flto -flto-partition=one   -c -o tt.o tt.cpp
g++  -Wall -Wcast-qual -fno-exceptions -std=c++17  -pedantic -Wextra -Wshadow -Wmissing-declarations -DUSE_PTHREADS -DNDEBUG -O3 -funroll-loops -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -DGIT_SHA=fbdf5d94 -DGIT_DATE=20231222 -DARCH=armv8 -flto -flto-partition=one   -c -o uci.o uci.cpp
g++  -Wall -Wcast-qual -fno-exceptions -std=c++17  -pedantic -Wextra -Wshadow -Wmissing-declarations -DUSE_PTHREADS -DNDEBUG -O3 -funroll-loops -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -DGIT_SHA=fbdf5d94 -DGIT_DATE=20231222 -DARCH=armv8 -flto -flto-partition=one   -c -o ucioption.o ucioption.cpp
g++  -Wall -Wcast-qual -fno-exceptions -std=c++17  -pedantic -Wextra -Wshadow -Wmissing-declarations -DUSE_PTHREADS -DNDEBUG -O3 -funroll-loops -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -DGIT_SHA=fbdf5d94 -DGIT_DATE=20231222 -DARCH=armv8 -flto -flto-partition=one   -c -o tune.o tune.cpp
g++  -Wall -Wcast-qual -fno-exceptions -std=c++17  -pedantic -Wextra -Wshadow -Wmissing-declarations -DUSE_PTHREADS -DNDEBUG -O3 -funroll-loops -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -DGIT_SHA=fbdf5d94 -DGIT_DATE=20231222 -DARCH=armv8 -flto -flto-partition=one   -c -o tbprobe.o syzygy/tbprobe.cpp
g++  -Wall -Wcast-qual -fno-exceptions -std=c++17  -pedantic -Wextra -Wshadow -Wmissing-declarations -DUSE_PTHREADS -DNDEBUG -O3 -funroll-loops -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -DGIT_SHA=fbdf5d94 -DGIT_DATE=20231222 -DARCH=armv8 -flto -flto-partition=one   -c -o evaluate_nnue.o nnue/evaluate_nnue.cpp
g++  -Wall -Wcast-qual -fno-exceptions -std=c++17  -pedantic -Wextra -Wshadow -Wmissing-declarations -DUSE_PTHREADS -DNDEBUG -O3 -funroll-loops -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -DGIT_SHA=fbdf5d94 -DGIT_DATE=20231222 -DARCH=armv8 -flto -flto-partition=one   -c -o half_ka_v2_hm.o nnue/features/half_ka_v2_hm.cpp
g++ -o stockfish benchmark.o bitboard.o evaluate.o main.o misc.o movegen.o movepick.o position.o search.o thread.o timeman.o tt.o uci.o ucioption.o tune.o tbprobe.o evaluate_nnue.o half_ka_v2_hm.o   -Wl,--no-as-needed -lpthread  -Wall -Wcast-qual -fno-exceptions -std=c++17  -pedantic -Wextra -Wshadow -Wmissing-declarations -DUSE_PTHREADS -DNDEBUG -O3 -funroll-loops -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8 -DGIT_SHA=fbdf5d94 -DGIT_DATE=20231222 -DARCH=armv8 -flto -flto-partition=one -flto=jobserver
In member function ‘propagate’,
    inlined from ‘propagate’ at nnue/nnue_architecture.h:107:23,
    inlined from ‘evaluate’ at nnue/evaluate_nnue.cpp:180:55:
nnue/layers/affine_transform_sparse_input.h:249:32: warning: ‘transformedFeatures’ may be used uninitialized [-Wmaybe-uninitialized]
  249 |             const invec_t in = vec_set_32(input32[i]);
      |                                ^
nnue/evaluate_nnue.cpp: In function ‘evaluate’:
nnue/evaluate_nnue.cpp:173:47: note: ‘transformedFeatures’ declared here
  173 |     alignas(alignment) TransformedFeatureType transformedFeatures[FeatureTransformer::BufferSize];
      |                                               ^
make[1]: Leaving directory '/home/torsten/chess/Stockfish_master/src'

@Sopel97
Copy link
Member

Sopel97 commented Dec 23, 2023

the build completed successufully

@Torom
Copy link
Contributor Author

Torom commented Dec 23, 2023

oh, you're right

@Torom Torom changed the title gcc fails to compile on Raspberry Pi 5 gcc gives warning when compiling on Raspberry Pi 5 Dec 23, 2023
@Disservin Disservin added build needs-analysis Needs further analysis labels Mar 13, 2024
@vondele
Copy link
Member

vondele commented Mar 30, 2024

can confirm here on aarch64. Valgrind is not functional on the system I have access to, but it would be interesting if @Torom would run once something like valgrind ./stockfish bench

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build needs-analysis Needs further analysis
Projects
None yet
Development

No branches or pull requests

4 participants