https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108971
Bug ID: 108971
Summary: [13 Regression] ICE in tree_profiling, at
tree-profile.cc:724
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Keywords: ice-on-invalid-code, lto
Severity: normal
Priority: P3
Component: lto
Assignee: unassigned at gcc dot gnu.org
Reporter: asolokha at gmx dot com
CC: marxin at gcc dot gnu.org
Target Milestone: ---
gcc 13.0.1 20230226 snapshot (g:e6d39f68d03c46637ca6e1bede3d28eae6278df3) ICEs
when compiling the following testcase, reduced from
gcc/testsuite/g++.dg/cpp2a/concepts-lambda3.C, w/ -std=c++2a
-fbranch-probabilities -flto -fno-inline:
template<typename T>
concept C1 = __is_same_as(T, int);
template<typename T>
concept IsNotTiny = !__is_same_as(T, char);
void
foo ()
{
auto g = []<C1 T> requires IsNotTiny<T>(T t) -> T
requires IsNotTiny<decltype(t)> { return t; };
[](auto t) requires true { return t; }(5);
[](C1 auto t) { return t; }(5);
auto a0 = [](IsNotTiny auto a) { return [](auto b){ return b; }; };
auto a1 = a0(1);
}
% g++-13 -std=c++2a -fbranch-probabilities -flto -fno-inline -c sanpvd3f.C
sanpvd3f.C:16:13: error: mangling of 'foo()::<lambda(auto:3)> [with auto:3 =
int]' as '_ZZ3foovENKUlT_E1_clIiEEDaS_' conflicts with a previous mangle
16 | auto a0 = [](IsNotTiny auto a) { return [](auto b){ return b; }; };
| ^
sanpvd3f.C:14:3: note: previous mangling 'int
foo()::<lambda(auto:2)>::_ZZ3foovENKUlT_E1_clIiEEDaS_(int) const'
14 | [](C1 auto t) { return t; }(5);
| ^
sanpvd3f.C:16:13: note: a later '-fabi-version=' (or =0) avoids this error with
a change in mangling
16 | auto a0 = [](IsNotTiny auto a) { return [](auto b){ return b; }; };
| ^
during IPA pass: profile
sanpvd3f.C:18:1: internal compiler error: in tree_profiling, at
tree-profile.cc:724
18 | }
| ^
0x859ae9 tree_profiling
/var/tmp/portage/sys-devel/gcc-13.0.1_p20230226/work/gcc-13-20230226/gcc/tree-profile.cc:724
0x859ae9 execute
/var/tmp/portage/sys-devel/gcc-13.0.1_p20230226/work/gcc-13-20230226/gcc/tree-profile.cc:888