Slashdot Mirror


GCC 3.3 Released

devphil writes "The latest version of everyone's favorite compiler, GCC 3.3, was released today. New features, bugfixes, and whatnot, are all available off the linked-to page. (Mirrors already have the tarballs.) Let the second-guessing begin!"

80 of 400 comments (clear)

  1. woo! by KrON · · Score: 5, Funny

    mmm i'll install this one only cuz it rhymes ;)

  2. gcc 3.3 fails on glibc 2.3.2 by Anonymous Coward · · Score: 4, Interesting

    just for information re-compiling glibc 2.3.2 with gcc 3.3 fails. i don't see the point releasing a compiler or standard glibc which doesn't allow the existing compiler to be used to compile it.

    1. Re:gcc 3.3 fails on glibc 2.3.2 by bconway · · Score: 5, Insightful

      I don't see the point in making changes to a compiler that shouldn't be made solely to satisfy a single piece of software. If the problem is with glibc, it should be fixed, not worked around. What if XFree86 failed to compile, should GCC work around that? How about Mozilla or OpenOffice.org?

      --
      Interested in open source engine management for your Subaru?
    2. Re:gcc 3.3 fails on glibc 2.3.2 by Anonymous Coward · · Score: 2, Interesting

      don't you think that a compiler should at least be able to deal with the last release of a core system component such as glibc ?

      The compiler should at least be able to compile a) the Kernel b) the Glibc.

      From the release timeframe a) is no problem. But b) usually takes half - one year to show up with a new release. They should at least release gcc and glibc at the same time or at least provide patches. Regardless to that the glibc and gcc people are almost the same persons so they should know best.

    3. Re:gcc 3.3 fails on glibc 2.3.2 by rmathew · · Score: 2, Interesting

      *Why* do you say that? I mean, can you point to some page that details the problems

    4. Re:gcc 3.3 fails on glibc 2.3.2 by norwoodites · · Score: 3, Informative

      Try this link instead: http://gcc.gnu.org/PR8610, it is smaller and easier to remember.

    5. Re:gcc 3.3 fails on glibc 2.3.2 by jmv · · Score: 4, Informative

      Typically, all gcc releases break the kernel somewhere. This is because many kernel rely (unintentionally) on some behaviour of gcc that is not guaranteed by the standard. When a new gcc release comes, they need to make sure they fix that. That's why there's always a "list of supported compilers for the kernel". There's no reason why the gcc folks should refrain from using some optimizations because it would break bad code in the kernel.

    6. Re:gcc 3.3 fails on glibc 2.3.2 by jmv · · Score: 4, Informative

      It's not necessarily someone who doesn't know the language. Sometimes "normal" mistakes happen and don't get corrected because nobody noticed (i.e. because the compiler generated code that didn't expose the bug). Alan Cox once said that if you don't have access to a big endian machine, there's no way your code will work perfectly on such machine (though you can come close, you'll always miss one). The same is true with compilers: unless you have a compiler that generated bad code for 100% of the cases where you're not following the language perfectly, you won't catch all bugs.

      Most of the times, this is not obvious stuff. A while ago, gcc 2.95 (or was it 2.96?) broke the kernel because of the strict aliasing rules: gcc assumes that an (int*) and a (float*) can't point to the same area (even now, the kernel needs to be compiled with -fno-strict-aliasing). One of the reasons why gcc 3.3 breaks the kernel now is that at some places, the kernel assumes that an inline function will be inlined, otherwise it breaks. The older versions of gcc always made those functions inline, but the new version take inline merely as a hint (like "register"), which is compliant with the standard. The kernel needs to be fixed to say "inline this or die" or something like that instead.

    7. Re:gcc 3.3 fails on glibc 2.3.2 by nusuth · · Score: 2, Interesting
      glibc is part of GNU project and gcc compiled stuff is expected to link with it more often than not, so I concur about compatibility. I think glibc people be warned and should be fixed before release of gcc though.

      As for the kernel, which "the" kernel is that?

      --

      Gentlemen, you can't fight in here, this is the War Room!

  3. SERVAR == TEH VARY SLWO by Anonymous Coward · · Score: 4, Informative

    Caveats
    The preprocessor no longer accepts multi-line string literals. They were deprecated in 3.0, 3.1, and 3.2.
    The preprocessor no longer supports the -A- switch when appearing alone. -A- followed by an assertion is still supported.
    Support for all the systems obsoleted in GCC 3.1 has been removed from GCC 3.3. See below for a list of systems which are obsoleted in this release.
    Checking for null format arguments has been decoupled from the rest of the format checking mechanism. Programs which use the format attribute may regain this functionality by using the new nonnull function attribute. Note that all functions for which GCC has a built-in format attribute, an appropriate built-in nonnull attribute is also applied.
    The DWARF (version 1) debugging format has been deprecated and will be removed in a future version of GCC. Version 2 of the DWARF debugging format will continue to be supported for the foreseeable future.
    The C and Objective-C compilers no longer accept the "Naming Types" extension (typedef foo = bar); it was already unavailable in C++. Code which uses it will need to be changed to use the "typeof" extension instead: typedef typeof(bar) foo. (We have removed this extension without a period of deprecation because it has caused the compiler to crash since version 3.0 and no one noticed until very recently. Thus we conclude it is not in widespread use.)
    The -traditional C compiler option has been removed. It was deprecated in 3.1 and 3.2. (Traditional preprocessing remains available.) The header, used for writing variadic functions in traditional C, still exists but will produce an error message if used.
    General Optimizer Improvements
    A new scheme for accurately describing processor pipelines, the DFA scheduler, has been added.
    Pavel Nejedly, Charles University Prague, has contributed new file format used by the edge coverage profiler (-fprofile-arcs).

    The new format is robust and diagnoses common mistakes where profiles from different versions (or compilations) of the program are combined resulting in nonsensical profiles and slow code to produced with profile feedback. Additionally this format allows extra data to be gathered. Currently, overall statistics are produced helping optimizers to identify hot spots of a program globally replacing the old intra-procedural scheme and resulting in better code. Note that the gcov tool from older GCC versions will not be able to parse the profiles generated by GCC 3.3 and vice versa.

    Jan Hubicka, SuSE Labs, has contributed a new superblock formation pass enabled using -ftracer. This pass simplifies the control flow of functions allowing other optimizations to do better job.

    He also contributed the function reordering pass (-freorder-functions) to optimize function placement using profile feedback.

    New Languages and Language specific improvements
    C/ObjC/C++
    The preprocessor now accepts directives within macro arguments. It processes them just as if they had not been within macro arguments.
    The separate ISO and traditional preprocessors have been completely removed. The front-end handles either type of preprocessed output if necessary.
    In C99 mode preprocessor arithmetic is done in the precision of the target's intmax_t, as required by that standard.
    The preprocessor can now copy comments inside macros to the output file when the macro is expanded. This feature, enabled using the -CC option, is intended for use by applications which place metadata or directives inside comments, such as lint.
    The method of constructing the list of directories to be searched for header files has been revised. If a directory named by a -I option is a standard system include directory, the option is ignored to ensure that the default search order for system directories and the special treatment of system header files are not defeated.
    A few more ISO C99 features now work correctly.
    A new function attribute, nonnull, has been added which allows pointer arguments to functions to be specified as requiring

  4. Sigh by unixmaster · · Score: 5, Interesting

    And "cant compile kernel with gcc 3.3" messages started to appear on lkml. Is it me or gcc team goes for quantity rather than quality that they even postponed many bugs ( like c++ compile time regression ) to gcc 3.4 to release 3.3...

    --
    Never learn by your mistakes, if you do you may never dare to try again
    1. Re:Sigh by Ed+Avis · · Score: 4, Informative

      In the past, when a kernel has not compiled with a new gcc version it has been more often a bug in the kernel than one with gcc. The same goes for most apps. Looking at the list archives, the main problem seems to be with __inline__ which was a gcc extension to start with, so the problem is presumably that the meaning of that keyword has been deliverately changed.

      --
      -- Ed Avis ed@membled.com
    2. Re:Sigh by norwoodites · · Score: 4, Informative

      Linux, the kernel, depends on old gcc extensions that are slowly being removed from gcc, extensions that were not documented. Also c++ compile time is a hard thing to fix if you want a full c++ compiler in a short period of time. 3.3 is very stable compiler, even 3.4 in the cvs is a stable compiler. The gcc team are all volunteers so why do you not help them and fix some problems, and/or report some problems to us (I am slowing helping out now).

    3. Re:Sigh by norwoodites · · Score: 2, Insightful

      Correctness is more important than compile time that is why it is being pushed back, most of the compile time regressions have to do with the inliner and its limits.

    4. Re:Sigh by Horny+Smurf · · Score: 5, Informative

      gcc 3.4 is slated to include a hand-written (as oppsed to yacc-built) recursive descent parser (for c++ only). That should give a nice speed bump (and fixes over 100 bugs, too).

    5. Re:Sigh by uncleFester · · Score: 3, Interesting

      In the past, when a kernel has not compiled with a new gcc version it has been more often a bug in the kernel than one with gcc..

      not really; it's a combination of kernel developers trying things to deal with 'intelligent' inlining, or implementing hacks when they discover an idiosyncrasy with GCC. As the gcc team 'resolves' (fixes? ;) such things the hacks may then fail, resulting in compile errors. unfortunately, this can make the code MORE fun as you then have to add compiler version tests to check which code should be used.

      The goal, though, is using the latest kernel with the latest compiler will generate the most correct code. Simply pointing a finger at the kernel developers is incorrect; both sides can be the cause of compiler failures.

      disclaimer: not a kernel developer, just a more-than-casual observer.

      'fester

      --
      -'fester
    6. Re:Sigh by Per+Abrahamsen · · Score: 2, Informative

      Yacc and similar tools are optimized for languages with "nice" grammars, and have hacks to support languages with less nice grammars. The number of hacks needed to support C++ is so large that it evidently slow down the whole parser, not to mention make it unreadable. At that point, writting an add-hoc parser is better.

  5. Bounds Checking by the-dude-man · · Score: 4, Interesting

    I hear they have added in some more advanced, and aggressive bounds checking. Now when i screw up something i wont have to wait for a seg-v to tell me that pointer moved a little too far.

    Although it dosnt seem to work with glibc....this is quite annyoing, although it probably will be fixed and re-released in a few days

    1. Re:Bounds Checking by asuffield · · Score: 5, Informative
      I hear they have added in some more advanced, and aggressive bounds checking. Now when i screw up something i wont have to wait for a seg-v to tell me that pointer moved a little too far.

      Indeed, that SIGSEGV becomes a SIGABRT instead. This is dynamic bounds checking; it won't find anything until the bounds error occurs at runtime, so you won't find it any earlier. All it does is make sure that no bounds errors escape *without* crashing the process.

      Although it dosnt seem to work with glibc....this is quite annyoing, although it probably will be fixed and re-released in a few days

      I guess you didn't read the documentation. This is a "feature". It breaks the C ABI, forcing you to recompile all libraries used in the program, including glibc.

    2. Re:Bounds Checking by swillden · · Score: 3, Interesting

      I hear they have added in some more advanced, and aggressive bounds checking.

      What are the run-time performance implications of this bounds checking? It sounds very nice for debugging, and a great thing to turn on even in production code that may be vulnerable to buffer overflow attacks, but it can't be free. A bit of Googling didn't turn up anything; does anyone know how expensive this is?

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
  6. Be careful by swagr · · Score: 3, Funny

    I'm waiting for SCO to show it's copied code before I pick up any GNU software.

    --

    -... --- .-. . -.. ..--..
  7. ABI? by 42forty-two42 · · Score: 3, Interesting

    Does this release break binary compatibility?

  8. Re:this is all well and good by Anonymous Coward · · Score: 2, Informative


    There is one. Its called Visual SlickEdit, it costs $249 dollars.

  9. slower than the last release.... by oliverthered · · Score: 2, Interesting

    The optimiser has been vastly improved and ....

    The following changes have been made to the IA-32/x86-64 port:
    SSE2 and 3dNOW! intrinsics are now supported.
    Support for thread local storage has been added to the IA-32 and x86-64 ports.
    The x86-64 port has been significantly improved.

    If you wan't compile time performance look at

    Precompiled Headers

    --
    thank God the internet isn't a human right.
    1. Re:slower than the last release.... by gazbo · · Score: 4, Funny

      Sir, as the chairman for The Society of Prevention of Apostrophe Abuse, I must herby report your post's heinous abuse in the "word" wan<deleted>t. Expect a letter from our solicitors very soon.

  10. Sigh, indeed... by squarooticus · · Score: 3, Informative

    You DO realize that most of the problems compiling the Linux kernel with succeeding releases of gcc is due primarily to the kernel team making incorrect assumptions about the kernel output...

    Right?

    --
    [ home ]
  11. Compile-time performance by Hortensia+Patel · · Score: 5, Informative

    Yes, this release (like all 3.x releases) is a lot slower than 2.9x was. This is particularly true for C++, to the point where the compile-time cost of standard features like iostreams or STL is prohibitive on older, slower machines. I've largely gone back to stdio.h and hand-rolled containers for writing non-production code, just to keep the edit-compile-test cycle ticking along at a decent pace.

    The new support for precompiled headers will help to some extent but is by no means a panacea. There are a lot of restrictions and caveats. The good news is that the GCC team are very well aware of the compile-time issue and (according to extensive discussions on the mailing list a few weeks back) will be making it a high priority for the next (3.4) release.

    Incidentally, for those wanting a nice free-beer-and-speech IDE to use with this, the first meaningful release of the Eclipse CDT is at release-candidate stage and is looking good.

    1. Re:Compile-time performance by HuguesT · · Score: 2, Insightful

      That's all very nice to say that 3.x is slower to compile than 2.95.s, but the end result, the executable, is faster (by ~10% on SPEC benchmarks), and 3.x releases are a lot closer to the ISO standards (both C and C++) than 2.95.x, so I don't see why we should all weep.

  12. Re:this is all well and good by double_u_b · · Score: 2, Interesting

    Visual Studio (v6) is a really bad IDE. I prefer Borland C++ Builder from far. And Visual C++ is really abject on some aspects: why does it compiles things differently if you are in debug mode? I used VC++ to code a file compression utility. Operator precedence is not the same between debug and release compiler mode. Debug had the same behaviour than GCC, Watcom or Borland. Release mode had a different behaviour. Not nice, since it took me hours to find wherethe bug was, since you can't easily debug a release executable... Moreover, speed-optimisation nearly always produces bad code. And debugging 'const' functions in C++ make the debugger go wild. Borland had neither of those problems. And the code looked cleaner when showed by BC++ Builder. Nevertheless, what I really like is the EclipseIDE, and the IDE of BeOS.

  13. gcc 3.x compilers have serious C++ perfs issues by ondelette · · Score: 5, Informative

    The new breed of gcc compiler are anywhere from 3 %to 5% slower with file processing using the C++ library. So, compiling the kernel with gcc 3.x is fine, but I suspect that something like KDE which is mostly written in C++ is impacted seriously. At least, all software using the C++ library for IO (fstream) will be much slower. On the other hand, the support for C++ standards is much better so what I do is that I compile using gcc 3.2.3 to validate my C++ and then I run the real thing with a pre 3.x compiler.

    1. Re:gcc 3.x compilers have serious C++ perfs issues by norwoodites · · Score: 3, Informative

      The changes that made C++ compiling slower were for correctness of the compiler so they are needed. I know 3.4 will be faster than 3.3 is(/was), and should be able to speed up even faster.

    2. Re:gcc 3.x compilers have serious C++ perfs issues by Fzz · · Score: 3, Informative
      We're using g++ with heavy use of templates in a project that currently has ~400,000 lines of code. gcc 3.2.1 takes about 50% longer than gcc 2.95.4. But, gcc 3.2.1 found loads of bugs that gcc 2.95 didn't notice, even with all the error checking enabled. I'd much rather have the extra checking and have to upgrade my compilation machines 6 months earlier, rather than have stupid errors go unreported by the compiler. So far today it looks like gcc 3.3 finds still more bugs in our code than 3.2.1 did.

      Thank you gcc team!!!!

  14. What does it mean? by commanderfoxtrot · · Score: 2, Interesting

    That's great... but can anyone tell us what a difference all that will make? I don't really care about compile times (too much)... but will mpeg2enc or ffmpeg run faster?

    BTW, there is a preliminary ebuild in Gentoo.

    --
    http://blog.grcm.net/
    1. Re:What does it mean? by noda132 · · Score: 5, Informative

      Not many visible changes. Developers have better profiling, which means eventually if they care they can make software faster. Also, you're going to find a lot more compiler warnings, and perhaps the odd piece of software which doesn't compile at all. In the short run, nothing changes. In the long run, programs become better as they stick to better programming guidelines (since gcc doesn't support "bad" programming as well as the previous version).

      I've been using gcc 3.3 for months from CVS, and have had no problems with it (except for compiling with -Werror).

    2. Re:What does it mean? by commanderfoxtrot · · Score: 2, Interesting

      In the short run, nothing changes. In the long run, programs become better as they stick to better programming guidelines

      Not very promising!! Basically you're saying this won't make much difference to the end user in terms of speed. I'm not arguing -- I'm agreeing.

      Personally, I would much rather have a slow compiler which gets the most out of my system. Apparently the gcc2.95-age compilers are faster than the gcc3 series: in my book that's a good thing. But has anyone done any testing? How long does it take to do something CPU intensive with each compiler version? It wouldn't take much skill to make a script encoding an SVCD using mencoder/transcode compiled with different gcc versions -- any takers? (I'm in my master's exams...)

      And when will there be proper support for my Morgan Duron? At the moment I use athlon-xp in order to use my SSE instructions: but surely the cache size makes a difference to the code gcc should put out?

      --
      http://blog.grcm.net/
    3. Re:What does it mean? by Anonymous Coward · · Score: 2, Interesting

      AFAIK there are no automatic cache optimizations that would be relevant in a relatively low-tech compiler such as GCC. There are some commercial bleeding-edge compilers that can do cache blocking in some circumstances, but languages such as C and C++ make such optimizations fiendishly complicated. Also, I've never seen cache sizes mentioned as an issue with regards to GCC optimizations, and I've been using GCC and following its development for close to a decade now.

  15. Mostly compatible, but... by r6144 · · Score: 4, Informative

    According to this, if your program is multi-threaded, uses spinlocks in libstdc++, and runs on x86, then you'll have to configure gcc-3.3 for a i486+ target (instead of i386) in order to make it binary compatible with gcc-3.2.x configured for a i386 target. Otherwise when the code is mixed, the bus isn't locked when accessing the spinlock, which IMHO may cause concurrency problems on SMP boxes (?)

    1. Re:Mostly compatible, but... by powerlinekid · · Score: 2, Informative

      All configurations of the following processor architectures have been declared obsolete:

      Matsushita MN10200, mn10200-*-*
      Motorola 88000, m88k-*-*
      IBM ROMP, romp-*-*
      Also, some individual systems have been obsoleted:

      Alpha
      Interix, alpha*-*-interix*
      Linux libc1, alpha*-*-linux*libc1*
      Linux ECOFF, alpha*-*-linux*ecoff*
      ARM
      Generic a.out, arm*-*-aout*
      Conix, arm*-*-conix*
      "Old ABI," arm*-*-oabi
      StrongARM/COFF, strongarm-*-coff*
      HPPA (PA-RISC)
      Generic OSF, hppa1.0-*-osf*
      Generic BSD, hppa1.0-*-bsd*
      HP/UX versions 7, 8, and 9, hppa1.[01]-*-hpux[789]*
      HiUX, hppa*-*-hiux*
      Mach Lites, hppa*-*-lites*
      Intel 386 family


      According to the changelog, i386 support (and source) will be removed in 3.4 unless someone tries to revive it.

      --

      can't sleep slashdot will eat me
    2. Re:Mostly compatible, but... by red_dragon · · Score: 2, Informative
      Intel 386 family

      According to the changelog, i386 support (and source) will be removed in 3.4 unless someone tries to revive it.

      Say what?? Don't you mean that only support for Windows NT 3.x has been obsoleted within the x386 family, which is what the changelog actually says?

      --
      In Soviet Russia, Jesus asks: "What Would You Do?"
    3. Re:Mostly compatible, but... by volkerdi · · Score: 2, Insightful

      The thing is, if you have to configure gcc-3.3 for and i486 target in order to be binary compatible with gcc-3.2.x comfigured for i386, then gcc support for i386 might as well be dead, because all the OS distributions will be compiling it for i486 (or better). I doubt we'll see too many gcc or glibc packages for i386 after that.

    4. Re:Mostly compatible, but... by Micah · · Score: 2, Interesting

      Is there any reason NOT to declare i386 support dead? No one is going to compile newer software for a 386 (bloat, etc) and older compilers work fine for older software.

  16. Re:this is all well and good by BigBadBri · · Score: 4, Funny
    Flamebait?

    Nah.

    Funny as hell, though - Visual Studio is an absolute joy to use.

    Compared to what?

    Having your head nailed to a table?

    --
    oh brave new world, that has such people in it!
  17. Everyone loves GCC? by Call+Me+Black+Cloud · · Score: 3, Informative

    Not for me, thanks. I prefer the dynamic duo of Borland's C++ Builder/Kylix. Cross platform gui development? How you say...ah yes...w00t!

    For Java, Sun One Studio (crappy name)/Netbeans (inaccurate name) floats my boat. There is a light C++ module for Netbeans but I haven't tried it...no need.

    Give Kylix a try - there is a free version you know:

    Borland® Kylix(TM) 3 Open Edition delivers an integrated ANSI/ISO C++ and Delphi(TM) language solution for building powerful open-source applications for Linux,® licensed under the GNU General Public License

    Download it here.

    1. Re:Everyone loves GCC? by turgid · · Score: 2, Interesting

      Kylix is all well and good if you only need to compile code for the i386 architecture. If you need UltraSPARC, MIPS, PowerPC, M68k etc. you're up the creek. If you want a nice Free IDE you could try anjuta. It needs the GNOME libs though.

  18. Re:this is all well and good by TrancePhreak · · Score: 3, Insightful

    Sounds like you just don't have a lot of experience compiling. The first thing you do when something acts out of spec is to clean and then rebuild. This probably would have solved a lot of your troubles. The GNU make has this bug even worse, since it only checks file size most of the time. Speed optimization has _never_ in my 5 years of using VC++ produced bad code. Please stop with the trolling and get back to learning how to use the compilers properly.
    Borland C++ was okay 6 years ago, but after VC6 came out it's easy to see why it's not so great any more. Two more IDE updates and the old BC is left far behind. I'd take many OpenSource IDE's over BC. Features such as auto-completion and code collapsing have saved me a good deal of time & typing.

    --

    -]Phreak Out[-
  19. nonnull function attribute by dimitri_k · · Score: 4, Informative
    If anyone else was curious to see an example of the new nonnull function attribute, the following is reformatted from the end of the relevant patch, posted to gcc-patches by Marc Espie:

    nonnull (arg-index,...)
    nonull attribute
    The nonnull attribute specifies that some function parameters should
    be non null pointers. For instance, the declaration:

    extern void *
    my_memcpy (void *dest, const void *src, size_t len)
    __attribute__ ((nonnull (1, 2)));

    causes the compiler to check that, in calls to my_memcpy, arguments dest
    and src are non null.

    Using nonnull without parameters is a shorthand that means that all
    non pointer [sic] arguments should be non null, to be used with a full
    function prototype only. For instance, the example could be
    abbreviated to:

    extern void *
    my_memcpy (void *dest, const void *src, size_t len)
    __attribute__ ((nonnull));

    Seems useful, though I suspect many derefernced pointers are set NULL at runtime, and so not spottable during build.

    Note: I didn't change the wording above at the [sic], but I believe that this should read "all pointer arguments" instead.
    --
    sig is
    1. Re:nonnull function attribute by GlassHeart · · Score: 3, Interesting
      Seems useful, though I suspect many derefernced pointers are set NULL at runtime, and so not spottable during build.

      It's possible to check at compile time. It's not so much that the compiler detects whether a parameter is null or not at compile time, but whether it can be. For example:

      extern void do_work(void *) __attribute__ ((nonnull));
      void *p = malloc(100);
      do_work(p);
      can trigger a warning or error, because malloc() does not return a "nonnull" pointer, and so passing p to do_work is dangerous. On the other hand, given the code:
      extern void do_work(void *) __attribute__ ((nonnull));
      void *p = malloc(100);
      if (p != NULL) {
      do_work(p);
      }
      then the compiler can work out that the call is safe. This is how LCLint, for example, can do with its /*@null@*/ attribute. The logic will be a little like tracing whether a const variable is passed to a function expecting a non-const parameter. I don't know how far gcc plans to take this feature.
  20. Intel C++ Compiler 7.1 Rules by Anonymous Coward · · Score: 4, Interesting

    Intel's compiler smokes gcc in most benchmarks (not surprising, given that Intel knows how to squeeze every last bit of performance out of their own processors). Although it is not 100% compatible with all the gcc features, and therefore can't compile the Linux kernel, each release adds more and more compatibility. I hope the day will soon come when we can compile a whole Linux distribution with the Intel compiler.

    1. Re:Intel C++ Compiler 7.1 Rules by Anonymous Coward · · Score: 2, Informative

      I believe that the 7.x versions can now compile the kernel, and Intel have benchmarks to show it.

      Of course as always, Gcc is still your number 1 choice for anything other than x86 compilation.

    2. Re:Intel C++ Compiler 7.1 Rules by BreadMan · · Score: 2, Insightful

      no software is good enough to pay for

      You don't pay for software as much as you pay people for making software. I don't work for free and I'm betting you don't either.

      The gcc compiler/toolset is great. You can tell the engineers put thier heart in the work, to paraphrase a robber baron. Putting few bucks into thier pockets to reward them for thier hard work and excellent product is A Good Thing. Recognition is great compensation if your other material needs/wants are met.

      Check out the FSF shopping page. The books are great and well worth the money. The art work isn't quite my thing. Does your employer match United Way contributions? Direct some of your giving to the FSF.

    3. Re:Intel C++ Compiler 7.1 Rules by be-fan · · Score: 2, Informative

      Actually, GCC is really close to Intel C++. If you check out the benchmarks it's neck-and-neck on most code except for some Pentium 4 code and some numeric code. These differences are mainly due to Intel C++'s better inliner and automatic vectorizer. I do agree, though, that Intel C++ rocks. It's free for personal use on Linux, very GCC compatible, and almost as conformant as GCC to the C++ standard. It's also got extremely good error messages, which very important for C++ programmers.

      --
      A deep unwavering belief is a sure sign you're missing something...
    4. Re:Intel C++ Compiler 7.1 Rules by RealAlaskan · · Score: 2, Insightful
      Intel's compiler smokes gcc in most benchmarks ...

      How's its performance on SPARC III? Does it optimize well for the Athlons? How about the PowerPC CPUs? And the MIPS CPUs? Does it cross-compile for the IBM mainframes? Does it run on them?

      Although it is not 100% compatible with all the gcc features, and therefore can't compile the Linux kernel, ...

      Oh.

      How about the object code? Can its object code be linked to code compiled by gcc, or is using this an all-or-nothing proposition?

      I hope the day will soon come when we can compile a whole Linux distribution with the Intel compiler.

      That would be nifty, indeed. At least it would be nifty for the distributions which run ONLY on Intel CPUs. Which distribution would that be?

      Intel's compiler is certainly peachy, and I would certainly endorse its use by folks who have Intel systems and need to get maximum performance out of them. Same story for the Digital/HPAQ compiler and the folks with the Alpha systems.

      For the rest of us, the folks without Intel CPUs, Intel's peachy compiler is not so much of a muchness. But don't let that stop you from going crazy with it.

  21. Re:this is all well and good by pommiekiwifruit · · Score: 3, Interesting
    Operator precedence is not the same between debug and release compiler mode.

    Are you sure you are not getting precedance confused with order of evaluation between sequence points?

    C++ has fairly flexible rules in that regard, the much discussed (on comp.lang.c++) undefined behavior and implementation-dependant behaviour. For example i=i++; invokes undefined behaviour that may vary between compiler settings. My instinct would be that that is more likely to be the problem than compiler error in most cases. You should post the problem code to see if that is the case.

  22. I think the argument can be made by smittyoneeach · · Score: 3, Interesting
    in response to
    Windows - developer friendly. Linux - developer hostile.

    that open source requires more skill on the part of the developer to get through the learning curve.
    A greater amount of knowledge about what is happening at all levels is mandatory to make that GNU\Linux system happen.
    Whether this is a but or feature probably depends on your current location on the learning curve. The more I interact with open source, the more I like the fact that there are relatively fewer secrets about what is occuring, a feature that seems lost by the time you reach the West Coast...
    --
    Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    1. Re:I think the argument can be made by Junks+Jerzey · · Score: 2, Insightful

      open source requires more skill on the part of the developer to get through the learning curve. A greater amount of knowledge about what is happening at all levels is mandatory to make that GNU\Linux system happen.

      No offense, but that's just so much self-justification. Personally, I'm growing tired of that kind of faux elitist stance.

  23. A bug in a deprecated GCC extension by Per+Abrahamsen · · Score: 2, Interesting

    Treating casts as lvalues is a GCC extension, and an extension that has been deprecated for C++ since 3.0 because it causes problems for valid C++ code.

    I believe the plan is to add a warning in 3.4 and remove it in 3.5.

  24. inline by Per+Abrahamsen · · Score: 4, Informative

    The inline flag in C and C++ is a hint to the compiler that inlining this function is a good idea, just like register is a hint to the compiler.

    GCC has always treated inline as such a hint, but the heuristics of how to use the hint has changed, so some functions that used to be inlined no longer is inlined.

    The kernel has some function that *must* be inlined, not for speed but for correctness. GCC provide a difference way to specify this, a "inline this function or die" flag. Development kernels use this flag.

    1. Re:inline by Shimmer · · Score: 2, Insightful

      I don't understand this. Inlining is an optimization -- it has no semantic effect. How could failure to inline cause something to break?

      -- Brian

      --
      The most rabid believers in American Exceptionalism are the exact same people whose policies are destroying it.
    2. Re:inline by WNight · · Score: 4, Informative

      That relies on the assumption that you can always page in the memory containing the subroutine. If you're writing paging code this might not be possible.

      It was a lot harder in real-mode programming, where you couldn't jump to distant code because you had to change segment registers and you had to make sure you backed them up first. Hard to guarantee with C, easy with ASM.

      Besides, there are many optimizations that a compiler has to guess about. It's very hard for it to know if you're relying on the side effects of an operation. If you're looping and not doing anything, are you touching volatile memory each time (where the reads could be controlling memory-mapped hardware) or doing something else similar. That's the most obvious example. There are a ton of pages about compiler optimization. It's really quite fascinating.

  25. The hand written parser by Per+Abrahamsen · · Score: 4, Informative

    Does amazing thing for correctness, and is much easier to understand. However, it is not faster in general. It is faster at some tasks and slower at others, same on average.

    It also exposes tons of errors in existing C++ programs, so expect lots of whining when GCC 3.4 is released.

    GCC 3.4 will have precompiled headers (thanks Apple), which will speed compilation up a lot for project that uses them.

  26. Re:this is all well and good by jmccay · · Score: 4, Interesting

    Actually, Visual Studio is a great IDE. It's one of the few things Microsoft did well. It's not easy to understand at first, but it you take the time to learn it, you'll appreciate it.
    My favorite feature was the scripting ability. You could write VB Scripts (or start by recording them as a macro) to accomplish tasks. I wrote several VB Scripts that wrote out comments in the code.
    KDevelop is the only thing I have seen that's close to Visual Studio. I have C++ Builder 3.0 Professional at home, but I still like the design and easy of use of Visual Studio. The C++ Builder interface is missing some things--like scripting.

    --
    At the next eco-hypocrisy-meeting, count the private jets used to get to the meeting. Should be interesting to see that
  27. Re:this is all well and good by Dan-DAFC · · Score: 3, Informative

    ...I can tell you with certainty that Visual SourceSafe 6.0 is a steaming pile of dog turd that needs to be exorcised, not bug fixed.

    Amen. I wouldn't have thought it possible to write a product that makes CVS look like a sensible choice for source control if I hadn't seen it with my own eyes.

    We used to use SourceSafe, now we use CVS. CVS is an horrific train-wreck of an application but compared to VSS it's a triumph of software engineering.

    --
    Suck figs.
  28. From the changes by pheared · · Score: 2, Insightful


    The C and Objective-C compilers no longer accept the "Naming Types" extension (typedef foo = bar); it was already unavailable in C++. Code which uses it will need to be changed to use the "typeof" extension instead: typedef typeof(bar) foo. (We have removed this extension without a period of deprecation because it has caused the compiler to crash since version 3.0 and no one noticed until very recently. Thus we conclude it is not in widespread use.)


    Or rather, gcc version >= 3.0 is not in widespread use.

  29. Re:this is all well and good by jonadab · · Score: 2, Insightful

    > Windows - developer friendly. Linux - developer hostile.

    Is that why Windows has 95% of the users and 60% of the developers,
    while Linux/BSD/Unix (excluding Mac) have 1% of the users and 85%
    of the developers? Yeah, Linux is *real* developer-hostile. The
    way it hides all the implementation details makes it so hard for
    programmers to get things working...

    Calling Linux user-hostile would be a gross exaggeration, but at
    least it would be barking up something that resembles a tree.

    --
    Cut that out, or I will ship you to Norilsk in a box.
  30. Ridiculous by Anonymous Coward · · Score: 4, Insightful

    Okay, while libc and gcc are technically different projects, as I understand it, I agree that it would seem reasonable to drop a note to the libc folks saying "hey, gcc can't compile libc" and waiting for an update before releasing.

    On the other hand, the argument that the gcc folks should make sure that the *kernel* (presumably the Linux kernel) compiles is absolutely ridiculous. The kernel has been long broken and not language-compliant. I think recent compilers can compile it, but that's very recent, and hardly the fault of the gcc people. The Linux kernel has no association with gcc, and is not an amazingly clean project. Gcc is used in far more places than Linux is -- on just about every OS and architecture in the world. Blocking a gcc release because the Linux kernel doesn't compile would be insane. Gcc is *far* bigger than Linux. It is the standard available-everywhere compiler.

    When someone misuses English, do you correct them or change the entire language to fit their mistake?

    1. Re:Ridiculous by TheRaven64 · · Score: 2, Informative
      Okay, while libc and gcc are technically different projects, as I understand it, I agree that it would seem reasonable to drop a note to the libc folks saying "hey, gcc can't compile libc" and waiting for an update before releasing.

      libc and glibc are not quite the same, however. libc refers to any implementation of the standard c library, while glibc is the GNU version. I use gcc with the MSVCRT, the cygwin libc and the FreeBSD libc. To me glibc is just another piece of software that people who are not me use... When someone misuses English, do you correct them or change the entire language to fit their mistake?

      Actually, often the second. This is how natural languages evolve. On the other hand, doing this with a language like C would be silly (or alternatively you could just rename their abuse of the language C+ or something...)

      --
      I am TheRaven on Soylent News
  31. So when do we get a working debugger for g++? by Anonymous Coward · · Score: 3, Interesting

    It's great to hear about all these new improvements in gcc, but what I really want is a working debugger for C++ code compiled with gcc. The gdb debugger is buggy as all hell. It gives wrong values for variables, has no end of troubles with C++, and often enough when I want to print out the value of a variable it tells me that it can't access that memory, with no further explanation.

  32. I don't have a life by Per+Abrahamsen · · Score: 4, Funny

    thus, I can follow the development list.

  33. Choices, Intel C/Fortran, GCC... by Bold+Marauder · · Score: 2

    I clicked on one of the intel ads last night and was debating wether or not to download the 'unsupported' linux version of intel C & Fortran. Mostly just to play around with.

    I'm wondering if anyone here has played with intel (esp under Debian) C and has any comments on it versus GCC.

    Also [on a fortran note] if it would be worth getting intel fortran for the sake of fortran 95 support, or should I stick w/ the ubiquitous [sp?] gcc/fortran 77 which runs everywhere?

    Opinions, anyone?

    1. Re:Choices, Intel C/Fortran, GCC... by Aardpig · · Score: 2, Informative

      At the moment, I wouldn't bother switching to the Intel F95 compiler. Although it is a very good compiler (in terms of efficient code generation), it lags behind other compilers in terms of features supported. By this, I mean the TR-15580 and TR-15581 extensions to the FORTRAN 95 language, which most vendors support, and which are linguistically-important extensions which fix mistakes made in the original FORTRAN 90 language spec. Both extensions are endorsed by J3 (the ISO body which publishes FORTRAN standards) and WG5 (the working group which develops new FORTRAN standars -- at the moment, they are working on FORTRAN 2000).

      I am eaglerly awaiting the completion of g95, the GNU gcc-based frontend for FORTRAN 95. At the moment, I use a combination of Intel, Lahey and NAG compilers for my FORTRAN 95 needs, but projects I am programming are specifically geared towards what g95 will support. If you want to program with the future in mind, sure, switch to the Intel F95 compiler; but have in mind that the FORTRAN language itself is advancing, and it might be better to (temporarily) spend some cash and get a compiler which is moving with the the language.

      --
      Tubal-Cain smokes the white owl.
  34. I'm still amazed by drxenos · · Score: 2, Insightful

    I have always been amazed that such an impressive compiler is still free. Thanks to the GCC team. You guys/gals rock!

    --


    Anonymous Cowards suck.
  35. Still buggy for Dreamcast by Forkenhoppen · · Score: 2, Interesting

    It's a shame that no one managed to fix bug #10392 before release. Until that one's fixed, those of us who do Dreamcast hacking are stuck using GCC 3.0.4.

  36. Re:this is all well and good by AT · · Score: 2, Informative

    The GNU make has this bug even worse, since it only checks file size most of the time.

    False. GNU make checks the last file modification time. If you have any problems getting consistant incremental builds, it is probably because the Makefile has incorrect dependency information. For example, if a header file changes the size of a struct, every source file that includes it should be recompiled. An automated tool like "gcc -MM" is the best way to ensure the dependencies are correct.

  37. Re:Hmph by avdi · · Score: 2, Insightful

    Sounds like you've been coding to a very old pre-standard version of C++ for a long time. Don't complain that the standard keeps "refining" - what you are talking about are things that have been stable for years. Count yourself lucky that compilers actually let you get away with it all this time.

    And I hope you aren't putting "using namespace std" in new code. Ugh.

    --

    --
    CPAN rules. - Guido van Rossum
  38. We've fixed that for 3.4, and for 3.3 to some by devphil · · Score: 4, Insightful


    "...to some extent." Why give a Subject: line textbox that won't let me use all of it? Grrr.

    Anyhow. One of the big speed hits for iostream code was the formatting routines. Some other reply has a subject like "if you're using fstream you're not interested in performance anyhow," which is so wrongheaded I won't even bother to read it. There's no reason why iostreams code shouldn't be faster than the equivalent stdio code: the choice of formatting operations is done at compile-time for iostreams, but stdio has to parse the little "%-whatever" formatting specs at runtime.

    However, many iostreams libraries are implemented as small layers on top of stdio for portability and compatability, which means that particular implementation will always be slower.

    We were doing something similar until recently. Not a complete layer on top of stdio, but some of the formatting routines were being used for correctness' sake. We all knew it sucked, but none of the 6 maintainers had time to do anything about it, and the rest of the world (that includes y'all, /.) was content to bitch about it rather than submit patches. Finally, Jerry Quinn started a series of rewrites and replacements of that section of code, aimed at bringing performance back to 2.x levels. One of the newer maintainers, Paolo Carlini, has been working unceasingly at iostream and string performance since.

    So, all of that will be in 3.4. Chunks of it are also in 3.3, but not all. (I don't recall exactly how much.)

    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
  39. Re:Hmph by devphil · · Score: 4, Interesting


    Now I understand what Bjarne Stroustrup wrote, when he described /. as "ignorant, and proud of it." Indeed, let the second-guessing begin...

    especially for C++, as it's standard keeps "refining" constantly,

    The standard hasn't changed since 1998.

    as does GCC's interpretation of it. Not to mention the extensions.

    The extensions are, in many cases, older than the standard. Now they conflict with rules added by the standard. One or the other has to give. And, of course, no matter what happens, somebody out there will declare that GCC "obviously" made the wrong choice.

    If you think it's easy, why don't you give it a try? Hundreds of GCC developers await your contributions on the gcc-patches mailing list.

    If you don't like it, you should demand your money back.

    Right now I'm [making changes]. What next?

    Again, the standard was published in 1998. The three changes you describe were decided upon even before then, and they haven't changed since. You've had 5 years to walk down to the corner bookstore and buy a decent book, or search on the web for "changes to C++ since its standardization". None of those changes are due to GCC, and trying to shift the blame to GCC only points out your employer's laziness.

    You've had half a decade. Catch the hell up.

    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
  40. Re:Hmph by HopeOS · · Score: 2, Funny

    I am reminded of a document describing how compilers are like women and assemblers like men. Googled for it, but didn't find it.

    The line I remembered was "things you've been doing for years that seemed OK are now suddenly wrong." I consider myself a pretty astute programmer, but every new compiler version seem to have some new warning to add.

    As a result, I consider my relationship with my compiler no less volatile than that with my wife. Keeps me on my toes anyway.

    -HopeOS

  41. Re:A question about gcc cpu Optimization? by dhazeghi · · Score: 2, Interesting

    Well, remember the kernel is to a large extent already optimized. So most generic optimizations won't help a whole lot. Still you can always try. Plus it's a great way to shake out hidden bugs in either gcc or the kernel...

  42. Re:Via C3 Ezra by cimetmc · · Score: 2

    The main problem is that there is no i586 and i686. After the i486, Intel started calling their processors by names. Overall, there is a high ambiguity of when a processor is an i586 or i686, especially when it comes to non Intel processors and whether they support some specific instructions. The GCC developers realized that and therefore included -mcpu and -march options for a wide variety of cpu types. For compatibility reasons, the i586 and i686 options just alias to pentium and pentiumpro. If your processor is not 100% intruction compatible with an Intel Pentium or Pentiumpro, then you should better use a more approriate processor type when compiling.
    If you check the available options at http://gcc.gnu.org/onlinedocs/gcc-3.3/gcc/i386-and -x86-64-Options.html , you will see that there is even a c3 option available.

    Marcel

  43. PCH vs. compile server by Per+Abrahamsen · · Score: 2, Informative

    The compile server was still experimental last I heard.

    You need to reorganize your Make files to use pch's efficiently. You should

    1) Not change any of your source or header files.

    2) Add a new "all.h" header including all other headers, and precompile that header and only that header, whenever any other header changes.

    3) all.h should not be included directly from any file, instead compile with a special flag that "pre-includes" all.h.

    4) Because of header guards (which you must use), none of the normal header files will be included.

    5) Because no file include all.h directly, it will not figure in the autmatic generated dependencies, and you should not add it manually. Thus, any source file will be recompiled only when the header files it includes directly are changed.

    This solves the "only one include file" problem AC mentions, and means the source and include files are identical to the non-PCH version.

    The danger is that there might creep in hidden dependencies, i.e. source files that does not include all the headers they should, yet compile due to the pre-include of all.h. So you will have to make an occational build without PCH.