Slashdot Mirror


GCC 3.0 Released

Phil Edwards, GCC Developer wrote in to say: "The first major release of the GNU Compiler Collection in nine years, GCC 3.0, is finished. There is a long list of new features, including a new x86 back-end, a new C++ library, and a new C++ ABI, to pick my three favorites. Note that the GCC project does not distribute binary packages, only source. And right now the server is heavily loaded, so if you intend to get the source tarball, please /. one of the many ftp mirror sites instead. Plans for 2.95.4 (bugfix release), 3.0.1 (bugfix release), and 3.1 (more user-visible features) are all in progress." MartinG points to this mailing list message announcing the upload.

23 of 210 comments (clear)

  1. Re:Why does GCC require so much memory? by David+Greene · · Score: 5
    For one thing, the MS compiler & linker don't support automatic template instantiation. You may not have noticed this because the IDE does the bookeeping for you and generates the template declarations needed by the compiler.

    This is not a bad thing. In fact, it is a very valid (I'd say good!) design decision. Explanation below.

    For some reason, most compilers are faster when you turn of automatic instantiation and explicitly list the template instances you need.

    The reason explicit instantiation is so much faster is that the compiler doesn't have to compile your code twice. Automatic template instantiation requires some sort of support outside the compiler proper. For all the gory details, I recommend Stan Lippman's Inside the C++ Object Model. It's a little out of date and inaccurate (or more properly, misleading) at times, but for anyone interested in why C++ works the way it does and what sort of decisions the compiler makes when generating code, it's a great book. It dispels many of the common myths about C++'s performance and makes an honest evaluation of the cases where performance is negatively affected.

    But I digress. One of the most popular strategies for automatic template instantiation involves some sort of "collector" program. The basic idea is to collect all the object files that go into the final link and look for undefined symbols that refer to template code. The GNU collect2 program does this for g++. Once the symbols have been identified, the compiler needs some way of knowing how to recompile the source files that contain the template elements. Strategies include using control files generated by the compiler and collector, entries in the object files themselves (strings or symbols are common) or a combination of the two. Other strategies are possible as well. The driver script (the IDE in VC++) gathers this information and reinvokes the compiler to recompile the source files containing the needed template code, passing flags to tell the compiler to instantiate particular templates.

    After having implemented some of this, I have to tell you that it is all a tremendous pain in the neck. It's also quite, quite convenient and necessary for the user. :)

    As for the MS IDE, that's just another strategy for handling the problem. No compiler that I know of fully handles automatic template instantiation by itself. The closest that a compiler could come to this would be to aggregate the collector actions into the compiler as a separate phase. This is really no different that running a separate program and the "compiler" becomes the driver script (think g++), with the compiler proper (i.e. translation and transformation) being but one (usually, more than one) phase of compilation.

    Every C++ compiler I've used on UNIX systems is painfully slow at optimizing template code.

    Is this not true under Windows? I'm curious, as they should have many of the same problems. Optimizing template code is expensive because there is a lot of it and most of it is inlined. Inlining is not as trivial one might initially expect and it has large implications for transformation (optimization). Inlining usually greatly expands the size and scope of functions that are transformed. There are more nodes, more symbols and more analysis bookkeeping to handle. Many compiler algorithms have complexity of N^2 or worse (lots are NP-complete!) so things get dicey as code size expands. Strangely enough, this is also why transformation can speed up compilation -- it often removes nodes and symbols from the program!

    --

    --

  2. partially correct (HP-UX) -you need a K&R compiler by emil · · Score: 4

    AFAIK, gcc requires a *K&R* C compiler, as documented in the first edition of The C Programming Language. It need not support function prototypes or the void type (I think).

    On UNIX systems that do not natively support and include gcc, one uses the system's C compiler to generate xgcc, which is GNU C (but not compiled by GNU C). One then uses xgcc to generate a GNU-compiled gcc. I don't know why xgcc is not normally installed and used, but I assume that it would be an ease-of-debugging issue (and you can also debug gcc-optimized code, which most vendor compilers will not do).

    HP-UX natively includes a K&R (non-ANSI) C compiler. It is almost useless, but it will successfully compile gcc. On most other commercial UNIX systems, if you lack a compiler, you must rely upon someone who has a compiler to generate a verstion of gcc for you (which accounts for the popularity of packaged gcc versions on many platforms). This can also be complicated by licensing of the system include files and libraries.

  3. Re:How about PGCC and EGCS.. by Per+Abrahamsen · · Score: 4

    GCC is basically a new name for EGCS.

    I don't know about PGCC, but since GCC 3.0 has a brand new ia32 backend with focus on Pentium II performance, chances are that PGCC is no longer relevant.

  4. But don't forget by Ian+Schmidt · · Score: 5

    The very reason GCC 3.0 is out now rather than in 2005 is precisely because RH "jumped the gun" and submitted hundreds of bugfix patches to GCC 3.0 in the process. Meanwhile Redhat's GCC 2.96-81 is less buggy in my experience than 2.95.2 and the new features are great.

  5. Re:Umm... by Tim+C · · Score: 4

    I'd say they're just being realistic. No matter how good your QA process, the chances of catching and squashing every single bug before release are minimal. The best you can realistically hope to do is catch all the real show stoppers. (Assuming that you actually do want to release the product at some point, that is)

    Having said that, this is the first time (that I can remember) that I've seen an officially-planned x.0.1 bugfix release announced at the same time :)

    Cheers,

    Tim

  6. Re:how much stuff with this break? by Raphael · · Score: 4
    [...] the big question is "how much stuff is this going to break?

    Not much, hopefully.

    The only major thing that can affect the binary packages is the new C++ ABI. But for plain C programs, there should be no big difference. Most of the Linux programs and libraries are written in C and should not be affected significantly. This could be a problem for Qt and KDE packages, though.

    See also the list of caveats on the GCC web site.

    --
    -Raphaël
  7. Re:GJC! GJC! - GCJ! GCJ! by Per+Bothner · · Score: 4
    Er, it's GCJ (GNU Compiler for the Java [TM] programming language), not GJC. (You're not supposed to call it plain "GNU Compiler for Java" because of Sun's trademark on "Java".)

    We did consider the name GJC (back in '96 when the project was started), but for some reason I don't remember (I think it was trademark-related) we decided on GCJ.

    I'm very glad to see GCJ in a mainstream GCC release, and hope it will finally get the attention I think it deserves.

  8. Re:Red Hat's problem... by ajs · · Score: 4

    Of course, they will do what they've always done (and every other commercial vendor with large customers does). They will distribute "obsolete" software until their next version, when they will go with the almost-latest-and-greatest that they can get to work.

    You have to understand, Red Hat bowed to their customers. Many of their C++ customers told them they needed ANSI C++ compliance badly. GCC 2.96 offered that.

    Red Hat has a history of working hard on the compiler, and distributing a custom version. They were the first distribution to ship egcs (remember, 6.2 ran egcs for the C++ compiler). They also did a lot of work on making egcs work for the Linux kernel.

    --
    Aaron Sherman (ajs@ajs.com)

  9. Press release available by bkuhn · · Score: 4

    For those of you who prefer a non-hacker announcement of the release, a press release is available.

  10. so by British · · Score: 4

    So how did they compile the first version of the GCC compiler? Seeing is that there was no prior GCC compiler first?

    1. Re:so by langed · · Score: 5
      Of course, they did the same thing that is done in the first stages of building gcc as a cross-compiler: build a compiler that compiles the compiler you'll eventually use. This early-stage compiler need not support all of C, only the parts that the compiler uses.
      if you look in this Makefile, you'll see that in stages one and two it builds a program called xgcc, which it later deletes, but not before it compiles your cross-compiler.

      the nice thing about doing this is that the compiler that is finally built when the entire compilation process is complete doesn't have to necessarily be "real C" in the source code. It could be a nice intermingling of any number of languages. It isn't, but it does give them that freedom.

      So to review:
      gcc (installed) -> xgcc -> new gcc compiler

    2. Re:so by TeknoHog · · Score: 5
      The first GCC compiled itself. There is nothing contradictory here since, according to Novikov (see his book The River of Time) the present can be affected by future events.

      This process is somewhat similar to the beginning of the universe, which according to Perl zealots started when tiny bits of eval() statements arose from quantum fluctuations. These immediately produced more and more eval()s, resulting in a big bang of code. Eventually, other functions appeared, forming the Universe as we know today.

      There is also a controversial theory which asserts that the first GCC was written with assembler, and that the first assembler was written in binary code by Real Men (TM), but the evidence for this is questionable.

      --

      --
      Escher was the first MC and Giger invented the HR department.
  11. Red Hat's problem... by Velox_SwiftFox · · Score: 4
    So... since Red Hat jumped the gun and grabbed development releases using libs that apparently gcc will no longer be compatable with - and according to what they've said is their policy that they won't change to incompatable libs in mid-major-version - I wonder if this means RH 8.0 will come out simultaneously with 7.2, or if they are going to just skip now to 8.0?

    Or if Red Hat users will now be forced to continue to use what has become obsolete software?

    1. Re:Red Hat's problem... by Erasmus+Darwin · · Score: 5
      Or if Red Hat users will now be forced to continue to use what has become obsolete software?

      The existence of a new version of software does not (unless you're dealing with the ugly, ugly world of MS Office documents and their lack of backwards compatibility) automatically break older versions. You will not go bald, get cancer, or get attacked by a pack of rabid dogs just because you're using an older version of gcc. You will not see:

      [erasmus@localhost ~]$ gcc -o test test.c -Wall
      gcc: Version 3.0 has been released. You must upgrade. Sorry.

      Furthermore, from the Slashdot blurb (right at the top of the page -- you don't even have to click a link), we've got the following:

      Plans for 2.95.4 (bugfix release), 3.0.1 (bugfix release), and 3.1 (more user-visible features) are all in progress.

      In short, the 2.9x line (which Redhat admittedly bastardized a bit by grabbing a snapshot and calling it 2.96) will still be fixed for bugs.

      Also, for a production system, new, untested code is considered unacceptable. There are bugs in the 3.0 version of gcc, period. Over time, they will get fixed. But just like running an experimental kernel (or even the very first new stable release of a previously experimental kernel) is a great way to shoot yourself in the foot, you don't want to jump to gcc 3.0 unless you've got a reason to use it. And people who have a reason will generally be able to locate and install a copy of gcc 3.0, anyway. Hell, give it a few weeks and they should be able to locate and install an RPMed copy of gcc 3.0. And I'm sure there are people out there who will need gcc 3.0 -- it just won't be the core Redhat demographic, yet.

      In short, did the people at work bitch at me for running RedHat 6.2 on our production machines at work? No. Would they have bitched if I had upgraded to 7.0 when it came out, broken things in the process, and used the excuse that they just need to wait a year for RedHat 7.2? Hell, yes. Even Slashdot does something similar -- there's plenty of lag between the latest version of Slashcode and what's running on Slashdot.

  12. Here's the funny thing... by bconway · · Score: 5

    Guess what? Everyone that complained about GCC 2.96 being broken (and not reading http://www.bero.org/gcc296.html) despite the fact that their code wasn't C99 complient STILL WON'T COMPILE. Now you can't complain that your code won't work because it's a developmental compiler, you'll actually have to fix it. Numerous examples of this are listed at the above URL, I'd highly suggest you try it out. I have a feeling quite a few people are gonna be red in the face over this one. ;-)

    --
    Interested in open source engine management for your Subaru?
  13. Re:partially correct (HP-UX) -you need a K&R compi by akihabara · · Score: 4

    AFAIK, gcc requires a *K&R* C compiler, as documented in the first edition of The C Programming Language. It need not support function prototypes or the void type (I think).

    No, it does not require such a compiler; it is required to be bootstrappable with such a compiler.

    And K&R did have void. They didn't have pointer to void.

    On UNIX systems that do not natively support and include gcc, one uses the system's C compiler to generate xgcc, which is GNU C (but not compiled by GNU C).

    Not really. xgcc is the name of the result of the stage1 and stage2 bootstraps; the stage2 one is created by the stage1 one (i.e. by GCC).

    I don't know why xgcc is not normally installed and used

    It effectively is, if you type "make install". The bootstrap process just ensures that the result of the stage3 bootstrap has identical object files as the result of the stage2 bootstrap, which formed xgcc. In other words,
    that optimized GCC compiles itself into the same optimized GCC - a consistency check. Those binaries are what get installed, so it is effectively the same GCC.

    but I assume that it would be an ease-of-debugging issue (and you can also debug gcc-optimized code, which most vendor compilers will not do).

    Nothing to do with it. Everything after stage1 is a consistency check.

  14. Re:Question by selectspec · · Score: 5
    --

    Someone you trust is one of us.

  15. The GCC developers should thank RedHat by kdgarris · · Score: 5

    The fact that RedHat used an earlier snapshot of this compiler allowed for extensive testing early in the development process, resulting in many bug-fixes being made to the snapshot as well as to the pre-3.0 GCC development code.

    I'm sure this release came about sooner with a lot less bugs due to Redhat's move to use the earlier snapshot in their distro.

    -Karl

  16. Re:In 100 Words Or Less Describe ABI by Karellen · · Score: 4

    ABI == Application Binary Interface.

    It's the format for putting things like function names in object files so that the linker, when fixing up function calls across object files, can match the call with the correct function.

    While this isn't a problem in C (just use the function's name for christ's sake), C++ allows overloaded functions; multiple functions with the same name but different parameter lists. For the linker to match the correct call to the correct function, the parameter list needs to be munged into the function name stored in an object file.

    The new way of doing it is generally less clunky and takes up less space in your object files than the old way. But is incompatible with it. :(

    (Note that this only matters where GCC is being used as a native compiler to compile files that only need to be linked with each other. If compiling for a platform where gcc is not the native compiler (e.g. using GCC on, say, solaris, alongside the default compiler) you need to use the ABI defined for that platform to allow your object files to be linked with all the other object files you have that were compiled with the native compiler.)

    Yeah, it's more than 100 words. Sue me :)

    --
    Why doesn't the gene pool have a life guard?
  17. Re:Question by RevAaron · · Score: 5

    What is Google?

    --

    Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
  18. Re:Umm... by istartedi · · Score: 4

    No matter how good your QA process, the chances of catching and squashing every single bug before release are minimal

    Unless you're Microsoft; then you're an incompetent, obnoxious, FUD-spouting dinosaur and every bug that escapes is an indictment of you, your business practices, design methodology, family heritage, preference for breakfast cereal, haircut and anything else associtated with you or anyone you have ever met, slept with, laid eyes upon, or casually passed on the street.

    --
    For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
  19. gcj now integrated by iloveAB · · Score: 4

    I use a lot of JAVA, and it looks like we will finally have a full JAVA front-end for gcc with dependency generation (for automatic makefiles).

  20. GJC! GJC! by dasmegabyte · · Score: 5

    GNU JAVA COMPILER!

    I can finally write in Java and not get made fun of by my elite C++ hax0r friends!

    In case you weren't aware, GCJ is the first Gnu toolset for Java, and it's not just a nasty rehash of Sun's stuff...it's JRE, JIT and NATIVE CODE COMPILER rolled into one. They have an odious refutation of the Write Once Run Anywhere creedo which I don't necessarily agree with (the guy must be writing some pretty fierce code if he's had problems like he mentions, I've done distributed Java with the Swing libraries for about a year and never had a problem that wasn't related to Netscape sucking). What I care about, though, is the speed ups. Finally, all my keen little utility programs I've written in clean, attractive Java code (to do stuff like rename files, play music and so on) will run as fast as OS level stuff. I intend on compiling the sweet ass netbeans ide as soon as they get AWT working. Maybe I'll finally be able to get it to run as fast on my shitty Celeron windows machine as it does on my MACOS lappy.

    GNU TOOLS FOR LINUX: BECAUSE LINUX USERS HAVE A RIGHT TO CLEAN, ATTRACTIVE, EFFICIENT OBJECT ORIENTED CODE, TOO.

    --
    Hey freaks: now you're ju