https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117326
Bug ID: 117326 Summary: ICE: in assign_temp, at function.cc:990 with -flto and attribute constructor Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: iamanonymous.cs at gmail dot com Target Milestone: --- ******************************************************************************* OS and Platform: $ uname -a: Linux 65dac7c84719 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux ******************************************************************************* gcc version: Using built-in specs. COLLECT_GCC=/home/software/gcc-trunk-3aa004f/bin/gcc COLLECT_LTO_WRAPPER=/home/software/gcc-trunk-3aa004f/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc/configure --disable-multilib --disable-bootstrap --enable-languages=c,c++ --prefix=/home/software/gcc-trunk-3aa004f --enable-coverage Thread model: posix Supported LTO compression algorithms: zlib gcc version 15.0.0 20240630 (experimental) (GCC) ******************************************************************************* Program: $ cat mutant.C struct b { b(); b(b &); } a; __attribute__((constructor)) b c() {} ******************************************************************************* Command Lines: $ gcc -flto mutant.C mutant.C: In function 'b c()': mutant.C:5:37: warning: no return statement in function returning non-void [-Wreturn-type] 5 | __attribute__((constructor)) b c() {} | ^ during RTL pass: expand In function '_sub_I_65535_0': lto1: internal compiler error: in assign_temp, at function.cc:990 0x4ddb72b diagnostic_context::report_diagnostic(diagnostic_info*) ???:0 0x4ddbffd diagnostic_context::diagnostic_impl(rich_location*, diagnostic_metadata const*, int, char const*, __va_list_tag (*) [1], diagnostic_t) ???:0 0x4dfc327 internal_error(char const*, ...) ???:0 0x4ddc540 fancy_abort(char const*, int, char const*) ???:0 0x12ece0e assign_temp(tree_node*, int, int) ???:0 0xea6a1f expand_call(tree_node*, rtx_def*, int) ???:0 0x120833c expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) ???:0 0x11f0112 expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) ???:0 0xe8b6c4 expand_expr(tree_node*, rtx_def*, machine_mode, expand_modifier) ???:0 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. lto-wrapper: fatal error: /home/software/gcc-trunk-3aa004f/bin/gcc returned 1 exit status compilation terminated. /usr/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status Godbolt link: https://godbolt.org/z/Yo76Tcr71