Slashdot Mirror


GCC 3.2 Released

bkor forwards the GCC 3.2 release announcement, without attributing it as such: "The GCC 3.2 release is now available, or making its way to, the GNU FTP sites. The purpose of this release is to provide a stable platform for OS distributors to use building their next OS releases. A primary objective was to stabilize the C++ ABI; we believe that the interface to the compiler and the C++ standard library are now stable. There are almost no other bug-fixes or improvements in this compiler, relative to GCC 3.1.1. Be aware that C++ code compiled by GCC 3.2 will not interoperate with code compiled by GCC 3.1.1. More detail about the release is available. Many people contributed to this release -- too many to name here!"

13 of 311 comments (clear)

  1. Finally, ABI stabilization. Now about optimization by eviltypeguy · · Score: 5, Informative

    I've been waiting for this. Building glibc in the past w/ gcc3 was PAINFUL beyond measure. There are still many optimization options that I have to use with programs otherwise gcc3's optimizers optimize away too much.

    For example, if I compile the modified Quake engine project I work on without -fno-strict-aliasing bizarre graphical errors occur. (Or used, need to check 3.2 now :)

    Or if I compile with -march=athlon I get fairly mixed results, code that sometimes segfaults for no apparent reason, etc.

    Anyway, congrats to the gcc3.2 team...

  2. Re:Breaking interoperability... again??? by TheSunborn · · Score: 5, Informative

    They do and they have promised to keep the C and C++ ABI stable for the future. (They promised the same thing for 3.1 but some bugs in the 3.1 code forced them to change the ABI again).

    Martin Tilsted

  3. Re:Any good compilers out there. by FooBarWidget · · Score: 4, Informative

    Don't blindly follow the "GCC produces slow code"-trend just because of that comparison between GCC en Intel C++ a few months ago on Slashdot.

    Since release 3.1, GCC produces *fast* code. On my Pentium 233 MMX, bzip2 is 25% faster when compiled with GCC 3.1 than the binary produced by GCC 2.95.2. The optimizers have been greatly improved, and can compete with Intel C++. On some areas, GCC is faster, while on other areas, GCC is slower than Intel C++. But all in all, GCC is quite good.

  4. yes they will work by Ender+Ryan · · Score: 5, Informative
    All your existing binaries will still work, you just won't be able to link against them when compiling with GCC 3.2. Most commercial apps are statically linked against whatever GUI toolkit they use (as for games, all Loki's games are), so you have nothing to worry about.

    --
    Sticking feathers up your butt does not make you a chicken - Tyler Durden
  5. Re:Finally, ABI stabilization. Now about optimizat by tlk+nnr · · Score: 5, Informative

    If -fno-strict-aliasing fixes the glitches, it could be an invalid assumption in the C code.

    Read the gcc docu for the details: With the alias analysis ,the compiler tries to figure out if 2 pointers point to different addresses. If it's guaranteed that they point to different addresses, then the compiler will reorder read and write operations.

    The new C standard contains very strict rules about pointers, e.g. writing into an array with a "double *" pointer, and reading back with a "long *" pointer is now undefined.

    Have you tried Intel's compiler, set to maximum optimization?

  6. Re:ABI ?? by Anonymous Coward · · Score: 5, Informative

    Application Binary Interface

    ABI's define what is necessary for two pieces of compiled code to interoperate properly. So you have OS ABI's (which define syscall interfaces, argument passing, etc), Programming language ABI's (C++'s ABI generally includes virtual table format, name mangling format, exception handling format, etc), etc.

    Think of it as the API defined for compiled code.
    Compiled code that is compliant with a given ABI will interoperate properly with other code compliant to that ABI.

  7. Re:Finally, ABI stabilization. Now about optimizat by edhall · · Score: 5, Informative

    Bugs that come and go depending upon whether strict aliasing rules are assumed or not are generally due to broken code. The C standard is quite explicit about when aliasing is allowed and when it isn't. (Aliasing is when there are two or more pointers to the same region of memory. This is generally OK if the pointers are of the same type, or if an appropriate union is used. Two pointers of different types pointing to the same region of memory are generally veboten (char* is an exception).)

    The aliasing rules tend to be a source of trouble since violating them was fairly common in pre-standard days. (The V6 Unix kernel used to use generic pointers -- like "register *p" -- just about everywhere, something that is prohibited under ANSI.) They exist to allow the compiler to optimize based on the assumption that only pointers of the appropriate type can be used to access a stored value, and thus that value can be assumed to be unmodified (allowing redundant accesses to be eliminated) in a larger number of cases.

    A Google search on "C aliasing" will turn up a fair amount of info on the subject.

    -Ed
  8. Re: Switching Compilers by Antity · · Score: 4, Informative

    If I switch from gcc 2.9x to gcc 3.2, what will I not be able to do, and what problems can I expect

    If you compile programs or libraries with GCC 3.2, they won't be able to link against libraries that were compiled with prior GCC compiler versions. But this only affects C++ code! C code is unaffected.

    And: This isn't really a problem if you compile on your own anyway. You just don't need to "switch compilers". Just do a parallel installation. For example: ../gcc-3.2/configure --program-suffix=32 --prefix=/usr && make bootstrap and it will end up as "gcc32" in your system.

    --
    42. Easy. What is 32 + 8 + 2?
  9. Re:What does this mean for OS X? by Pius+II. · · Score: 4, Informative

    OS X mostly uses Objective C (like the various Step implementations) which doesn't have the C++ ABI problems: methods are implemented as messages of sorts. This approach means that you can have completely different objects which simply have some method in common, and call them the same way. Also, the Apple branch of gcc has many improvements over the main branch, namely the ability to mix Objective C and C++ (Objective C++). Everyone keeps naggin' the gcc maintainers to include those changes... perhaps now they'll have finally time to do it, so we can use programs like Chimera under GNUstep... I believe there are also many PPC optimizations in the apple version lacking in the main branch. So, it's really not that bad for apple...

  10. An answer from a maintainer by devphil · · Score: 5, Informative


    Hi. I'm one of the hundred-odd GCC maintainers.

    When will they understand that breaking interoperability is not the way to go forward?

    Because the idea of backwards compatability never occured to any of us until we read your Insightful post. My God, what a concept! I'll go tell them at once!

    Seriously, what makes you think the entire team doesn't already understand this point? Do you think such decisions are made lightly? Go read the archives; they agonized over this for months, and that was before the heavy debating started.

    Here's the simple fact: there is a C++ ABI designed for compatability and interoperability. Here's another simple fact: there were bugs in our implementation of the ABI. The choice was to be backwards-compatable with previous GCC 3.1 and incompatable with other vendors implementing the same spec -- which would pretty much defeat the purpose of a common ABI. Or we could fix the bugs and break compatability in a couple of corner cases.

    Of course, after all the details are worked out is when all of the geniuses with answers to all of life's problems decide to reveal The One True Solution on /. posts...

    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
  11. Re:What does this mean for OS X? by captredballs · · Score: 4, Informative

    I can't find the link, but there was a good summary of a discussion (kernel cousin?) between users and distribution developers about the upcoming release plans for gcc. Apple had commiting to not upgrading to 3.2, but they would think about backporting bug fixes into their tree. Since they are the main distribution point for gcc for OSX, they'll be able to control it.

    --

    I suppose I'm not too threatening, presently, but wait till I start Nautilus
  12. Apples and oranges by devphil · · Score: 5, Informative


    The C++ standard says nothing about ABIs. (Well, there are some layout rules when dealing with POD structs, but nothing about a C++ ABI.)

    We're not meeting the C++ standard in two regards (at least I can't think of any more): first, we don't have export for templates. That will largely be a fallout of the precompiled header projects (two or three PCH branches have been in the repository for a long time now; both Apple and Red Hat have been contributing their implementations).

    Second, we don't do two-stage name lookup for templates. Which most user don't need to worry about. That will come when the current 15-year-old parser has finished being rewritten (and there are branches doing that already as well).

    Also, keep in mind that although the compiler C++ ABI is stable, the C++ library ABI is not. Declaring it stable at this point would be a massively stupid thing to do; there are far too many optimizations to be made still, and those involve changing the ABI. For example, there's a reworking of the memory allocator that currently exists on my whiteboard, and as soon as it gets finished off and checked in, the library ABI will be broken. Vendors already have methods in place for dealing with multiple versions of a library installed; this will be nothing new to them.

    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
  13. Re:Precompiled headers by Inoshiro · · Score: 5, Informative

    Repeated from comment 4079246: "We're not meeting the C++ standard in two regards (at least I can't think of any more): first, we don't have export for templates. That will largely be a fallout of the precompiled header projects (two or three PCH branches have been in the repository for a long time now; both Apple and Red Hat have been contributing their implementations)."

    --
    --
    Internet Explorer (n): Another bug -- that is, a feature that can't be turned off -- in Windows.