public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/65591] New: G++ should use default constructor for {}-init when possible
@ 2015-03-26 20:38 jason at gcc dot gnu.org
  2015-03-27  9:28 ` [Bug c++/65591] " rguenth at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2015-03-26 20:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65591

            Bug ID: 65591
           Summary: G++ should use default constructor for {}-init when
                    possible
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jason at gcc dot gnu.org
                CC: daniel.kruegler at googlemail dot com, jakub at gcc dot gnu.org,
                    jason at gcc dot gnu.org, maltsevm at gmail dot com,
                    mpolacek at gcc dot gnu.org, pinskia at gcc dot gnu.org
        Depends on: 65154

>From Mikhail Maltsev's comment 5 on Bug #65154:

But it reveals some latent bug (PR65503). In the following case (after applying
the patch):

struct ss {
    ss() {};
};
struct C {
      ss s[1000];
};
int main() {
      C cs[5]{};
}

We'll get 1000 calls to ss() in main instead of calling default c-tor of struct
C. (which is probably not what we want).

-----

I agree that we want to call the default constructor in this case, and let the
inliner decide from there.  This is not the same issue as bug 65503.


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

end of thread, other threads:[~2022-01-07  5:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-26 20:38 [Bug c++/65591] New: G++ should use default constructor for {}-init when possible jason at gcc dot gnu.org
2015-03-27  9:28 ` [Bug c++/65591] " rguenth at gcc dot gnu.org
2015-03-27 15:47 ` jason at gcc dot gnu.org
2021-07-23  1:31 ` pinskia at gcc dot gnu.org
2022-01-07  0:48 ` pinskia at gcc dot gnu.org
2022-01-07  0:55 ` pinskia at gcc dot gnu.org
2022-01-07  2:56 ` jason at gcc dot gnu.org
2022-01-07  5:23 ` cvs-commit 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).