https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108110
Sergei Trofimovich <slyfox at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |slyfox at gcc dot gnu.org
--- Comment #14 from Sergei Trofimovich <slyfox at gcc dot gnu.org> ---
Got a similar ICE on minetest-5.6.1. With a bit of manual cleanup reduced down
to the following:
//$ cat bug.cc
void __throw_out_of_range_fmt(...);
char *_M_p;
struct Trans_NS___cxx11_basic_string {
long _M_string_length;
long _M_check___pos;
Trans_NS___cxx11_basic_string() {
long __length = 0;
_M_string_length = __length;
}
long size() { return _M_string_length; }
long foo___pos;
char foo() { return _M_p[foo___pos]; }
int compare() { __throw_out_of_range_fmt(_M_check___pos, _M_string_length);
__builtin_trap(); }
};
bool str_starts_with(Trans_NS___cxx11_basic_string &str,
Trans_NS___cxx11_basic_string prefix) {
if (str.size() < prefix.size())
str.compare();
for (; prefix.size();) {
char __trans_tmp_2 = prefix.foo();
if (__trans_tmp_2)
return false;
}
__builtin_trap();
}
void testStartsWith() {
Trans_NS___cxx11_basic_string s1, s2;
str_starts_with(s1, s2);
}
$ g++ -Wall -Wextra -O3 -c bug.cc
during IPA pass: inline
bug.cc: In function 'void testStartsWith()':
bug.cc:28:18: internal compiler error: in modify_call, at
ipa-param-manipulation.cc:700
28 | str_starts_with(s1, s2);
| ~~~~~~~~~~~~~~~^~~~~~~~
0x1cbdfd4 diagnostic_impl(rich_location*, diagnostic_metadata const*, int, char
const*, __va_list_tag (*) [1], diagnostic_t)
???:0
0x1cbec26 internal_error(char const*, ...)
???:0
0x753df0 fancy_abort(char const*, int, char const*)
???:0
0x723afe ipa_param_adjustments::modify_call(cgraph_edge*, bool) [clone .cold]
???:0
0xa4e735 cgraph_edge::redirect_call_stmt_to_callee(cgraph_edge*)
???:0
0xec8a13 redirect_all_calls(copy_body_data*, basic_block_def*)
???:0
0xece256 copy_body(copy_body_data*, basic_block_def*, basic_block_def*,
basic_block_def*) [clone .isra.0]
???:0
0xed1ded expand_call_inline(basic_block_def*, gimple*, copy_body_data*,
bitmap_head*)
???:0
0xed3b69 optimize_inline_calls(tree_node*)
???:0
0xc3f753 inline_transform(cgraph_node*)
???:0
0xd8d1ff execute_all_ipa_transforms(bool)
???:0
0xa54b3f cgraph_node::expand()
???:0
0xa5604d symbol_table::compile() [clone .part.0]
???:0
0xa58517 symbol_table::finalize_compilation_unit()
???:0