public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "david at doublewise dot net" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/53650] New: large array causes huge memory use Date: Tue, 12 Jun 2012 23:38:00 -0000 [thread overview] Message-ID: <bug-53650-4@http.gcc.gnu.org/bugzilla/> (raw) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53650 Bug #: 53650 Summary: large array causes huge memory use Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: major Priority: P3 Component: c++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: david@doublewise.net This problem did not exist in 4.6.x. The following program uses > 4 GiB of memory (more than my system has) during compilation. If I reduce the size of the array a bit, it still uses several GiB but does eventually compile (so the problem is not infinite recursion) and takes a very long time to compile. Compiling with optimizations on seems to eliminate the large memory usage but takes longer than I was willing to wait to compile. class Class { public: Class() {} }; int main() { Class table [2048][256] = {}; return 0; } Using something like int causes no problems and compiles quickly. This may also relate to a C++11 missed optimization opportunity, because this may suggest that the fact that Class has a constructor is making it non-POD, but the POD rules were relaxed in C++11 to make Class a POD structure (I think). Compiling with std=c++11 doesn't fix the problem, however. gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.7.0/lto-wrapper Target: x86_64-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --disable-build-with-cxx --disable-build-poststage1-with-cxx --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux Thread model: posix gcc version 4.7.0 20120507 (Red Hat 4.7.0-5) (GCC)
next reply other threads:[~2012-06-12 23:38 UTC|newest] Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-06-12 23:38 david at doublewise dot net [this message] 2012-06-13 4:59 ` [Bug c++/53650] " hjl.tools at gmail dot com 2012-06-13 18:45 ` [Bug c++/53650] [4.7/4.8 Regression] " david at doublewise dot net 2012-06-14 6:19 ` jason at gcc dot gnu.org 2012-06-14 8:38 ` rguenth at gcc dot gnu.org 2012-06-17 19:55 ` david at doublewise dot net 2012-06-25 15:59 ` jason at gcc dot gnu.org 2012-09-06 14:48 ` rguenth at gcc dot gnu.org 2012-09-20 10:18 ` jakub at gcc dot gnu.org 2013-01-03 16:52 ` jason at gcc dot gnu.org 2013-01-03 16:54 ` [Bug c++/53650] [4.7 " jason at gcc dot gnu.org 2013-01-22 16:29 ` jason at gcc dot gnu.org 2013-01-22 16:34 ` jason at gcc dot gnu.org 2013-01-22 21:07 ` pluto at agmk dot net 2013-01-23 2:48 ` jason 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-53650-4@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).