This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/77562] New: large amount of memory usage when allocating big arrays
- From: "programmerjake at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 11 Sep 2016 19:34:06 +0000
- Subject: [Bug c++/77562] New: large amount of memory usage when allocating big arrays
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77562
Bug ID: 77562
Summary: large amount of memory usage when allocating big
arrays
Product: gcc
Version: 6.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: programmerjake at gmail dot com
Target Milestone: ---
when using gcc 5+, compiling the following code uses a huge amount of memory
creating a read-only template object. On gcc 4.9 and before, it does the
expected thing, filling the array in a loop without a source object that it's
copying from.
code:
struct S
{
long a = 1;
};
template <typename T, unsigned long N>
struct A
{
T value[N];
};
void *fn()
{
return new A<A<A<S, 400>, 400>, 400>;
}