public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/114194] New: ICE when using std::unique_ptr with xtheadvector
@ 2024-03-01 17:02 camel-cdr at protonmail dot com
  2024-03-02  9:22 ` [Bug target/114194] " pinskia at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: camel-cdr at protonmail dot com @ 2024-03-01 17:02 UTC (permalink / raw)
  To: gcc-bugs

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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-03-22  7:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-01 17:02 [Bug target/114194] New: ICE when using std::unique_ptr with xtheadvector camel-cdr at protonmail dot com
2024-03-02  9:22 ` [Bug target/114194] " pinskia at gcc dot gnu.org
2024-03-04 14:14 ` pinskia at gcc dot gnu.org
2024-03-04 19:26 ` bruce at hoult dot org
2024-03-04 23:27 ` bruce at hoult dot org
2024-03-05  0:04 ` bruce at hoult dot org
2024-03-05  2:21 ` bruce at hoult dot org
2024-03-21 15:20 ` cmuellner at gcc dot gnu.org
2024-03-22  7:43 ` cmuellner at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).