tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] what are tcc's limitations?


From: Dave Dodge
Subject: Re: [Tinycc-devel] what are tcc's limitations?
Date: Fri, 13 Oct 2006 14:10:23 -0400
User-agent: Mutt/1.5.12-2006-07-14

On Sun, Oct 15, 2006 at 02:02:57AM +0800, bj wrote:
> i didn't understand what you meant by these statements:
> 
> > Nobody wants to use GCC with -O0 instead of -O2, but this is what you get
> > from TinyCC
> >
> > When GCC is a good human translator, TinyCC is babelfish.altavista.com

gcc with -O2 performs lots of optimizations before it produces the
object code.  Statements can be reordered, functions may be
automatically inlined or converted to jumps, loops may be unwound,
dead code may be removed, etc.  Pretty much anything is allowed so
long as the program still produces the same output and side effects.
If you try to use a debugger on a highly-optimized program from gcc,
you may find for example that your local variables no longer exist.

tinycc is more like babelfish or gcc -O0 in that it does a nearly
word-for-word translation of C code to object code.  Each C construct
is converted directly to object code as it's encountered.  It's doing
a literal translation as opposed to gcc -O2's subjective or
paraphrased translation.

                                                  -Dave Dodge




reply via email to

[Prev in Thread] Current Thread [Next in Thread]