public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/61183] New: Large memory usage with smallish C++ templates (> 16GB)
@ 2014-05-13 20:43 giovannibajo at gmail dot com
  2014-05-13 20:44 ` [Bug c++/61183] " giovannibajo at gmail dot com
  0 siblings, 1 reply; 2+ messages in thread
From: giovannibajo at gmail dot com @ 2014-05-13 20:43 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61183
           Summary: Large memory usage with smallish C++ templates (>
                    16GB)
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: giovannibajo at gmail dot com

I'm unable to compile the attached code with GCC 4.9.0, at -O0 even without -g,
because of RAM exhaustion (16GB). LLVM 3.4svn is able to compile the program in
about 2 minutes with a peak at 2GB (even at -O3 -g).

The code is actually quite small, and relies to template + always_inline to
basically generate large functions with 99% of dead code (can be proven dead
with some constant propagation). Probably being more aggressive in some early
pass (after early inlining) should fix the compilation problem.

Original code here for further analysys:
https://raw.githubusercontent.com/rasky/cz80/master/z80.cpp


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

* [Bug c++/61183] Large memory usage with smallish C++ templates (> 16GB)
  2014-05-13 20:43 [Bug c++/61183] New: Large memory usage with smallish C++ templates (> 16GB) giovannibajo at gmail dot com
@ 2014-05-13 20:44 ` giovannibajo at gmail dot com
  0 siblings, 0 replies; 2+ messages in thread
From: giovannibajo at gmail dot com @ 2014-05-13 20:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Giovanni Bajo <giovannibajo at gmail dot com> ---
Created attachment 32794
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32794&action=edit
Preprocessed source


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

end of thread, other threads:[~2014-05-13 20:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-13 20:43 [Bug c++/61183] New: Large memory usage with smallish C++ templates (> 16GB) giovannibajo at gmail dot com
2014-05-13 20:44 ` [Bug c++/61183] " giovannibajo at gmail dot com

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).