Something in this function causes an internal compiler error on gcc-13.2.0_3
when cross-building from x86_64-musl to aarch64-musl. Disabling optimisations
fixes it.

FAILED: pcbnew/CMakeFiles/pcbnew_kiface_objects.dir/undo_redo.cpp.o 
/builddir/.xbps-kicad/wrappers/aarch64-linux-musl-c++ -DBOOST_CHRONO_DYN_LINK -DBOOST_CHRONO_NO_LIB -DBOOST_LOCALE_DYN_LINK -DBOOST_LOCALE_NO_LIB -DBOOST_THREAD_DYN_LINK -DBOOST_THREAD_NO_LIB -DGLM_FORCE_CTOR_INIT -DHAVE_STDINT_H -DJSON_HAS_FILESYSTEM=0 -DKIAPI_IMPORTEXPORT=APIIMPORT -DKICAD_BUILD_ARCH_X64 -DKICAD_CONFIG_DIR=kicad -DKICAD_IPC_API -DKICAD_SCRIPTING_WXPYTHON -DKICAD_SIGNAL_INTEGRITY -DKICAD_UPDATE_CHECK -DKICAD_USE_EGL -DKICAD_WAYLAND -DNANODBC_ENABLE_UNICODE -DPCBNEW -DPROTOBUF_USE_DLLS -DUSINGZ -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK3__ -D__WXGTK__ -I/builddir/kicad-9.0.0/include -I/builddir/kicad-9.0.0/pcbnew/. -I/builddir/kicad-9.0.0/pcbnew/./dialogs -I/builddir/kicad-9.0.0/pcbnew/./autorouter -I/builddir/kicad-9.0.0/pcbnew/./generators -I/builddir/kicad-9.0.0/3d-viewer -I/builddir/kicad-9.0.0/3d-viewer/dialogs -I/builddir/kicad-9.0.0/common -I/builddir/kicad-9.0.0/common/dialogs -I/builddir/kicad-9.0.0/pcbnew/./exporters -I/builddir/kicad-9.0.0/pcbnew/./importers -I/builddir/kicad-9.0.0/utils/idftools -I/builddir/kicad-9.0.0/pcbnew/./specctra_import_export -I/builddir/kicad-9.0.0/build -I/usr/aarch64-linux-musl/usr/include/python3.13 -I/builddir/kicad-9.0.0/scripting -I/builddir/kicad-9.0.0/pcbnew/python/scripting -I/builddir/kicad-9.0.0/common/swig -I/builddir/kicad-9.0.0/build/pcbnew -I/builddir/kicad-9.0.0/common/. -I/builddir/kicad-9.0.0/thirdparty/argparse/include -I/builddir/kicad-9.0.0/build/api/cpp -I/builddir/kicad-9.0.0/build/api/cpp/api -I/builddir/kicad-9.0.0/thirdparty/pegtl -I/builddir/kicad-9.0.0/thirdparty/magic_enum/magic_enum -I/builddir/kicad-9.0.0/thirdparty/libcontext -I/builddir/kicad-9.0.0/libs/kimath/include -I/builddir/kicad-9.0.0/libs/core/include -I/builddir/kicad-9.0.0/thirdparty/clipper2/Clipper2Lib/include -I/builddir/kicad-9.0.0/thirdparty/other_math -I/builddir/kicad-9.0.0/thirdparty/rtree -I/builddir/kicad-9.0.0/libs/kiplatform/include -I/builddir/kicad-9.0.0/thirdparty/dynamic_bitset -I/builddir/kicad-9.0.0/thirdparty/libpopcnt -I/builddir/kicad-9.0.0/thirdparty/expected/include -I/builddir/kicad-9.0.0/thirdparty/picosha2 -I/builddir/kicad-9.0.0/thirdparty/json_schema_validator -I/builddir/kicad-9.0.0/thirdparty/nlohmann_json -I/builddir/kicad-9.0.0/thirdparty/thread-pool -I/builddir/kicad-9.0.0/build/common -I/builddir/kicad-9.0.0/thirdparty/fmt/include -I/builddir/kicad-9.0.0/libs/kinng/include -I/builddir/kicad-9.0.0/build/include/gal/shaders -I/builddir/kicad-9.0.0/thirdparty/nanosvg -I/builddir/kicad-9.0.0/thirdparty/dxflib_qcad -I/builddir/kicad-9.0.0/thirdparty/tinyspline_lib -I/builddir/kicad-9.0.0/thirdparty/compoundfilereader -I/builddir/kicad-9.0.0/thirdparty/rectpack2d -I/builddir/kicad-9.0.0/thirdparty/gzip-hpp -I /builddir/kicad-9.0.0/thirdparty/pybind11/include -I /builddir/kicad-9.0.0/thirdparty/glew/include -I /usr/aarch64-linux-musl/usr/include/cairo -I /usr/aarch64-linux-musl/usr/include/pixman-1 -I /usr/aarch64-linux-musl/usr/include/freetype2 -I /usr/aarch64-linux-musl/usr/include/harfbuzz -I /usr/aarch64-linux-musl/usr/include/opencascade -I /usr/aarch64-linux-musl/usr/lib/wx/include/gtk3-unicode-3.2 -I /usr/aarch64-linux-musl/usr/include/wx-3.2 -I /builddir/kicad-9.0.0/thirdparty/nanodbc -I /usr/include/python3.13 -DNDEBUG -fstack-clash-protection -D_FORTIFY_SOURCE=2 -O2 -march=armv8-a -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -I/usr/aarch64-linux-musl/usr/include -ffile-prefix-map=/builddir/kicad-9.0.0/build=. -Wno-attributes -Wno-ignored-attributes -pthread -std=c++20 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -ftrivial-auto-var-init=zero -I/usr/aarch64-linux-musl/usr/include -Wall -Wsuggest-override -Wduplicated-branches -Wduplicated-cond -Werror=vla -Wimplicit-fallthrough=5 -Werror=return-type -Wshadow -Wsign-compare -Wmissing-field-initializers -Wempty-body -Wreorder -Wmismatched-tags -Wpessimizing-move -Wredundant-move -Wno-psabi -MD -MT pcbnew/CMakeFiles/pcbnew_kiface_objects.dir/undo_redo.cpp.o -MF pcbnew/CMakeFiles/pcbnew_kiface_objects.dir/undo_redo.cpp.o.d -o pcbnew/CMakeFiles/pcbnew_kiface_objects.dir/undo_redo.cpp.o -c /builddir/kicad-9.0.0/pcbnew/undo_redo.cpp
during RTL pass: postreload
/builddir/kicad-9.0.0/pcbnew/undo_redo.cpp: In member function 'virtual void PCB_BASE_EDIT_FRAME::AppendCopyToUndoList(const PICKED_ITEMS_LIST&, UNDO_REDO)':
/builddir/kicad-9.0.0/pcbnew/undo_redo.cpp:195:1: internal compiler error: in cselib_record_set, at cselib.cc:2722
  195 | }
      | ^
0x7f146f265efa libc_start_main_stage2
	src/env/__libc_start_main.c:94
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

--- a/pcbnew/undo_redo.cpp
+++ b/pcbnew/undo_redo.cpp
@@ -180,7 +180,7 @@
 }
 
 
-void PCB_BASE_EDIT_FRAME::AppendCopyToUndoList( const PICKED_ITEMS_LIST& aItemsList,
+__attribute__ ((optimize("O0"))) void PCB_BASE_EDIT_FRAME::AppendCopyToUndoList( const PICKED_ITEMS_LIST& aItemsList,
                                                 UNDO_REDO aCommandType )
 {
     PICKED_ITEMS_LIST* commandToUndo = PopCommandFromUndoList();
