Created attachment 56573 [details] rsa.i Initially reported downstream in Gentoo at https://bugs.gentoo.org/917294 by Toralf Förster. ``` gcc -Wno-error=maybe-uninitialized -DARCH=i386 -DPLATFORM=pcbios -DPLATFORM_pcbios -DSECUREBOOT=0 -march=i386 -fomit-frame-pointer -fstrength-reduce -falign-jumps=1 -falign-loops=1 -falign-functions=1[8/9086] rred-stack-boundary=2 -mregparm=3 -mrtd -freg-struct-return -m32 -fshort-wchar -Ui386 -Ulinux -DNVALGRIND -UPXE_DHCP_STRICT -DPXE_DHCP_STRICT -UNO_POST_PROMPT -DNO_POST_PROMPT -UCONSOLE_SERIAL -DCONSOLE_SERIA L=1 -fno-stack-protector -Iinclude -I. -Iarch/x86/include -Iarch/i386/include -Iarch/i386/include/pcbios -Os -g -ffreestanding -fcommon -Wall -W -Wformat-nonliteral -fno-dwarf2-cfi-asm -fno-exceptions -fno-u nwind-tables -fno-asynchronous-unwind-tables -Wno-address -Wno-stringop-truncation -Wno-address-of-packed-member -fno-PIE -no-pie -fcf-protection=none -Werror -ffunction-sections -include include/compiler. h -DASM_TCHAR='@' -DASM_TCHAR_OPS='@' -DOBJECT=rsa -c crypto/rsa.c -o bin/rsa.o during IPA pass: inline crypto/rsa.c: In function ‘rsa_init’: crypto/rsa.c:249:21: internal compiler error: in make_ssa_name_fn, at tree-ssanames.cc:354 249 | if ( ( rc = rsa_alloc ( context, modulus.len, exponent.len ) ) != 0 ) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 0x5607a5714e59 make_ssa_name_fn(function*, tree_node*, gimple*, unsigned int) /usr/src/debug/sys-devel/gcc-14.0.0_pre20231112/gcc-14-20231112/gcc/tree-ssanames.cc:354 0x5607a6f6e3ce make_ssa_name(tree_node*, gimple*) /usr/src/debug/sys-devel/gcc-14.0.0_pre20231112/gcc-14-20231112/gcc/tree-ssanames.h:98 0x5607a6f6e3ce remap_ssa_name /usr/src/debug/sys-devel/gcc-14.0.0_pre20231112/gcc-14-20231112/gcc/tree-inline.cc:237 0x5607a6f1149a copy_tree_body_r(tree_node**, int*, void*) /usr/src/debug/sys-devel/gcc-14.0.0_pre20231112/gcc-14-20231112/gcc/tree-inline.cc:1226 0x5607a6d60131 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*, tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_n ode**, int*, void*), void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*)) /usr/src/debug/sys-devel/gcc-14.0.0_pre20231112/gcc-14-20231112/gcc/tree.cc:11417 0x5607a6d60255 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*, tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_n ode**, int*, void*), void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*)) /usr/src/debug/sys-devel/gcc-14.0.0_pre20231112/gcc-14-20231112/gcc/tree.cc:11651 0x5607a6d60255 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*, tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_n ode**, int*, void*), void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*)) /usr/src/debug/sys-devel/gcc-14.0.0_pre20231112/gcc-14-20231112/gcc/tree.cc:11651 0x5607a772fb51 remap_type_1 /usr/src/debug/sys-devel/gcc-14.0.0_pre20231112/gcc-14-20231112/gcc/tree-inline.cc:595 0x5607a6efff70 remap_type(tree_node*, copy_body_data*) /usr/src/debug/sys-devel/gcc-14.0.0_pre20231112/gcc-14-20231112/gcc/tree-inline.cc:713 0x5607a6ef7e68 remap_decl(tree_node*, copy_body_data*) /usr/src/debug/sys-devel/gcc-14.0.0_pre20231112/gcc-14-20231112/gcc/tree-inline.cc:377 0x5607a6f1e5ff remap_decls /usr/src/debug/sys-devel/gcc-14.0.0_pre20231112/gcc-14-20231112/gcc/tree-inline.cc:762 0x5607a6f1c41c remap_block /usr/src/debug/sys-devel/gcc-14.0.0_pre20231112/gcc-14-20231112/gcc/tree-inline.cc:820 0x5607a6f1c41c remap_blocks /usr/src/debug/sys-devel/gcc-14.0.0_pre20231112/gcc-14-20231112/gcc/tree-inline.cc:839 0x5607a6f1c51a remap_blocks /usr/src/debug/sys-devel/gcc-14.0.0_pre20231112/gcc-14-20231112/gcc/tree-inline.cc:842 0x5607a6f1c51a remap_blocks /usr/src/debug/sys-devel/gcc-14.0.0_pre20231112/gcc-14-20231112/gcc/tree-inline.cc:842 0x5607a6f2c935 expand_call_inline /usr/src/debug/sys-devel/gcc-14.0.0_pre20231112/gcc-14-20231112/gcc/tree-inline.cc:5028 0x5607a6f25253 optimize_inline_calls(tree_node*) /usr/src/debug/sys-devel/gcc-14.0.0_pre20231112/gcc-14-20231112/gcc/tree-inline.cc:5315 0x5607a6ef561a inline_transform(cgraph_node*) /usr/src/debug/sys-devel/gcc-14.0.0_pre20231112/gcc-14-20231112/gcc/ipa-inline-transform.cc:790 0x5607a6ef1935 execute_one_ipa_transform_pass /usr/src/debug/sys-devel/gcc-14.0.0_pre20231112/gcc-14-20231112/gcc/passes.cc:2333 0x5607a6ef1935 execute_all_ipa_transforms(bool) /usr/src/debug/sys-devel/gcc-14.0.0_pre20231112/gcc-14-20231112/gcc/passes.cc:2396 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See <https://bugs.gentoo.org/> for instructions. make: *** [Makefile.housekeeping:952: bin/rsa.o] Error 1 ``` ``` Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/14/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /var/tmp/portage/sys-devel/gcc-14.0.0_pre20231112/work/gcc-14-20231112/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/14 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/14/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/14 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/14/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/14/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14 --disable-silent-rules --disable-dependency-tracking --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/14/python --enable-languages=c,c++,fortran,rust --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --disable-libunwind-exceptions --enable-checking=yes,extra,rtl --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo Hardened 14.0.0_pre20231112 p8' --with-gcc-major-version-only --enable-libstdcxx-time --enable-lto --disable-libstdcxx-pch --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64 --disable-fixed-point --enable-targets=all --enable-libgomp --disable-libssp --disable-libada --enable-cet --disable-systemtap --enable-valgrind-annotations --disable-vtable-verify --disable-libvtv --with-zstd --with-isl --disable-isl-version-check --enable-default-pie --enable-host-pie --enable-host-bind-now --enable-default-ssp --with-build-config='bootstrap-O3 bootstrap-lto bootstrap-cet' Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 14.0.0 20231109 (experimental) (Gentoo Hardened 14.0.0_pre20231112 p8) ``` I can reproduce with 'gcc -c rsa.i -O2'.
Dup of bug 112488. *** This bug has been marked as a duplicate of bug 112488 ***
The reduced testcase contains: ``` size_t tmp_len = ({ size_t mod_multiply_len = ({ sizeof(struct { struct { } temp_modulus; }); }); sizeof(struct { struct { bigint_element_t element[(size)]; } temp_exponent; uint8_t mod_multiply[mod_multiply_len]; }); }); struct { uint8_t tmp[tmp_len]; } __attribute__((packed)) * dynamic; ``` Which is the same VLA inside struct as what is in PR 112488 .