https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114194
Bug ID: 114194
Summary: ICE when using std::unique_ptr with xtheadvector
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: camel-cdr at protonmail dot com
Target Milestone: ---
Using std::unique_ptr with xtheadvector enabled causes an ICE:
#include <memory>
extern void use(std::unique_ptr<int> &x);
void test(size_t n) {
std::unique_ptr<int> x;
use(x);
}
See also: https://godbolt.org/z/6nbhxKdfd
I've managed to reduce the problem to the following set of templates, but I
have no idea how this could cause the ICE.
struct S1 { int x; };
struct S2 { constexpr S2() { } template<class T> S2(T&); };
struct S3 : S1, S2 { constexpr S3() : S1() { } S3(S3&); };
void f(S3 &) { S3 x; f(x); }
See also: https://godbolt.org/z/5YxM6jd3s
It's extremely brittle, the ICE goes away, if you remove constexpr, the
reference, or any other part I could think of.