On 10/28/2015 05:14 AM, Sergey Korshunoff wrote:
Hi Basile
A C++ compiler needs to be optimizing. The C++ language specification sort-of
requires an > > optimizing compiler
Did you say that a usual C compiler (gcc, clang) can not optimize as a C++ does?
A tcc compiler is a compiler for a development speedup. A final stage
can be build by the usual compiler.
No, I was just saying the obvious point that practically speaking the
C++11 standard is expecting any compiler implementing that standard to
optimize significantly. A C++ compiler should inline lots of functions
(including most member functions declared inside a class) and do a lot
of optimizations (in particular constant folding, some loop unrolling or
if (true) optimizations, dead code elimination, etc...). I giuess that
some template expansion cannot happen without optimizations.
Hence a trivial compiler like TinyC (which don't do any serious
optimization at all, this is why it compiles so fast) won't make sense
in C++; you cannot code a TinyC++ compiler (which would not have serious
optimization passes)!
I do know that both GCC & Clang are optimizing a common internal
representation (e.g. Gimple in GCC) which is the same (or at least
mostly overlapping) for C or C++ source code.
Notice that GCC even with -O0 is doing *some* optimizations.
Cheers.
--
Basile STARYNKEVITCH http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mine, sont seulement les miennes} ***
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel