This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Compiler uses a lot of memory for large initialized arrays


Ian Lance Taylor <ian@wasabisystems.com> wrote:

> A customer just handed me a test case in which the compiler uses way
> too much memory when compiling a large array initialization.  This
> turns out to be PR 12245, which previously didn't have a test case
> attached to it.


Check also PR 14179, which is the same issue for C++. The testcase has 4
millions of initializers. We have almost fixed that testcase (that is: we do
much better than a few months ago), and I have been meaning to post the
final patch (to process_init_constructor) for a long time now. With that
patch on, we can compile the testcase with about 220Mb of RAM.

There are other optimizations that can be done here and there. For instance,
the CONSTRUCTOR_ELTS could be using Nathan's Vec where fesable, instead of
TREE_LISTs.
-- 
Giovanni Bajo


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]