https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94185
Bug ID: 94185 Summary: gcc-10 crashes with "error: unable to generate reloads for {*zero_extendsidi2} internal compiler error: in curr_insn_transform, at lra-constraints.c:4006 Product: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: slyfox at inbox dot ru Target Milestone: --- Created attachment 48037 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48037&action=edit bug.cc Originally observed on smartmontools-7.0, reduced with creduce down to: struct a { int b; int c(); a() : b(c()) {} ~a(); char *e(); }; struct f { void g(int); }; struct ar { int au[256]; f h(int); } bb; a i(); a j(int); long k(int, ar); int d; void l(char *, ar m, long n) { switch (m.au[d]) case 0: n &= 4294967295; bb.h(0).g(n); } void o() { ar bd; a bh, bi, attrname = j(0) = i(); int be = k(0, bd); l(attrname.e(), bd, be); } Exact command to crash gcc-master: $ ./xg++ -B. -O2 -c -o /tmp/bug.o /tmp/bug.cc -fstack-protector-strong -fPIE /tmp/bug.cc: In function 'void o()': /tmp/bug.cc:30:1: error: unable to generate reloads for: 30 | } | ^ (insn 62 61 63 8 (set (mem/c:DI (plus:DI (reg/f:DI 19 frame) (const_int -2152 [0xfffffffffffff798])) [7 %sfp+-2104 S8 A64]) (zero_extend:DI (mem/c:SI (plus:DI (reg/f:DI 19 frame) (const_int -2152 [0xfffffffffffff798])) [7 %sfp+-2104 S4 A64]))) "/tmp/bug.cc":22:7 114 {*zero_extendsidi2} (nil)) during RTL pass: reload /tmp/bug.cc:30:1: internal compiler error: in curr_insn_transform, at lra-constraints.c:4006 0x7fc532a94dd9 __libc_start_main ../csu/libc-start.c:308 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. Compiler is built as: $ ./xg++ -B. -v Reading specs from ./specs COLLECT_GCC=./xg++ COLLECT_LTO_WRAPPER=./lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc/configure --enable-languages=c,c++ --disable-bootstrap --with-multilib-list=m64 --prefix=/home/slyfox/dev/git/gcc-native-quick/../gcc-native-quick-installed --disable-nls --without-isl --disable-libsanitizer --disable-libvtv --disable-libgomp --disable-libstdcxx-pch --disable-libunwind-exceptions CFLAGS='-O1 ' CXXFLAGS='-O1 ' --with-sysroot=/usr/x86_64-HEAD-linux-gnu Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 10.0.1 20200315 (experimental) (GCC)