This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/23477] New: default-initializing array new expression uses memcpy() instead of memset(), bloats executable
- From: "avi at argo dot co dot il" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Aug 2005 09:20:06 -0000
- Subject: [Bug c++/23477] New: default-initializing array new expression uses memcpy() instead of memset(), bloats executable
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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