Slashdot Mirror


Looking At Changes In the Newest GCC

cyberpead writes "With GCC 4 comes a new optimization framework (and new intermediate code representation), new target and language support, and a variety of new attributes and options. Get to know the major new features and their benefits in this article."

54 comments

  1. They've optimized it so much... by Anonymous Coward · · Score: 5, Funny

    That they were able to reduce it down to just one C. Now it's just GC.

    1. Re:They've optimized it so much... by HTH+NE1 · · Score: 3, Funny

      That they were able to reduce it down to just one C. Now it's just GC.

      Of course. It's a GNU Compiler.

      --
      Oh, say does that Star-Spangled Banner entwine / The myrtle of Venus with Bacchus's vine?
    2. Re:They've optimized it so much... by Anonymous Coward · · Score: 0

      Dude, we're so screwed. The robots can now optimize their destroy-all-meatbags code so they have twice the killing power as before!

    3. Re:They've optimized it so much... by Impy+the+Impiuos+Imp · · Score: 1

      Oh, GCC!

      I thought they were making yet another Enterprise, the Enterprise-F. I'm like, "enuf is enuf!"

      --
      (-1: Post disagrees with my already-settled worldview) is not a valid mod option.
    4. Re:They've optimized it so much... by An+ominous+Cow+art · · Score: 0

      GCC-1701-F?

    5. Re:They've optimized it so much... by Anonymous Coward · · Score: 0

      Heh, that would *really* be nice. Imagine C having a GC. :)

  2. Umm, gcc 4 was released 2 years ago by vlad_petric · · Score: 2, Informative

    Granted, 4.3.2 is pretty cool, but AFAIK it's not revolutionary wrt earlier 4.* releases

    --

    The Raven

    1. Re:Umm, gcc 4 was released 2 years ago by Anonymous Coward · · Score: 5, Informative

      But most developers still do not know the important differences between 4.x and 3.x other than the superficial ones like changes in headers that need to be included(ie stuff that breaks their code). For example, few seem to be aware that GCC does profile guided optimization now with -fprofile-generate and -fprofile-use switches(not even mentioned in the article).

    2. Re:Umm, gcc 4 was released 2 years ago by Anonymous Coward · · Score: 5, Funny

      You missed one of the largest improvements in the four series was time travel. This article was actually published two years ago.

      The Slashdot team are now frantically searching for the wormhole in their office. This is also why there are so many dupes, articles keep popping down GCC invoked wormholes.

      Really, Stallman is just messing with us for modding-up comments like this one.

    3. Re:Umm, gcc 4 was released 2 years ago by sxeraverx · · Score: 4, Informative

      One of the things I personally am the most excited about is the ability to do function-level optimization in 4.4. Last year, I had a project that required me to have compiled code be as fast as possible, but you could only submit one source file and no Makefiles, which would be compiled with no arguments, optimizations, etc.. With this, I could throw the optimizations straight into the code, instead of having to compile with optimizations, taking the assembly, throwing that into a wrapper C file, and hoping the code was tested on the same architecture.

    4. Re:Umm, gcc 4 was released 2 years ago by Bert64 · · Score: 1

      Didn't know gcc did profile feedback, used to make use of that feature on sun's compiler a few years back...

      --
      http://spamdecoy.net - free throwaway anonymous email - avoid spam!
    5. Re:Umm, gcc 4 was released 2 years ago by Anonymous Coward · · Score: 1, Informative

      It's been available since 2.95, about 8 years ago.

      There have been lots of improvement on the use of that information since then, but the flags have existed for a long time

  3. gcc 4 is "new"? by Anonymous Coward · · Score: 3, Informative

    I've been using it for a year and a half now.

    1. Re:gcc 4 is "new"? by Anonymous Coward · · Score: 0

      You are so right. Right now, VC++ is starting to include C++ 0x features, so it seems that the C++ 0x support is a goal for MS.

    2. Re:gcc 4 is "new"? by TheRaven64 · · Score: 4, Informative

      The article is about 4.x, and covers everything including the latest 4.3.x series. It's very light on details, however, so unless you know next to nothing about GCC you are unlikely to learn anything.

      --
      I am TheRaven on Soylent News
    3. Re:gcc 4 is "new"? by Anonymous Coward · · Score: 5, Informative

      Wouldn't it be more logical to start supporting C++ 98 first?

    4. Re:gcc 4 is "new"? by Anonymous Coward · · Score: 0

      It seriously is. in b4 -1 troll

    5. Re:gcc 4 is "new"? by Anonymous Coward · · Score: 1, Informative

      That deserves "sad but true" rather than "funny"... VC supports C89, but nothing more recent.

    6. Re:gcc 4 is "new"? by LingNoi · · Score: 1

      You gotta be joking..

    7. Re:gcc 4 is "new"? by mabinogi · · Score: 1

      Not only that, but Microsoft have no plans whatsoever to add support for any C99 features unless they happen to accidentally do so when adding C++ features.

      --
      Advanced users are users too!
    8. Re:gcc 4 is "new"? by XDirtypunkX · · Score: 2, Informative

      As it has done since VC2003 thanks to the hard work of Herb Sutter? DUN DUN DUN.

    9. Re:gcc 4 is "new"? by psmears · · Score: 1

      And it entirely fails to mention the 4.4 series...

    10. Re:gcc 4 is "new"? by Anonymous Coward · · Score: 0

      Only if you are reading impaired. Of course they mention 4.4.

  4. Wow...scary by Anonymous Coward · · Score: 2, Insightful

    Wow! With all of that, you'd think I was truly enamored with GCC. Let's just say that when I'm developing software with GCC and my wife walks into the room, I feel a little uncomfortable.

    That's a little creepy.

  5. GCC? by tacarat · · Score: 1

    I read that as CCG at first... It sounded pretty good too.

    --
    "Common sense will be the death of us all"
  6. Just taking his time I guess by Anonymous Coward · · Score: 1, Funny

    TFA says GCC 4.0 was released 2 years ago... yet it's titled "Getting to know GCC 4". I guess the author took his time to "get acquainted". Best not to rush into those sort of things...

    1. Re:Just taking his time I guess by aesiamun · · Score: 3, Funny

      He was too busy getting busy with gcc 3.x when his wife wasn't in the room :)

    2. Re:Just taking his time I guess by Cleveland+Steamer · · Score: 0, Redundant

      Seriously! From TFA:

      With all of that, you'd think I was truly enamored with GCC. Let's just say that when I'm developing software with GCC and my wife walks into the room, I feel a little uncomfortable.

    3. Re:Just taking his time I guess by Doug+Neal · · Score: 4, Funny

      Seriously! From TFA:

      With all of that, you'd think I was truly enamored with GCC. Let's just say that when I'm developing software with GCC and my wife walks into the room, I feel a little uncomfortable.

      Yeah, GCC 4 has more backends, the little slut.

  7. FINALLY by kwabbles · · Score: 1

    I've been stuck on gcc 3.4.3 for a few years now. Fortran 95 here I come!!

    --
    Just disrupt the deflector shield with a tachyon burst.
    1. Re:FINALLY by pablomme · · Score: 3, Funny

      Are you implying that you're using Fortran 77?

      That's just... gross!

      --
      The state you are in while your HEAD is detached... - wait, what?
    2. Re:FINALLY by kwabbles · · Score: 2, Funny

      Well up until today I haven't had a decent compiler for 95 - so what was I to do? Use FTN95? That's even more grosserest.

      --
      Just disrupt the deflector shield with a tachyon burst.
    3. Re:FINALLY by pablomme · · Score: 2, Informative

      Well up until today I haven't had a decent compiler for 95

      Other than gfortran: g95, NAG's, PathScale's, Intel's, Absoft's, Sun's, Lahey's, Portland Group's, Compaq's...

      For things other than PCs, there's IBM's, Cray's, Hitachi's, Fujitsu's...

      You have no excuse! But please tell me it's not that you actually like Fortran 77... :)

      --
      The state you are in while your HEAD is detached... - wait, what?
    4. Re:FINALLY by kwabbles · · Score: 1

      Allright dammit, you got me. Who the hell uses PURE and ELEMENTAL anyways?

      --
      Just disrupt the deflector shield with a tachyon burst.
    5. Re:FINALLY by pablomme · · Score: 1

      Me. Plus modules, derived types, pointers, allocatable arrays, recursive subroutines, array sections...

      Fortran 9x is likeable, even if it's still somewhat limited. I'd like to see Fortran 2003 become fully supported by major compilers in the near future -- but what I can't wait for is the co-array features of Fortran 2008, so that I can ditch MPI once and for all!

      Fortran 77 is the reason why people laugh at Fortran.

      --
      The state you are in while your HEAD is detached... - wait, what?
    6. Re:FINALLY by elbarney · · Score: 1

      Are you saying that in 4.x ifortran .gt. 77 ??????

    7. Re:FINALLY by Silpheed · · Score: 1

      "Fortran 77 is the reason why people laugh at Fortran."

      Get off my lawn you lazy kids.

    8. Re:FINALLY by coats · · Score: 1
      Actually, the reason they laugh is that they're still stuck in 1960's-vintage FORTRAN IV, and aren't willing even to acknowledge the progress made for FORTRAN-77.

      As an aside, going from "FORTRAN" to "Fortran" was a Fortran-90 change...

      --
      "My opinions are my own, and I've got *lots* of them!"
    9. Re:FINALLY by pablomme · · Score: 1

      To me Fortran 77 is equally laughable. Starting right from the punchcard-oriented fixed format of the source files. It feels old and uncomfortable, to say the least.

      --
      The state you are in while your HEAD is detached... - wait, what?
  8. strl- cpy and cat by Anonymous Coward · · Score: 0

    Sure would be nice to have them. I suppose the gcc maintainers would never admit to someone from the openbsd group knowing what they're doing, though.

    1. Re:strl- cpy and cat by Random+Walk · · Score: 1

      Sure would be nice to have them. I suppose the gcc maintainers would never admit to someone from the openbsd group knowing what they're doing, though.

      That belongs into (g)libc, not into the compiler. It's Ulrich Drepper who is blocking it (see this thread on the glibc mailing list).

    2. Re:strl- cpy and cat by setagllib · · Score: 1

      Just copy them into your source tree. BSD license lets you do that, unlike most of the glibc (LGPL) extensions.

      --
      Sam ty sig.
  9. GC!? by Anonymous Coward · · Score: 0

    > That they were able to reduce it down to just one C. Now it's just GC.

    The Garbage Compiler? Can't be. That sounds more like something used to compile Microsoft products.

  10. LLVM by Anonymous Coward · · Score: 0

    Anybody knows how it compares to LLVM?

    1. Re:LLVM by Anonymous Coward · · Score: 0

      Yes - LLVM cannot run real world software. I tried compiling my own stuff and all it did was segfault-

  11. Let me know when GCC4 is available for MingW by jonwil · · Score: 5, Insightful

    Big deal about all this GCC4 stuff, let me know when GCC 4.x becomes available for MingW as an official build (or better yet, when the GCC community stops treating Windows builds of GCC as second class citizens)

    1. Re:Let me know when GCC4 is available for MingW by Anonymous Coward · · Score: 0

      But they *are* second class citizens! Make your bed, lie in it.

  12. Party like its April 2005 by toofishes · · Score: 1

    How the hell did this make front page news like 3 and a half years too late? Firehose fail.

  13. One target language still missing: XML by mma · · Score: 3, Funny

    There is still one major target language missing: XML. Hopefully gccxml will one day be merged into the main source tree.

    1. Re:One target language still missing: XML by Anonymous Coward · · Score: 0

      Score:2 Insightful? Really? You do all know that XML isn't a CPU, and that that was a joke right?

              Right?
                8-)

  14. GCC to .NET? by joeljkp · · Score: 1

    Theoretical question here:

    The diagram in the article shows GCC as a bunch of language front-ends that translate to an intermediate language, then a compiler for that intermediate language that produces the machine code.

    Isn't this exactly the architecture of the .NET framework? Language compilers for VB, C#, C++ that compile to intermediate code, then interpreted directly instead of to a static machine-code file?

    In other words, could a back-end be developed to change GCC into a universal runtime to replace Java and .NET, while still allowing for programming in everything from F77 to Lisp?

    --
    WeRelate.org - wiki-based genealogy
    1. Re: GCC to .NET? by gidds · · Score: 1

      Hey, wow! What a great idea!

      Coz what with the JVM, CLR, Parrot, p-code machine, LLVM, Rubinius, SWF, Lua, Squeak, Dis, Waba, Z-machine, and a whole host of others, a new VM is just what we need!!!

      ...

      Er, sorry about that. My sarcasm chip seems to have overloaded. But several existing VMs already let you run code written in many different languages. And issues of static (before-the-event) compilation can be rather different from dynamic (while it's running) compilation; the intermediate code may be wholly unsuitable for running in a VM efficiently. I doubt that, even if the GCC back-end were rewritten as a dynamic compiler, it would be much good without the sort of work equivalent to a rewrite from scratch. Ideally, it would have the benefit of compatibility with a lot of existing C etc. code; but that presumes no code changes would be needed; other than that, I can't think of any particular advantages.

      Could the GCC folks hack a VM out of their back-end? Probably. Would it be worth doing? I can't see why.

      Sorry if that sounds a bit negative :)

      --

      Ceterum censeo subscriptionem esse delendam.

    2. Re: GCC to .NET? by Anonymous Coward · · Score: 0

      Given that these VMs are bytecode, it WOULD be interesting if GCC could do... well.. I assume it can do Java to JVM 8-), but if it could compile C, C++, Fortran, etc. to a few of these VMs, that'd be interesting.