- To: vikram_sp <vikramforum@xxxxxxxxx>
- Subject: Re: Complexity of gcc compiler
- From: Ian Lance Taylor <iant@xxxxxxxxxx>
- Date: Wed, 16 May 2012 06:52:58 -0700
- Cc: gcc-help@xxxxxxxxxxx
- Comment: DKIM? See http://www.dkim.org
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
- In-reply-to: <33857388.post@talk.nabble.com> (vikram sp's message of "Wed, 16 May 2012 04:28:47 -0700 (PDT)")
- User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)
vikram_sp <vikramforum@xxxxxxxxx> writes:
> I am wondering what may be the COMPLEXITY of GCC compiler in big Oh
> notation or other notation.
> I have some intuition that lexical analyzer's complexity is O(n) and that of
> parser is O(n^3). Optimization is NPC. Code generator might have some
> log(n) factor.
> Taking these things in accounts what is the time complexity of compilers
> in general and GCC in particular.
> Likewise space complexity may also be given thought?
Most of the compiler is linear in the size of the input. Some specific
optimization passes have a larger complexity. Some optimization passes
are linear in the number of basic blocks or in the number of
pseudo-registers. Register allocation is O(n^2) in the number of
pseudo-registers.
Ian
[Linux C Programming]
[Linux Kernel]
[eCos]
[Fedora Development]
[Fedora Announce]
[Autoconf]
[The DWARVES Debugging Tools]
[Yosemite Campsites]
[Yosemite News]
[Linux GCC]