public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/55081] [4.8 regression?] Non-optimized static array elements initialization Date: Fri, 26 Oct 2012 14:49:00 -0000 [thread overview] Message-ID: <bug-55081-4-EXEm8eL8Hf@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-55081-4@http.gcc.gnu.org/bugzilla/> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55081 Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org, | |jason at gcc dot gnu.org Target Milestone|--- |4.8.0 --- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-10-26 14:49:20 UTC --- Works fine with -std=c++11. In store_init we have: /* In C++0x constant expression is a semantic, not syntactic, property. In C++98, make sure that what we thought was a constant expression at template definition time is still constant. */ if ((cxx_dialect >= cxx0x || DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (decl)) && (decl_maybe_constant_var_p (decl) || TREE_STATIC (decl))) but here DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (decl) isn't set and cxx_dialect < cxx0x for -std=c++98. Not sure what we should do here, either just call maybe_constant_value or maybe_constant_init otherwise to fold sizeof, or, if it is really not appropriate for C++98 as an optimization, fold_sizeof_expr_r recursively plus fold. Jason, what do you think?
next prev parent reply other threads:[~2012-10-26 14:49 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-10-26 13:14 [Bug c++/55081] New: " zhroma at ispras dot ru 2012-10-26 14:49 ` jakub at gcc dot gnu.org [this message] 2012-10-26 15:17 ` [Bug c++/55081] " amonakov at gcc dot gnu.org 2012-10-26 15:34 ` jason at gcc dot gnu.org 2012-10-26 15:59 ` jakub at gcc dot gnu.org 2012-10-26 20:30 ` jakub at gcc dot gnu.org 2012-10-26 20:32 ` [Bug c++/55081] [4.8 Regression] " jakub 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-55081-4-EXEm8eL8Hf@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).