https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108772
Bug ID: 108772
Summary: [13 Regression] ICE in force_decl_die, at
dwarf2out.cc:26751 since r13-4161-g32d16fe9d7e347bc
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: marxin at gcc dot gnu.org
CC: jakub at gcc dot gnu.org
Target Milestone: ---
Noticed that in Firefox package:
$ cat ice.ii
namespace std {
struct _Sp_counted_base {
virtual void *_M_get_deleter(const int &);
};
bool _S_eq(int);
struct _Sp_make_shared_tag {
static const int &_S_ti() {
static constexpr char __tag{};
return reinterpret_cast<const int &>(__tag);
}
};
struct _Impl {
_Impl(int);
};
int _Sp_counted_ptr_inplace___a;
struct _Sp_counted_ptr_inplace : _Sp_counted_base {
_Sp_counted_ptr_inplace() : _M_impl(_Sp_counted_ptr_inplace___a) {}
void *_M_get_deleter(const int &__ti) {
auto __ptr(_M_ptr());
&__ti == &_Sp_make_shared_tag::_S_ti() || _S_eq(__ti);
return __ptr;
}
int *_M_ptr();
_Impl _M_impl;
};
struct __shared_count {
__shared_count(int, int) { _Sp_counted_ptr_inplace(); }
};
int _M_ptr;
struct __shared_ptr {
template <typename _Alloc>
__shared_ptr(_Alloc __tag) : _M_refcount(_M_ptr, __tag) {}
__shared_count _M_refcount;
};
int shared_ptr___tag;
struct shared_ptr : __shared_ptr {
shared_ptr() : __shared_ptr(shared_ptr___tag) {}
};
void ArgEq() { shared_ptr(); }
} // namespace std
$ g++ ice.ii -flto -fPIC -shared -O1 -fimplicit-constexpr -g1
lto1: internal compiler error: in force_decl_die, at dwarf2out.cc:26770
0x672f7a force_decl_die
/home/marxin/Programming/gcc/gcc/dwarf2out.cc:26770
0x970f8f force_decl_die
/home/marxin/Programming/gcc/gcc/dwarf2out.cc:4940
0x970f8f get_context_die
/home/marxin/Programming/gcc/gcc/dwarf2out.cc:26701
0x970f8f force_decl_die
/home/marxin/Programming/gcc/gcc/dwarf2out.cc:26717
0x984b2d force_decl_die
/home/marxin/Programming/gcc/gcc/dwarf2out.cc:26715
0x984b2d get_context_die
/home/marxin/Programming/gcc/gcc/dwarf2out.cc:26701
0x984b2d flush_limbo_die_list
/home/marxin/Programming/gcc/gcc/dwarf2out.cc:32079
0x988ca8 dwarf2out_finish
/home/marxin/Programming/gcc/gcc/dwarf2out.cc:32155
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: g++ returned 1 exit status
compilation terminated.
mold: fatal: lto-wrapper failed
collect2: error: ld returned 1 exit status