https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84462
Bug ID: 84462 Summary: internal compiler error: in output_constructor_regular_field when creating array of structs (with testcase) Product: gcc Version: 7.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: christianlupus at web dot de Target Milestone: --- Host: avr Created attachment 43458 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43458&action=edit Minimal testcase To trigger the problem one needs to invocate # avr-g++ -O0 -v -save-temps -c bug.cpp -o bug.o on the given input file. This results in the following output: Reading specs from /usr/lib/gcc/avr/7.3.0/device-specs/specs-avr2 COLLECT_GCC=avr-g++ Target: avr Configured with: /build/avr-gcc/src/gcc-7-20180125/configure --disable-install-libiberty --disable-libssp --disable-libstdcxx-pch --disable-libunwind-exceptions --disable-linker-build-id --disable-nls --disable-werror --disable-__cxa_atexit --enable-checking=release --enable-clocale=gnu --enable-gnu-unique-object --enable-gold --enable-languages=c,c++ --enable-ld=default --enable-lto --enable-plugin --enable-shared --infodir=/usr/share/info --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --prefix=/usr --target=avr --with-as=/usr/bin/avr-as --with-gnu-as --with-gnu-ld --with-ld=/usr/bin/avr-ld --with-plugin-ld=ld.gold --with-system-zlib --with-isl --enable-gnu-indirect-function Thread model: single gcc version 7.3.0 (GCC) COLLECT_GCC_OPTIONS='-O0' '-v' '-save-temps' '-c' '-o' 'bug.o' '-specs=device-specs/specs-avr2' /usr/lib/gcc/avr/7.3.0/cc1plus -E -quiet -v bug.cpp -mn-flash=6 -mskip-bug -O0 -fpch-preprocess -mn-flash=6 -mskip-bug -fno-rtti -fno-enforce-eh-specs -fno-exceptions -o bug.ii ignoring nonexistent directory "/usr/lib/gcc/avr/7.3.0/../../../../avr/include/c++/7.3.0" ignoring nonexistent directory "/usr/lib/gcc/avr/7.3.0/../../../../avr/include/c++/7.3.0/avr" ignoring nonexistent directory "/usr/lib/gcc/avr/7.3.0/../../../../avr/include/c++/7.3.0/backward" ignoring nonexistent directory "/usr/lib/gcc/avr/7.3.0/../../../../avr/sys-include" #include "..." search starts here: #include <...> search starts here: /usr/lib/gcc/avr/7.3.0/include /usr/lib/gcc/avr/7.3.0/include-fixed /usr/lib/gcc/avr/7.3.0/../../../../avr/include End of search list. COLLECT_GCC_OPTIONS='-O0' '-v' '-save-temps' '-c' '-o' 'bug.o' '-specs=device-specs/specs-avr2' /usr/lib/gcc/avr/7.3.0/cc1plus -fpreprocessed bug.ii -mn-flash=6 -mskip-bug -quiet -dumpbase bug.cpp -auxbase-strip bug.o -O0 -version -mn-flash=6 -mskip-bug -fno-rtti -fno-enforce-eh-specs -fno-exceptions -o bug.s GNU C++14 (GCC) version 7.3.0 (avr) compiled by GNU C version 7.2.1 20180116, GMP version 6.1.2, MPFR version 4.0.0, MPC version 1.1.0, isl version isl-0.18-GMP warning: MPFR header version 4.0.0 differs from library version 4.0.1. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 GNU C++14 (GCC) version 7.3.0 (avr) compiled by GNU C version 7.2.1 20180116, GMP version 6.1.2, MPFR version 4.0.0, MPC version 1.1.0, isl version isl-0.18-GMP warning: MPFR header version 4.0.0 differs from library version 4.0.1. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: 1d5b2c6ab68d14352ece4d9fac25dd7b bug.cpp:33:1: internal compiler error: in output_constructor_regular_field, at varasm.c:5031 } ^ Please submit a full bug report, with preprocessed source if appropriate. See <https://gcc.gnu.org/bugs/> for instructions. When compiling for my amd64 machine the very same error happens, so it seems not to be a problem of the avr target. The gcc was installed as binary version from the Archlinux main repository for amd64. # avr-g++ -v Using built-in specs. Reading specs from /usr/lib/gcc/avr/7.3.0/device-specs/specs-avr2 COLLECT_GCC=avr-g++ COLLECT_LTO_WRAPPER=/usr/lib/gcc/avr/7.3.0/lto-wrapper Target: avr Configured with: /build/avr-gcc/src/gcc-7-20180125/configure --disable-install-libiberty --disable-libssp --disable-libstdcxx-pch --disable-libunwind-exceptions --disable-linker-build-id --disable-nls --disable-werror --disable-__cxa_atexit --enable-checking=release --enable-clocale=gnu --enable-gnu-unique-object --enable-gold --enable-languages=c,c++ --enable-ld=default --enable-lto --enable-plugin --enable-shared --infodir=/usr/share/info --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --prefix=/usr --target=avr --with-as=/usr/bin/avr-as --with-gnu-as --with-gnu-ld --with-ld=/usr/bin/avr-ld --with-plugin-ld=ld.gold --with-system-zlib --with-isl --enable-gnu-indirect-function Thread model: single gcc version 7.3.0 (GCC)