https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116113
Bug ID: 116113 Summary: ICE: Segmentation fault (maybe_convert_cond) 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: --- Target: x86_64 ******************************************************************************* The compiler produces a segfault during maybe_convert_cond when compiling the provided code with the specified options. The issue can also be reproduced on Compiler Explorer. ******************************************************************************* OS and Platform: # uname -a Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux ******************************************************************************* # g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/home/gcc-set/gcc24-7-24/gccbin/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /home/gcc-set/gcc24-7-24/configure --prefix=/home/gcc-set/gcc24-7-24/gccbin --enable-languages=c,c++,fortran,go --disable-multilib Thread model: posix Supported LTO compression algorithms: zlib gcc version 15.0.0 20240724 (experimental) (GCC) ******************************************************************************* Program:Please refer to the attachment. ******************************************************************************* Command Lines: #g++ scanner-pp.cpp -fprofile-arcs -ftest-coverage -O3 -o scanner-pp ... ... ... ... /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/type_traits:100019:37: error: no match for ‘operator*’ (operand type is ‘std::vector<dwarfs::inode_manager::fragment_info>::iterator’) /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/type_traits:100022:19: internal compiler error: Segmentation fault 0x27f432e internal_error(char const*, ...) /home/gcc-set/gcc24-7-24/gcc/diagnostic-global-context.cc:491 0x1412bf6 crash_signal /home/gcc-set/gcc24-7-24/gcc/toplev.cc:319 0xd4b8e5 maybe_convert_cond /home/gcc-set/gcc24-7-24/gcc/cp/semantics.cc:974 0xd4b946 maybe_convert_cond /home/gcc-set/gcc24-7-24/gcc/cp/semantics.cc:966 0xd4b946 finish_if_stmt_cond(tree_node*, tree_node*) /home/gcc-set/gcc24-7-24/gcc/cp/semantics.cc:1154 0xcb0624 cp_parser_selection_statement /home/gcc-set/gcc24-7-24/gcc/cp/parser.cc:13706 0xc76dba cp_parser_statement /home/gcc-set/gcc24-7-24/gcc/cp/parser.cc:12743 0xc79f8f cp_parser_statement_seq_opt /home/gcc-set/gcc24-7-24/gcc/cp/parser.cc:13451 0xcae86e cp_parser_already_scoped_statement /home/gcc-set/gcc24-7-24/gcc/cp/parser.cc:15134 0xcb137b cp_parser_iteration_statement /home/gcc-set/gcc24-7-24/gcc/cp/parser.cc:14743 0xc76d91 cp_parser_statement /home/gcc-set/gcc24-7-24/gcc/cp/parser.cc:12750 0xc79f8f cp_parser_statement_seq_opt /home/gcc-set/gcc24-7-24/gcc/cp/parser.cc:13451 0xc7a20f cp_parser_compound_statement /home/gcc-set/gcc24-7-24/gcc/cp/parser.cc:13298 0xcb00c5 cp_parser_implicitly_scoped_statement /home/gcc-set/gcc24-7-24/gcc/cp/parser.cc:15070 0xcb0697 cp_parser_selection_statement /home/gcc-set/gcc24-7-24/gcc/cp/parser.cc:13727 0xc76dba cp_parser_statement /home/gcc-set/gcc24-7-24/gcc/cp/parser.cc:12743 0xc79f8f cp_parser_statement_seq_opt /home/gcc-set/gcc24-7-24/gcc/cp/parser.cc:13451 0xc7a20f cp_parser_compound_statement /home/gcc-set/gcc24-7-24/gcc/cp/parser.cc:13298 0xca2585 cp_parser_function_body /home/gcc-set/gcc24-7-24/gcc/cp/parser.cc:26175 0xca2585 cp_parser_ctor_initializer_opt_and_function_body /home/gcc-set/gcc24-7-24/gcc/cp/parser.cc:26226 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. ******************************************************************************* Also ICE on trunk, compiler explorer:https://godbolt.org/z/zen4vYrj5 *******************************************************************************