From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A3F333858C52; Fri, 28 Apr 2023 14:08:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A3F333858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682690917; bh=VprMCshNFI8k9eNW7CiWtkND9Qo6hYjPfvGUa+8Htmg=; h=From:To:Subject:Date:From; b=DhWwVPcP75xbT5O0Li4CspR9ef32xM8HzaYTnNW8tcdlbv2yZ1njPkC/8DHgXd6yb O8ALYbTTv39IpoVbHvAbr3RX58uR1a03UX39HCkfjtK7qYzOUUNsAWjmXCPkaemybG rBSTLzYor3auA7VyzXqDIy6H3P1vto+nlYu6qFNU= From: "carlosgalvezp at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109669] New: Internal Compiler Error when zero-initializing std::array Date: Fri, 28 Apr 2023 14:08:37 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: carlosgalvezp at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109669 Bug ID: 109669 Summary: Internal Compiler Error when zero-initializing std::array Product: gcc Version: 13.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: carlosgalvezp at gmail dot com Target Milestone: --- Hi, We are getting an ICE when bumping from 6910cad55ffc330dc9767d2c8e0b66ccfa4134af to cc035c5d8672f87dc8c2756d9f8367903aa72d93 (GCC 13.1.0 release) on the follow= ing reduced example: #include template struct Point { private: T value_[n]{}; }; struct Edge { Point start{}; Point end{}; }; template class StaticVector { public: static StaticVector create() { StaticVector output; return output; } private: std::array data{}; }; class Polygon { public: using Edges =3D StaticVector; Edges edges() const { auto edges =3D Edges::create(); return edges; } }; void foo() { Polygon polygon{}; auto const edges =3D polygon.edges(); } Godbolt: https://godbolt.org/z/183zv1xrK Error: : In instantiation of 'constexpr StaticVector::StaticVector()': :22:22: required from 'static StaticVector StaticVector::create() [with T =3D Edge; long unsigned int n =3D 3]' :36:35: required from here :27:22: internal compiler error: Segmentation fault 27 | std::array data{}; | ^~~~ 0x234da0e internal_error(char const*, ...) ???:0 0xccea48 finish_for_cond(tree_node*, tree_node*, bool, unsigned short) ???:0 0xb7bad3 build_vec_init(tree_node*, tree_node*, tree_node*, bool, int, int, vec**) ???:0 0xce5cfb expand_vec_init_expr(tree_node*, tree_node*, int, vec**) ???:0 0xd200c1 digest_nsdmi_init(tree_node*, tree_node*, int) ???:0 0xb813b7 maybe_instantiate_nsdmi_init(tree_node*, int) ???:0 0xb819f9 get_nsdmi(tree_node*, bool, int) ???:0 0xba932d get_defaulted_eh_spec(tree_node*, int) ???:0 0xc76d4a maybe_instantiate_noexcept(tree_node*, int) ???:0 0xc76b5a maybe_instantiate_noexcept(tree_node*, int) ???:0 0xb5c2b3 mark_used(tree_node*, int) ???:0 0xa9931e build_new_method_call(tree_node*, tree_node*, vec**, tree_node*, int, tree_node**, int) ???:0 0xa9a4c7 build_special_member_call(tree_node*, tree_node*, vec**, tree_node*, int, int) ???:0 0xb7d468 build_aggr_init(tree_node*, tree_node*, int, int) ???:0 0xb4c768 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int) ???:0 0xc80395 instantiate_decl(tree_node*, bool, bool) ???:0 0xcab7fb instantiate_pending_templates(int) ???:0 0xb5f735 c_parse_final_cleanups() ???:0 0xd8f918 c_common_parse_file() ???:0 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See for instructions. Compiler returned: 1 I tried to reduce it with creduce but creduce itself crashed :/=