public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: John Carter <john.carter@tait.co.nz>
To: Charles <qe@dabney.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: Extremely long compile times
Date: Sun, 20 Oct 2002 13:13:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.44.0210210907590.21282-100000@parore> (raw)
In-Reply-To: <200210181219.g9ICJ9Y01412@gatekeeper.tait.co.nz>

On Fri, 18 Oct 2002, Charles wrote:

> I've tried this with both gcc 3.1.1 and gcc 3.2.  This particular program
> takes over 2 hours to compile.  

Generally it helps to use the -pipe option. This stop it from using 
temporary disk files and just pipes it from preprocessor to compiler to 
assembler.

Optimization these days seems to be very cunning and take a _lot_ of time. 
During development add the -O0 flag. Compiles a lot faster and easier to 
debug.

Experiment with the -f optimization flags. Perhaps there is just one 
optimization that is really chewing up the time.

> According to -time, 100% of the time is
> spent in "cfg cleanup".  The program is generated by a language converter
> we are working on and contains only a "main" function with a very large
> number of local variables and initializing of arrays one element at a time.

It could be that gcc is doing a linear search somewhere under the 
expectation that there aren't a huge number of local variables. Can you 
try break it up into smaller compilation units?

> Does anyone know what could be causing this and/or what we could look for
> to correct it?

Try pull the sources for gcc out and compile them with profiling on (-pg) 
and then see if there are any hot spots.

-- 


John Carter                             Phone : (64)(3) 358 6639
Tait Electronics                        Fax   : (64)(3) 359 4632
PO Box 1645 Christchurch                Email : john.carter@tait.co.nz
New Zealand

Good Ideas:
Ruby                 - http://www.ruby-lang-org - The best of perl,python,scheme without the pain.
Valgrind             - http://developer.kde.org/~sewardj/ - memory debugger for x86-GNU/Linux
Free your books      - http://www.bookcrossing.com

       reply	other threads:[~2002-10-20 20:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200210181219.g9ICJ9Y01412@gatekeeper.tait.co.nz>
2002-10-20 13:13 ` John Carter [this message]
2002-10-21 13:40   ` Re[2]: " Charles
2002-10-21 13:40   ` Charles
2002-10-18  5:18 Charles
  -- strict thread matches above, loose matches on Subject: below --
2002-10-18  5:18 Charles

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=Pine.LNX.4.44.0210210907590.21282-100000@parore \
    --to=john.carter@tait.co.nz \
    --cc=gcc-help@gcc.gnu.org \
    --cc=qe@dabney.com \
    /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: link
Be 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).