From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8912 invoked by alias); 18 Nov 2004 18:45:27 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 8864 invoked from network); 18 Nov 2004 18:45:18 -0000 Received: from unknown (HELO develer.com) (151.38.19.110) by sourceware.org with SMTP; 18 Nov 2004 18:45:18 -0000 Received: (qmail 13258 invoked from network); 18 Nov 2004 18:45:17 -0000 Received: from mimas.trilan (HELO mimas) (10.3.3.245) by ns.trilan with SMTP; 18 Nov 2004 18:45:17 -0000 Message-ID: <0e5401c4cd9e$bf2bc4a0$f503030a@mimas> From: "Giovanni Bajo" To: "naje" Cc: References: Subject: Re: compiler memory use optimization Date: Thu, 18 Nov 2004 19:33:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1251" Content-Transfer-Encoding: 7bit X-SW-Source: 2004-11/txt/msg00635.txt.bz2 naje wrote: > my program use C++ templates vary hard, so i've got much memory spent for > compilation, and sometimes i've got "virtual memory exhaust" error. > Is there any way to find out which part of my program is hard to > compile to optimize it, and is there any methods to optimize memory use in > gcc? And that kinds of optimizations of my code can i use to optimize > compilation? It's not easy to tell because they are mostly ineffeciencies spread across the whole compiler. Surely we can do nothing without a preprocessed source code to start with (and we can do nothing for 3.3 anyway -- see below). > I use gcc3.3 on freebsd 5.2. The good news is that 3.4 is much better at this on many testcases. (Un)luckily, it is also much more ISO/ANSI C++ standard compliant, so upgrading from 3.3 to 3.4 for a large C++ applications could be non-trivial. I suggest you to try it anyway. You can consult http://gcc.gnu.org/gcc-3.4/change.html, which contains the most common problems found when upgrading to 3.4, with examples. After you upgraded, get back to us and tell us how it behaves. Another good point in upgrading is that if the problem is still reproducible with 3.4, you can submit a bug report and we'll look into it. 3.3 is near to dead at this point, so major work to improve compile time or memory occupaiton is very unlikely on that branch. -- Giovanni Bajo