https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115815
Bug ID: 115815 Summary: ICE: in purge_all_uses, at ipa-param-manipulation.cc:632 with -O2 -flto and attribute destructor Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ipa 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 int a; __attribute__((destructor)) int b() { return a + b(); } ******************************************************************************* Command Lines: $ gcc -O2 -flto mutant.c during IPA pass: inline mutant.c: In function 'b': mutant.c:2:33: internal compiler error: in purge_all_uses, at ipa-param-manipulation.cc:632 2 | __attribute__((destructor)) int b() { return a + b(); } | ^ 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 0x1668655 ipa_param_adjustments::modify_call(cgraph_edge*, bool, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*) ???:0 0xf86d7b cgraph_edge::redirect_call_stmt_to_callee(cgraph_edge*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*) ???:0 0x15d1d7c inline_transform(cgraph_node*) ???:0 0x19733ad execute_all_ipa_transforms(bool) ???:0 0xfae996 cgraph_node::expand() ???:0 0xfb0eb4 symbol_table::compile() ???:0 0xd8faf4 lto_main() ???: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 Also ICE on trunk. Compiler Explorer: https://godbolt.org/z/oP8hn3Ej8