I'm currently using TCC in my regular list of compilers. I like it much, due to its simplicity, and checking code portability with it is a breeze, since it is fast.
At the beginning it seemed to work fine. Small programs were indeed way smaller.
However, as soon as I started to complexify the source code, it became less a real property. With reasonably complex source files, TCC generates larger binaries than GCC or VS.
My current guess is that TCC is lacking many optimizations techniques, which is also the primary reason for its speed. Among the list of lacking optimization may figure :
- no dead code elimination
- no unused function code elimination
The second one might be the most harmful : in one instance, I compiled a library from which I was using a single function, although it defined a dozen ones. The resulting binary became fairly large.
So now for the questions :
- Is the analysis proposed above correct ? Or need to be elaborated ?
- Is it even an objective for TCC to generate small-size exe ?