public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "jason at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/59659] large zero-initialized std::array compile time excessive Date: Fri, 10 Jan 2014 17:16:00 -0000 [thread overview] Message-ID: <bug-59659-4-UShnN56MkX@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-59659-4@http.gcc.gnu.org/bugzilla/> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59659 Jason Merrill <jason at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |jason at gcc dot gnu.org --- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #6) > For the #c0 testcase, I think reduced testcase is: > struct S { S (); S (int); ~S (); int i; }; > struct A { S s[1000000]; }; That's a more general case of the problem, but atomic has constant zero-initialization, which ought to simplify things. This patch causes the initialization to properly (and more quickly) become a memset: diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index d9c3647..04f0bf7 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -1182,6 +1182,7 @@ process_init_constructor_array (tree type, tree init, initialization explicit by list-initializing from {}. */ next = build_constructor (init_list_type_node, NULL); next = digest_init (TREE_TYPE (type), next, complain); + next = maybe_constant_init (next); } else if (!zero_init_p (TREE_TYPE (type))) next = build_zero_init (TREE_TYPE (type), I'll poke at this some more.
next prev parent reply other threads:[~2014-01-10 17:16 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-01-02 15:25 [Bug c++/59659] New: large zero-initialized std::array of std::atomic " devaneymark at gmail dot com 2014-01-02 16:04 ` [Bug c++/59659] " Casey at Carter dot net 2014-01-07 11:48 ` [Bug c++/59659] large zero-initialized std::array " rguenth at gcc dot gnu.org 2014-01-09 16:18 ` jakub at gcc dot gnu.org 2014-01-09 16:25 ` jakub at gcc dot gnu.org 2014-01-09 16:59 ` trippels at gcc dot gnu.org 2014-01-09 17:03 ` jakub at gcc dot gnu.org 2014-01-09 17:24 ` trippels at gcc dot gnu.org 2014-01-10 17:16 ` jason at gcc dot gnu.org [this message] 2014-01-24 16:48 ` jason at gcc dot gnu.org 2014-01-24 17:09 ` jason at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-59659-4-UShnN56MkX@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).