public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "avi at argo dot co dot il" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/23477] New: default-initializing array new expression uses memcpy() instead of memset(), bloats executable
Date: Fri, 19 Aug 2005 09:21:00 -0000	[thread overview]
Message-ID: <20050819092003.23477.avi@argo.co.il> (raw)

the program 
 
    int main() 
    { 
        new int[10000000](); 
    } 
 
generates a 40MB executable. it compiles into a memcpy() of 40MB of zeros into 
the newly-allocated array. 
 
tested at -O0 and -O3. 
 
gcc version 4.0.1 20050727 (Red Hat 4.0.1-5)

-- 
           Summary: default-initializing array new expression uses memcpy()
                    instead of memset(), bloats executable
           Product: gcc
           Version: 4.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: avi at argo dot co dot il
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i386-redhat-linux
  GCC host triplet: i386-redhat-linux
GCC target triplet: i386-redhat-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23477


             reply	other threads:[~2005-08-19  9:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-19  9:21 avi at argo dot co dot il [this message]
2005-08-19 11:35 ` [Bug middle-end/23477] [4.1 Regression] default-initializing array new expression uses makes stack usage go way up pinskia at gcc dot gnu dot org
2005-08-30 10:44 ` pinskia at gcc dot gnu dot org
2005-08-30 11:53 ` rguenth at gcc dot gnu dot org
2005-08-30 13:31 ` rguenth at gcc dot gnu dot org
2005-08-31 11:22 ` cvs-commit at gcc dot gnu dot org
2005-08-31 11:43 ` rguenth at gcc dot gnu dot 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=20050819092003.23477.avi@argo.co.il \
    --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: link
Be 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).