Thread: What do you think about tcc compiler?

  1. #1
    Registered User BlackOps's Avatar
    Join Date
    Jul 2009
    Location
    AZERBAIJAN
    Posts
    78

    What do you think about tcc compiler?

    Have anyone worked with it and felt that it is really much faster than gcc?

  2. #2
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Location
    Cambridge, UK
    Posts
    1,732
    DON'T USE TCC. Use gcc. Tcc is 16 bit compiler and its a very old compiler and you wouldn't get much of a help. Time to switch over son!

    ~ssharish
    Life is like riding a bicycle. To keep your balance you must keep moving - Einstein

  3. #3
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by ssharish2005 View Post
    DON'T USE TCC. Use gcc. Tcc is 16 bit compiler and its a very old compiler and you wouldn't get much of a help. Time to switch over son!

    ~ssharish
    Not sure what you're talking about, but the Tiny C Compiler is not a 16-bit compiler, in fact, it can target x64
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  4. #4
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Location
    Cambridge, UK
    Posts
    1,732
    Ohh well, I was referring to Turbo C compiler (Tcc).

    ~ssharish
    Life is like riding a bicycle. To keep your balance you must keep moving - Einstein

  5. #5
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by BlackOps View Post
    Have anyone worked with it and felt that it is really much faster than gcc?
    Hmmm...here's a thing: GCC gets slower with each level of optimization (-O2 -O3), implying to me that a faster compiler will produce executables which are slower, since code compiled with -O3 can be like 5-10 times faster than code with no optimization on, but gcc takes longer to produce it.

    I guess you could test that simply enough. But it looks to me like the point is to make a "tiny" compiler for use in specialized settings, not one that is supposed to be a replacement on your normal desktop, etc. They don't make any claims vis, how small or fast the executables produced are, so I would presume there is nothing to brag about there.

    Doing a linux kernel in 10 seconds ("on a 2.4 GHz Pentium 4") is pretty crazy tho. I have a dual* 2.2 P4 and it takes like 10 or 15 minutes...

    *altho gcc only uses one.
    Last edited by MK27; 07-22-2009 at 05:00 PM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  6. #6
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    The tiny C compiler sounds nice, but I would be wary of using a compiler that hasn't hit version 1.0 yet.

  7. #7
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Location
    Cambridge, UK
    Posts
    1,732
    I guess its more often used in the SBC where the memory and the processing power are limited. Compiling the auto generated code on the board on runtime. I guess it only applies there. At least what I can think of at the movement.

    ~ssharish
    Life is like riding a bicycle. To keep your balance you must keep moving - Einstein

  8. #8
    Registered User Cooloorful's Avatar
    Join Date
    Feb 2009
    Posts
    59
    Quote Originally Posted by MK27 View Post
    Hmmm...here's a thing: GCC gets slower with each level of optimization (-O2 -O3), implying to me that a faster compiler will produce executables which are slower, since code compiled with -O3 can be like 5-10 times faster than code with no optimization on, but gcc takes longer to produce it.

    I guess you could test that simply enough. But it looks to me like the point is to make a "tiny" compiler for use in specialized settings, not one that is supposed to be a replacement on your normal desktop, etc. They don't make any claims vis, how small or fast the executables produced are, so I would presume there is nothing to brag about there.

    Doing a linux kernel in 10 seconds ("on a 2.4 GHz Pentium 4") is pretty crazy tho. I have a dual* 2.2 P4 and it takes like 10 or 15 minutes...

    *altho gcc only uses one.
    Sage advice indeed, though to pitch in a few more words of wisdom, if you are frequently compiling your code during development in order to do incremental bug testing or if you are new to programming and find you just second guess yourself and like to compile frequently to isolate your possible mistakes its beneficial to have one "fast" compiler.

    You need not always develop and release programs using the same compiler. I commonly use a different compiler to compile "release" builds of my work. I do not know enough about tcc to say whether or not it should be your "fast" compiler of choice, however. So why not test it out and post how well it works for you?

  9. #9
    C++11 User Tux0r's Avatar
    Join Date
    Nov 2008
    Location
    Sweden
    Posts
    135
    TCC produces small executables and compile time fast but what I don't like is I can't SCOPE A VAR in a for loop due to C89 So I don't use it anyway...

  10. #10
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by brewbuck
    Not sure what you're talking about, but the Tiny C Compiler is not a 16-bit compiler, in fact, it can target x64
    Quote Originally Posted by ssharish2005
    Ohh well, I was referring to Turbo C compiler (Tcc).
    Funny abbreviations, heh. I shall now announce that tcc is not a compiler, so we cannot compare its speed with that of gcc.

    Anyway, BlackOps, now you know the danger of blind use of abbreviations
    You probably also should state the versions of the respective compilers that you used/are using/intend to use if you want more specific feedback.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  11. #11
    Registered User
    Join Date
    Jul 2009
    Posts
    40
    What I don't like in C programming is having different types of compiler around and you must have enough knowledge to know which is good or not.

  12. #12
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by WatchTower
    What I don't like in C programming is having different types of compiler around and you must have enough knowledge to know which is good or not.
    Standardisation is supposed to help in that. Would you prefer having only one bad compiler, or having no compiler at all? (Consider a scenario where there is only one compiler, but it is of poor quality because the vendor is too lazy to improve it and yet is protected by some legally enforced monopoly, and/or refuses to provide the compiler for the platform that you wish to compile on because it is not in the vendor's business interest to do so.)
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  13. #13
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    >> What I don't like in C programming is having different types of compiler around and you must have enough knowledge to know which is good or not.

    At least the choices are a lot better nowdays. Back when I started programming the number of good, free compilers was a *really* short list.
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  14. #14
    Registered User
    Join Date
    Jul 2009
    Posts
    40
    At least I now understand why there are lots of compilers. So if the compiler follows the standardization of C then I guess that would be the compiler of your choice?

  15. #15
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by WatchTower View Post
    At least I now understand why there are lots of compilers. So if the compiler follows the standardization of C then I guess that would be the compiler of your choice?
    I imagine any contemporary (eg, with a version released in the past five years) C compiler in widespread use will adhere to the standard and should be fine to use.

    People will argue about which one is better, but they all work properly and you don't need to worry about it that much.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. added start menu crashes game
    By avgprogamerjoe in forum Game Programming
    Replies: 6
    Last Post: 08-29-2007, 01:30 PM
  2. Compiler Paths...
    By Cobra in forum C++ Programming
    Replies: 5
    Last Post: 09-26-2006, 04:04 AM
  3. C Compiler and stuff
    By pal1ndr0me in forum C Programming
    Replies: 10
    Last Post: 07-21-2006, 11:07 AM
  4. I can't get this new compiler to work.
    By Loduwijk in forum C++ Programming
    Replies: 7
    Last Post: 03-29-2006, 06:42 AM
  5. how to call a compiler?
    By castlelight in forum C Programming
    Replies: 3
    Last Post: 11-22-2005, 11:28 AM