https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105753
Triffid Hunter <triffid.hunter at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |triffid.hunter at gmail dot com --- Comment #5 from Triffid Hunter <triffid.hunter at gmail dot com> --- Created attachment 53561 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53561&action=edit patch based on comment 1 I ran into this issue yesterday (with gcc-13.0.0-20220904). I made the attached patch based on Comment 1, and it does seem to solve the issue. I had some odd lto-related crashes afterwards, but wasn't able to reproduce them after a clean rebuild of my project - so I suspect there was some odd interaction with stale/cached object files. lto crash backtrace in case it's relevant: avr-gcc -Wall -Wextra -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega2560 -fno-stack-protector -o /tmp/arduino_build_820599/sketch_sep10a.ino.elf /tmp/arduino_build_820599/sketch/sketch_sep10a.ino.cpp.o /tmp/arduino_build_820599/libraries/SD/File.cpp.o /tmp/arduino_build_820599/libraries/SD/SD.cpp.o /tmp/arduino_build_820599/libraries/SD/utility/Sd2Card.cpp.o /tmp/arduino_build_820599/libraries/SD/utility/SdFile.cpp.o /tmp/arduino_build_820599/libraries/SD/utility/SdVolume.cpp.o /tmp/arduino_build_820599/libraries/SPI/SPI.cpp.o /tmp/arduino_build_820599/../arduino_cache_495395/core/core_arduino_avr_mega_cpu_atmega2560_0535ac2d4e0500949a67f524c7f20d71.a -L/tmp/arduino_build_820599 -lm lto1: internal compiler error: Segmentation fault 0x135b2a8 internal_error(char const*, ...) ???:0 0x675125 bp_unpack_string(data_in*, bitpack_d*) ???:0 0x986c9e cl_optimization_stream_in(data_in*, bitpack_d*, cl_optimization*) ???:0 0xc3bf60 streamer_read_tree_bitfields(lto_input_block*, data_in*, tree_node*) ???:0 0x904fad lto_input_tree_1(lto_input_block*, data_in*, LTO_tags, unsigned int) ???:0 0x9053d7 lto_input_scc(lto_input_block*, data_in*, unsigned int*, unsigned int*, bool) ???:0 0x5e9fc8 read_cgraph_and_symbols(unsigned int, char const**) ???:0 0x5d7222 lto_main() ???:0 Note: stopped happening after clean project rebuild, but ideally it should throw a proper error rather than a segfault?