tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] modern c++ compiler written in C (food for thought)


From: Christian Jullien
Subject: Re: [Tinycc-devel] modern c++ compiler written in C (food for thought)
Date: Wed, 28 Oct 2015 07:19:25 +0100

Woah! Basile, we said about the same things at the same time.

I of course fully agree with your post :o)

Christian

-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of
Basile Starynkevitch
Sent: mercredi 28 octobre 2015 07:12
To: address@hidden
Subject: Re: [Tinycc-devel] modern c++ compiler written in C (food for
thought)

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
address@hidden
https://lists.nongnu.org/mailman/listinfo/tinycc-devel




reply via email to

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