Have you ever found the following situation with Erlang/OTP?
I’m not asking about the same platform that I’m using, but the symptoms related to -Ox GCC flag.
Platform: MIPS64 ABI n32
Erlang 29 (maint-29 branch)
GCC version 6.4.0 (CFLAGS and CXXFLAGS: “-meb -mabi=n32 -mhard-float -march=mips64r2”)
Build was ok and erl worked as expected when running on qemu-system and qemu-user.
GCC version 13.4.0 (default build)
By default erlang build uses -O2 -g
export CFLAGS="-meb -mabi=n32 -mhard-float -march=mips64r2"
export CXXFLAGS="-meb -mabi=n32 -mhard-float -march=mips64r2"
./configure && make
Build was ok. But erl crashed when qemu-user mode:
qemu: uncaught target signal 10 (Bus error) - core dumped
Bus error (core dumped)
GCC version 13.4.0 (with -O0)
Build and run were ok:
export CFLAGS="-meb -mabi=n32 -mhard-float -march=mips64r2 -O0 -g -fno-omit-frame-pointer"
export CXXFLAGS="-meb -mabi=n32 -mhard-float -march=mips64r2 -O0 -g -fno-omit-frame-pointer"
./configure && make
GCC version 13.4.0 (with -O1)
Build and run were ok:
export CFLAGS="-meb -mabi=n32 -mhard-float -march=mips64r2 -O1 -g -fno-omit-frame-pointer"
export CXXFLAGS="-meb -mabi=n32 -mhard-float -march=mips64r2 -O1 -g -fno-omit-frame-pointer"
./configure && make
On other hand, when using a real MIPS hardware like -march=octeon3 Erlang/OTP runs fine on the target platform.
It might sounds like some GCC optimization is not ok for MIPS. While this is a niche case, my point is to try to identify where it is and how the bug happens; because it could trigger other issues for other platforms too.
I’ll post some results for Erlang 27, 28 builds.
Thanks.