Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
GNU is Not Unix Programming IT Technology

GCC 4.0 Preview 684

Reducer2001 writes "News.com is running a story previewing GCC 4.0. A quote from the article says, '(included will be) technology to compile programs written in Fortran 95, an updated version of a decades-old programming language still popular for scientific and technical tasks, Henderson said. And software written in the C++ programming language should run faster--"shockingly better" in a few cases.'"
This discussion has been archived. No new comments can be posted.

GCC 4.0 Preview

Comments Filter:
  • OpenMP? (Score:3, Interesting)

    by Anonymous Coward on Monday March 14, 2005 @07:02PM (#11937955)
    What I'd like to see is features like OpenMP for thread-level parallalism.
  • Is it just me, or is compiling C++ code an order of magnitude slower than compiling C code? (exaggeration) I'm sure there's a very good reason why this is so, but it still doesn't make me happy.
  • boost, please ? (Score:4, Interesting)

    by savuporo ( 658486 ) on Monday March 14, 2005 @07:07PM (#11938011)
    Can we get Boost [boost.org] in standard library please ?
  • I don't mind pissing away RAM, I'm willing to spend 200MB if they can just do it faster, maybe through aggressive caching?
  • Demo (Score:2, Interesting)

    by pjf(at)gna.org ( 807061 ) on Monday March 14, 2005 @07:15PM (#11938120) Homepage
    Does anyone have a LiveCD of this stuff? ;-)
  • Fortran??? (Score:2, Interesting)

    by CrayHill ( 703411 ) on Monday March 14, 2005 @07:16PM (#11938128)
    My guess is that they are using f2c (translating fortran to C first, then compiling), rather than integrating and updating g77. I don't expect this to match most native Fortran compilers for efficiency.
  • by LiquidCoooled ( 634315 ) on Monday March 14, 2005 @07:16PM (#11938134) Homepage Journal
    Actually, MS are pretty good at that as well.

    You can still run software from 1981 on windows XP.

    Take a look for yourselves (those in Windows) here [bricklin.com]
  • by PaulBu ( 473180 ) on Monday March 14, 2005 @07:20PM (#11938170) Homepage
    That GCC is the staple in the embedded world. They could've mentioned that most probably it is the compiler used for the proverbias Internet toaster, or maybe even something sexier, like Formula-1 engine-tuning app... ;-) Apparently the article is written to educate the "general public", would be nice to put this little tidbit into their minds..

    Paul B.
  • Not much. (Score:5, Interesting)

    by devphil ( 51341 ) on Monday March 14, 2005 @07:26PM (#11938224) Homepage


    "gcc" will switch languages based on the filename extension. Many people compile C++ by calling "gcc".

    "g++" suppresses that bit of logic and forces the language to be C++, which is useful if you have some C code that you want to be built as C++, or if you're feeding the C++ source from stdin (hence, no filename extension).

    Linking C++, though, you want to use g++ instead of gcc, unless you really know what you're doing. The "gcc" driver doesn't know which libraries to pull in -- yes, this is something we'd like to change someday -- and the "g++" driver will correctly pull in libstdc++, libm, etc, etc, in the correct order for your linker and your system.

    (Hands up, everybody who remembers when "g++" was a shell script!)

  • by ceswiedler ( 165311 ) * <chris@swiedler.org> on Monday March 14, 2005 @07:26PM (#11938231)
    You're talking about C++ binary compatibility, right? I don't think that GCC has broken C binary compatibility in a long time...

    Can you run C++ applications compiled on Solaris 2 on any later version?

    Compatibility is where Sun rocks, and it's also the rock that Sun is tied to. Most of the things that people hate about Solaris are kept that way because of their commitment to backwards compatibility. It becomes difficult to make signifigant changes if you focus on compatibility the way they do.

    Linux and other OSS tools like GCC have advanced quickly partly because they have always been able to rewrite just about anything if they need to. Historically people were used to it, or okay with it. I wouldn't be suprised if at some point Red Hat and other Enterprise vendors forked a stable-ABI version of GCC, glibc, and Linux, because in larger environments backwards compatibility is very important.
  • Re:C++ compiler (Score:5, Interesting)

    by Surt ( 22457 ) on Monday March 14, 2005 @07:27PM (#11938250) Homepage Journal
    It claims the c++ front end is as much as 25% faster.
  • by captaineo ( 87164 ) on Monday March 14, 2005 @07:29PM (#11938279)
    YES this is a huge problem. More than half of my Linux troubleshooting time can be traced back to version skew issues in either GCC or GLIBC. (libstdc++ changes, pthreads changes, exception handling changes, etc...)

    Now that the C++ ABI is standardized, there is NO excuse for not having backwards- and forwards- compatibility for ordinary C and C++ executables linked against glibc.

    The Linux kernel v2 ABI has been mostly backwards- and forwards-compatible since its first release. And Linux kernel guts change a lot more often than the C/C++ standards!
  • Re:Autovectorization (Score:2, Interesting)

    by WMD_88 ( 843388 ) <kjwolff8891@yahoo.com> on Monday March 14, 2005 @07:33PM (#11938306) Homepage Journal
    Autovectorization is a feature pushed by Apple. Since their AltiVec isn't being exploited like it *can* be, they've gotta push it into the compiler to give themselves a speed boost on G4/G5 (and rightfully so).
  • Re:Mudflap (Score:4, Interesting)

    by idlake ( 850372 ) on Monday March 14, 2005 @07:34PM (#11938316)
    My only concern is that some devs will think running it all the time is OK (read: "Mudflap slows a program's performance"), so hopefully that's not the case.

    I'll agree with you on this much: C+Mudflap is not the way to fix buffer overrun problems. The problem isn't that runtime safety is costly--it isn't--the problem is that adding runtime safety to the C programming language post hoc is costly because of C's screwed up pointer semantics. That's why Mudflap costs you a factor of 3-5 in terms of performance on benchmarks, when runtime safety in another language really should only cost you a few percent overhead at most.

    Mudflap will probably not be used much for testing (people already have good tools for that they don't use) and it has too much overhead for most production use. The biggest thing Mudflap will do is perpetuate the myth that runtime safety is costly.
  • Timeline? (Score:2, Interesting)

    by Matt Clare ( 692178 ) on Monday March 14, 2005 @07:35PM (#11938334) Homepage
    Anyone know when 4.0 will be ready for the distros?

    3 monts? 6 months? a year ? forever?
  • by multipart ( 732754 ) on Monday March 14, 2005 @07:38PM (#11938376)
    Unless things have changed recently, their front end is derived from gcc 2.96 (which, as most of you know, does not actually exist), and their backend is the Pro64/Open64 Itanium compiler retargeted to AMD64. And Pro64 is itself mostly SGI's MIPSPro retargeted to Itanium. The PathScale team leader is also the former SGI MIPSPro compiler team leader (Fred Chow). MIPSPro rocks, and PathScale is also pretty good. The best part is that the compiler is GPL'ed (but only v2, and with a patent infringement clause that actually violates the GPL itself *sigh*),
  • by devphil ( 51341 ) on Monday March 14, 2005 @07:45PM (#11938427) Homepage


    The gcc team seem to have no respect for legacy code.

    You've got to be fucking kidding me.

    Have a look at the mailing list anytime somebody reports a bug, and the choice is between fixing the bug and changing the ABI. Watch the flamefests erupt.

    (Watch them die down a few days later as one of the brilliant core maintainers manages to do both, with a command-line option to toggle between the default fixed version and the buggy old version.)

    Wait a few months. See a new corner-case weird bug some in. Lather, rinse, repeat.

    Incompatible syntax changes

    Such as...?

    All the ones I can think of were GCC extensions long before they were officially added to the languages. In fact, their presence in GCC actually influences their presence in an official language standard, because that's what the standards bodies do: standardize existing practice.

    The troublesome part is when the syntax as added to the language standard differs from the extension that was originally put in GCC. Then we have to choose which once to support -- because supporting both is often not feasible -- knowing that whatever choice we make, slashdot is going to whinge about it. :-)

  • Included with Tiger. (Score:2, Interesting)

    by Anonymous Coward on Monday March 14, 2005 @07:47PM (#11938456)
    From Working with Xcode 2.0 [apple.com]:
    At the very core of the Xcode 2.0 toolchain is the GCC 4.0 compiler, the next generation of the industry-standard compiler. This new compiler contains a number of advanced optimization techniques that are designed to make your applications fly. The most significant of these is the move to Tree SSA (Single Static Assignment) from RTL (Register Transfer Language). Tree SSA is designed to be both language and target independent and allows a level of analysis and optimization that is impossible with RTL. This brings state-of-the-art optimization technology to GCC and to all of your Xcode projects.
    It's bizarre watching Apple skate along the bleeding edge of the open-source world...
  • by Qwavel ( 733416 ) on Monday March 14, 2005 @07:55PM (#11938553)
    At the GCC conference in Ottawa in the summer of 2003, there were two very interesting features presented that they said might make it into GCC 4.0.

    - LLVM. Low Level Virtual Machine. This is a low level and generic pseudo code generator and virtual machine.
    http://llvm.cs.uiuc.edu/ [uiuc.edu]
    This sounded fabulous, and the project appears to be progressing well (it's at v1.4 now). If I understand correctly it is only politics that has kept it out of GCC 4. Can anyone shed more light on this?

    - Compiler Server. Rather than invoking GCC for each TU you would run the GCC-Server once for the whole app and then feed it the TU's. This would make the compile process much faster and allow for whole program optimization.
    This would have been nice but perhaps they found better ways to achieve the same thing.
  • Yes, it's true (Score:5, Interesting)

    by Sycraft-fu ( 314770 ) on Monday March 14, 2005 @07:59PM (#11938580)
    Not sure what you tried but in most compiler benchmarks Intel ranges from "just as fast as the others" to "devistatingly faster". It sometimes generates code that's faster than hand optimised assembly designed to do the same thing. The Intel compiler even generates better code for Athlons than other compilers.

    It gets even more devistating on Fortran. Seems Intel has like the only good Fortran compiler in the world. That's part of the reason their chips do so well on SPEC, the FP part is all fortran code and their compiler just rules at it.

    If you Google around for compiler benchmarks you'll find a number of them, and virtually all show the Intel compiler dominating. One of the best, which I can't find a link for right now, was a test done by Toms Hardware. They did MPEG-4 encoding with the P4 and found that it blew. Intel figured something was wrong, got the source and recompiled the program (was compiled with VC++ 6.0). The P4 almost quadrupled in speed (and got even faster with the SSE optimised modes they added), and even the Athlons showed a near doubling in speed.
  • Re:Nitpicking (Score:5, Interesting)

    by Mad Merlin ( 837387 ) on Monday March 14, 2005 @08:01PM (#11938603) Homepage
    From what I've seen, ICC is still ahead of GCC, but Intel has actually been putting a fair bit of work into GCC, and this is showing in the newer releases of GCC (mostly with Intel processors however, who would have guessed?), mostly compile time related, but also some optimizations for runtime speed. I'd provide hard numbers, but I don't have ICC or the articles that mentioned such handy.

    No idea about MSVC, it doesn't build very good Linux binaries though anyways.

  • by tap ( 18562 ) on Monday March 14, 2005 @08:04PM (#11938641) Homepage
    Incompatible syntax changes
    Such as...?

    For inline assembly code, non-Lvalue parameters can no longer be given an "m" contraint. It used to be possible to have a parameter like (x+1) and use the most general contraint "m", register or memory. This way gcc could leave x+1 in a register, or spill it onto the stack if it ran out of registers.

    In gcc 4 you have to define a variable to hold x+1 and gcc is forced to write the value into memory, even if it could be left in a register.

  • Re:C++ compiler (Score:4, Interesting)

    by vsprintf ( 579676 ) on Monday March 14, 2005 @08:07PM (#11938670)

    But will it compile C++ any faster?

    I don't care if it compiles any faster, just as long as it compiles correctly. We were in the middle of a port of a major system to Linux recently, and the sysadmins decided we really need to install some patches. I shoulda' known better. I shoulda' said no.

    They applied the Red Hat AS patches (which included patches to gcc) on the target machine, and suddenly newly compiled programs that had been working for years had memory overwrite problems. Strings and char arrays would contain things that should be in adjacent memory. The most obvious difference was the newly compiled code was much smaller than that produced by the unpatched gcc.

    Luckily, we had another Red Hat AS machine which had not been patched, and I moved all the development work there. Then I promised the admins that I'd go postal if they touched gcc on that box. So far, so good, but I'd really appreciate it if the gcc guys would get it right before releasing stuff. One of the promised results of the above mentioned patch was a significant reduction in size. They got that part right at least.

  • by Anonymous Coward on Monday March 14, 2005 @08:12PM (#11938709)
    SSA is an interesting representation to do optimizations on. Each "variable" is only assigned to from one static place in the program, making use-def chains easier to reason about. SSAPRE (Partial-Redundancy Elimination) is one of the most general optimizations, and has some big advantages (and some disadvantages) when compared to the old-style bit-vector PREs. One big advantage is you don't have to implement different local and global versions of your PRE to get decent performance.

    Some languages can be parsed directly into SSA form fairly efficiently; however, most compilers will probably do a pass to convert their own parse tree format into SSA so they can optimize in SSA form. They might have to convert it back afterwards though. I think the first versions of GCC to do optimizations on an SSA form used to convert back and forth a few times.

    It would be nice to see a mainstream compiler that does ALL its optimizations in SSA form (and no, the SGI compiler doesn't count)..
  • Re:GUI (Score:1, Interesting)

    by Anonymous Coward on Monday March 14, 2005 @08:19PM (#11938768)
    one of the biggest threats they have to people just picking up linux and wanting to program is a
    lack of a good IDE.

    I suggest you try KDevelop before you go spreading lies about the non-existance of a good IDE for Linux.

    And no, KDevelop is not only for making KDE programs

  • Re:Autovectorization (Score:2, Interesting)

    by illumin8 ( 148082 ) on Monday March 14, 2005 @08:23PM (#11938819) Journal
    Is it just me, or is this the first "we will make it easy to program the Cell" step that Sony and IBM were promising?

    Could be, but auto-vectorization will help not only Altivec enabled architectures (PowerPC G4, PPC970 G5, Cell), but it should also help x86 architectures as well, since SSE, SSE2, and SSE3 are Intel's version of vectorization, or essentially applying the same mathematical operation to many bytes of data at the same time. I think all modern architectures should see a speed increase, especially with multimedia type applications like video encoding/decoding/transcoding.
  • by Anonymous Coward on Monday March 14, 2005 @08:28PM (#11938867)
    templates are invaluable, destructors are invaluable, classed arrays (things like vectors instead of pointers) are invaluable, maps are invaluable, etc.

    I'll add a couple things that have been _very_ useful in my experience:

    - the const keyword: if you want to make your codebase a whole lot safer, and compile AND run faster, const is great. (Yes I know it finally became part of the C language with the C99 standard...)

    - the STL. Some love it, some hate it. For my old job (game programmer), it was invaluable. We made extensive use of certain containers, and the algorithms are great. Sure I learned how to write various sort routines in college but I don't even have to think about it when the STL already has an optimal version.

    - operator overloading. Once again, some love it, some hate it. Game programmers deal with vector math and quaternions all the time, so this feature of C++ is put to good use. It makes the code read more like a math equation, instead of stuff like:

    result = vector1.add(vector2);

    There are probably more things that have slipped my mind but those are the ones that jumped out at me right away.
  • Gcc killed fortran (Score:5, Interesting)

    by goombah99 ( 560566 ) on Monday March 14, 2005 @08:29PM (#11938877)
    Gcc was what killed fortran. Gcc did not implement many fortran features forcing fortran programmers to use a pathetic subset of the language. For example in F77 they never implemented opening files read only (only open read-write) so you could never detect EOF's on pipes to fortran 77. But the real death knell for fortran was sung by g95 and its reduced language elements. Anyone who mistook g95 for F95 would indeed be right in concluding fortran was a dated useless language. Fortran95 does indeed have stucrtures, classes, pointers and allocatable memory contrary to widespread belief to the contrary due to g95. The irony is that fortan 2000 is actually a wonderful language for scientific programming in the coming age of multi-core processors. I would not write a wordprocessor in fortran but for sceintific programming its effieicient memory storage, implicit parallelism in the most basic elementes of the language language (for example for-loops that were allowed to iterate over their range out of order, and subroutines that declare which variables can have side effect) is perfect for the coming age of microprocessing. My favorite parts of fortrans are that one cannot overflow a buffer nor is it possible for a typo to compile. That last statment will elude understanding by most folks who never tried to write a line parser for fortran syntax but it's consequence is that hidden syntax errors that compile are impossible in fortran. (logic errors of course are possible in any language) one trivial example is you cant write = when you meant == or +=. Or the declaration of intent on calling arguments allows you to pass by reference without worrying that an array will be unintentionally modified. RIP fortran95, killed by g95.
  • by Anonymous Coward on Monday March 14, 2005 @08:51PM (#11939050)
    Working for a company that makes engine tuning products (Diablosport [diablosport.com]) I can say we sure do use GCC for quite a few of our products. Several different versions, but no 4.0 yet.
  • by beliavsky ( 814870 ) on Monday March 14, 2005 @08:55PM (#11939078)
    This post is nonsense. First of all, Fortran is not "dead" . There are about 10 Fortran 95 compilers, listed at http://www.dmoz.org/Computers/Programming/Language s/Fortran/Compilers/ [dmoz.org] , and compilers are adding features from the recently approved Fortran 2003 standard. Two reasons Fortran did lose much market share were
    (1) the slow arrival of the Fortran 90 standard, which added dynamic memory allocation, a full set of control structures, user-defined types and free source form, and which otherwise remedied the defects of Fortran 77.
    (2) the lack of a free Fortran 90 compiler.

    G95 does implement practically all of Fortran 95, including the features listed in (1), and gfortran is progressing towards that goal. It is obscene to accuse the volunteers of g95 and gfortran of "killing Fortran".
  • by CatOne ( 655161 ) on Monday March 14, 2005 @09:15PM (#11939269)
    OS X 10.2 shipped with GCC 3.1 I believe -- a while before it was released.

    10.3 shipped with GCC 3.3, before 3.3 was released.

    10.4 looks to continue the pattern. Apple takes a snapshot of GCC, forks it 6-9 months before the OS ships, tweaks/tunes/optimizes GCC, builds and ships with that version of the compiler, and then re-submits its changes, so future GCC builds (especially the PPC ones) get all the goodies.

    And the compiler has had 6-9 months of QA from Apple, which is as good as the amount of credit you give their QA department ;-)
  • by eviltypeguy ( 521224 ) on Monday March 14, 2005 @09:16PM (#11939274)
    The brutally short story is that GCC is operating under a certain restriction imposed by RMS since its inception, and LLVM -- or really, any good whole-program optimization technique -- would require us to violate that restriction.

    Care to tell us what this oh so mysterious restriction is?
  • by horza ( 87255 ) on Monday March 14, 2005 @09:25PM (#11939363) Homepage
    Politics is what's preventing us from considering LLVM, let alone the long and torturous process of making the code work. The brutally short story is that GCC is operating under a certain restriction imposed by RMS since its inception, and LLVM -- or really, any good whole-program optimization technique -- would require us to violate that restriction.

    Now, there are some of us (*waves hand*) who feel that RMS is a reactionary zealot in this respect, and would be more than happy to use the LLVM techniques, but we won't get into that.


    Sounds like RMS is protecting gcc, good for him. Unless you have something more substantial than insinuated slander?

    Phillip.
  • by Malc ( 1751 ) on Monday March 14, 2005 @09:26PM (#11939373)
    I think that's specific to GCC. The Microsoft compiler doesn't have this issue. I remember building the TAO Corba ORB on my Celeron 366 w/128MB a few years under Linux - it consumed all memory and a load of swap and a gig of disk space. It compiled faster under NT4 on my work Pentium Pro 200 with 64MB, and didn't require so much memory nor disk space. Same code base.

    So I've always wondered why GCC was so much more demanding. BTW, does GCC support pre-compiled headers now? That's what seems to provided the biggest build performance boost. Even more so than parallel compilation on an SMP machine.
  • by zerus ( 108592 ) on Monday March 14, 2005 @09:38PM (#11939465) Homepage
    Fortran, like it or not, is still the de-facto basis for the vast majority of engineering modelling programs. MCNP, SCALE, FLUENT, or basically any type of monte carlo calculation is going to be based off of fortran 77 and possibly written in F90 or F95. When I started as an undergrad, I refused to learn fortran saying that it was a dinosaur and outdated by every new programming language available; however, when you get into the real world, you'll notice that the guys that have been doing that stuff for 20+ years don't want to change so new codes will come out but will still be written in good ol' fortran. Needless to say, I know fortran not because I want to, but because it's a necessity as an engineer doing computational methods.
  • Re:Fortran??? (Score:4, Interesting)

    by MarcQuadra ( 129430 ) * on Monday March 14, 2005 @09:44PM (#11939506)
    Nope. GCC-4.0 has a totally new abstracted layer called GIMPLE, from the tree-ssa project. All front ends (C, C++, Java, FORTRAN) output to GIMPLE code, which gets optimized and turned into machine code. It should be MUCH easier to add support for new languages now, all yo have to do is write a front end that turns the input code into GIMPLE.

    This is a dramatic oversimplification, but from what I've read on the GCC lists, it appears to be how it works.
  • Is there anyone who knows what this LLVM issue is about? Anyone out there who is not just ranting incoherently about RMS?

  • Re:Nitpicking (Score:2, Interesting)

    by akihabara ( 70553 ) on Monday March 14, 2005 @10:04PM (#11939634)
    >> but Intel has actually been putting a fair bit of work into GCC

    Bollocks. They only wrote some stuff to support IA64 because they were desperate and no-one else would.
  • by Guy Harris ( 3803 ) <guy@alum.mit.edu> on Monday March 14, 2005 @10:06PM (#11939645)
    If you chose to go against the developers and statically link to Glibc, be prepared to handle the consequences!

    And if you statically link against libc on, I suspect, at least some other UN*Xes (Solaris being one of them), you'd better be prepared to handle the consequences as well. The same, I suspect, applies if you statically link against the kernel32/gdi32/user32 libraries on Windows, if you even can do so.

    Thus, it's not even clear that this (problems with installing completely-statically-linked binaries on OS versions other than the one on which it's built) is any worse than it is on Solaris or Windows, except for the "this week's version of glibc" problem. That would be the real problem, although if the binary requires this week's version of glibc because it was written for this week's version of glibc and uses functionality of this week's version of glibc, then, well, if you choose to do that, be prepared to handle the consequences....

    (Yes, this means that making system developers' lives better by making the lives of some application developers harder, well, makes the lives of some application developers, such as the ones who want to use the latest shiniest APIs but still deliver their applications on systems lacking those APIs, harder. So it goes....)

  • by Salis ( 52373 ) on Monday March 14, 2005 @10:21PM (#11939777) Journal
    I've programmed in other languages, but I find I get more done in less time using Fortran95. Why? I only code for scientific computing and I can give a rats ass about 'features' such as garbage collection, strange usage of pointers, etc etc that Fortran95 doesn't have.

    In the end, Fortran95 is fantastic for scientific computing and the only other language that comes close is C. C is just as fast, but (omfg) you can make a lot of mistakes that will just suck the time from you. No thanks.

  • by captaineo ( 87164 ) on Monday March 14, 2005 @10:41PM (#11939933)
    This has more to do with the habits of C++ programmers rather than the language itself. If you take a random piece of C code and compile it as C++, it will probably take no more than 2-3x more time (the slowdown being due to a larger compiler binary, more sophisticated type-checking, etc). However what is often considered "good C++ programming style" involves inlining far more code than is the norm for C. (e.g. some STL implementations are entirely inline, whereas it would take a pretty crazy C programmer to implement hash tables and heaps inline). That's what blows up the compile time (and binary size).

    The extra compile time buys you more inlining (which can be either good or bad for performance, depending on cache behavior) and also type-safe templates which are not acheivable in C (without ugly hacks).
  • by Anonymous Coward on Monday March 14, 2005 @10:41PM (#11939938)
    Over time, many companies have tried to make money off of portions of gcc without giving anything back to the community. For example, one of the Edison Group's C++ front-ends can be patched onto gcc, giving a "free" compiler for many platforms without giving a better C++ front-end to gcc. Currently, only an end user can patch gcc to work with that front-end. That restriction makes the product less attractive.

    Because of this history, RMS does not want to make it easier for companies to take from gcc without giving back. LLVM would provide a clean interface between portions of gcc, and that clean interface could be so abused.

    Remember that gcc has Objective-C support only because NeXT was forced to abide by the GNU GPL. Large portions of gcc were contributed by volunteers under the terms of the GNU GPL; their work was donated with the expectation that others' work would be made available. Many would see LLVM as a betrayal of that expectation. The next version of the GPL may address this issue...
  • Re:C++ compiler (Score:2, Interesting)

    by Anonymous Coward on Monday March 14, 2005 @11:35PM (#11940260)
    And when they compile GCC 4.0 with GCC 4.0, it will be even fasterer!

    Well, that's exactly how GCC is built. It would use the existing compiler you already have on your system to build a portion of GCC enough to compile/build the version of GCC you're attempting to build.
  • by Anonymous Coward on Monday March 14, 2005 @11:57PM (#11940381)
    And it's absolutely horrible for any kind of C++ development. Look at Boost's C++ regression test suite results for gcc on Darwin - they are discraceful! The fact that they are branching in the middle of Stage 1 or early in Stage 2 has meant that they have a compiler that's about as bad as the infamous RedHat 2.96 series, only Apple, Inc puts out bugfixes even more rarely.

    Its so bad, that I don't even use Apple's GCC for any C++ development; I always start by building a GCC/G++ from FSF's released codebase.
  • Re:Mudflap (Score:3, Interesting)

    by Xyrus ( 755017 ) on Monday March 14, 2005 @11:57PM (#11940385) Journal
    While I agree that C's golden age has come and gone, it shouldn't be relegated to the dust-bin of history yet.

    There are many places where C is still used. There are many API's that are still in C. There's plenty of embedded systems programming that is done in C. So on and so forth. It has it's uses just like fortran has it's uses (and that's a rather ugly language IMHO).

    A couple of years ago I was using C for embedded systems, due to the fact that the overhead incurred by C++ was just too large.

    I still prefer C++ to the newer languages, along with the occasional assembler block for super critical performance code.

    The newer languages certainly take a considerable amount of work out of the process (which I really like), but all those features come at a cost. And for those projects where the costs outweigh the benefits, "unsafe languages" will still be used.

    I'd like one of the newer languages to have the power of assembly/C/C++ while still maintaining all their grace of memory saftey and management.

    They're getting better, but they're not quite there yet.

    ~X~
  • by r00t ( 33219 ) on Tuesday March 15, 2005 @01:06AM (#11940732) Journal
    printf("%d\n", ({for(i=2;i14;i++);i;}) );
  • Re:Mudflap (Score:3, Interesting)

    by jemfinch ( 94833 ) on Tuesday March 15, 2005 @01:36AM (#11940848) Homepage
    My only concern is that some devs will think running it all the time is OK (read: "Mudflap slows a program's performance"), so hopefully that's not the case.


    My only concern is that some developers will think turning it off for releases is OK. Anyone who thinks that any real-world software project is a "finished product" is deluding himself. It reminds me of a quote I read somewhere, which said basically, "Turning off assertions to ship is like practicing on the ground with a parachute and not wearing it when you jump out of a plane."

    Jeremy
  • Re:OpenMP? (Score:3, Interesting)

    by Col Bat Guano ( 633857 ) on Tuesday March 15, 2005 @04:17AM (#11941390)
    ...but GCC does not support pragmas with a lexical context yet

    The C compiler front end doesn't, but at least one other language front end does (i.e. Ada)

  • by x2A ( 858210 ) on Tuesday March 15, 2005 @04:57AM (#11941486)
    Many modern filesystems use something called delayed allocation, so (eg, temp) files that are written and deleted shortly after, are removed from the write queue, and never actually make it to disk. I think I recall reading it coming to reiserfs a few years back. So the effect is that /tmp already is mounted in ram.

    -2A
  • by Anonymous Coward on Tuesday March 15, 2005 @08:30AM (#11942195)
    Incompatible syntax changes? Yes, there are. Mainly, they are small defects to the C++ language.

    Example 1: C++ standard defect
    int func(int param=3); ...
    int func(int param=3){
    dosomething(param);
    }

    If you are like me, you copy the declaration to the definition, and have a working program in 3.0 and not in 3.3. And yes, the program is incorrect(the second =3 is not allowed), but this it is a stupid problem.

    Example 2: Another C++ standard defect:
    The keyword 'typename' is required at some positions in a template, and forbidden at other positions, altough they look very similar. I am not going to give an example, as the differences are so obscure that I don't even know them completely myself. Again, 3.0 allowed this and 3.3 didn't

    Example 3: gcc bug.

    There was something in gcc 2.7x about clobbering a returned register in asm statements. It was allright, but technically forbidden in 2.7x, WHICH WAS NEVER MENTIONED IN THE DOCUMENTATION! When upgrading to 2.9x, the code stopped compiling, and gave a very obscure error message (I believe it was 'Error:Register C has been spilled for class CReg' or something like that.)

    All of these errors could have been turned into warning for some 'transitional' versions of gcc, which would have given me the time to fix them more easily.
  • by kwoff ( 516741 ) on Tuesday March 15, 2005 @08:41AM (#11942246)
    It's the same reason that RMS avoided adding dynamic linking support (for example to be able to add elisp wrappers around C libraries) to GNU Emacs, whereas this apparently exists in XEmacs.

"Money is the root of all money." -- the moving finger

Working...