Slashdot Log In
GCC 4.0.0 Released
Posted by
CowboyNeal
on Thu Apr 21, 2005 09:08 PM
from the funrolled-loops dept.
from the funrolled-loops dept.
busfahrer writes "Version 4.0.0 of the GNU Compiler Collection has been released. You can read the changelog or you can download the source tarball. The new version finally features SSA for trees, allowing for a completely new optimization framework." The changelog is pretty lengthy, and there's updates for every language supported from Ada to Java in addition to the usual flavors of C.
This discussion has been archived.
No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
Moving fast (Score:4, Interesting)
Re:Moving fast (Score:5, Funny)
Parent
Re:Moving fast (Score:5, Funny)
Parent
Re:Moving fast (Score:5, Interesting)
Parent
GCC 4.0's biggest winner is probably KDE (Score:5, Informative)
Parent
Re:GCC 4.0's biggest winner is probably KDE (Score:5, Informative)
-a GNOME/KDE agnostic fluxbox user
Parent
Re:Moving fast (Score:5, Interesting)
Parent
Re:"Paltry" is probably a poor choice of words (Score:5, Insightful)
Unix and its children and cousins on the back and front end probably double the total number of apple boxes out there. If not more so. Hell some numbers suggest that there actually are more linux desktops than mac desktops. Even if its close between apple and linux on the desktop (which is likely) the number of nix systems in use in general at least matches the number on either side (though they are not desktops).
Parent
Re:"Paltry" is probably a poor choice of words (Score:5, Informative)
Mac OS X itself is compiled with GCC 4. That was the point. Hence, all Mac users depend on GCC 4. That's 40 million and counting according to the latest figures.
Parent
Lisp? (Score:4, Funny)
Re:Lisp? (Score:5, Informative)
Parent
Re:Lisp? (Score:5, Funny)
From A to J. Lisp starts with an L.
Therefore, according to the summary... no.
Parent
Re:Lisp? (Score:5, Informative)
Yes, gcl (formerly known as kyoto common lisp). But it doesn't need the assembler/linker part of the toolchain so it's packaged separately. But I think it is "Part of the GNU Compiler Collection", for what that's worth, and it does depend on GCC.
Parent
i'm having horrible flashbacks... (Score:4, Interesting)
Why? (Score:5, Funny)
Did you not get pleasure out of things being errors in 3.0 that weren't even warnings in 2.95?
I'm sure all the contractors loved it! ;)
GCC motto: "What code can we break today?
Parent
Misplaced blame (Score:5, Insightful)
Did you not get pleasure out of things being errors in 3.0 that weren't even warnings in 2.95?
At least the maintainers of the ISO C++ standard did.
GCC motto: "What code can we break today?
Blame the standards committee, not the GCC maintainers.
Parent
Re:Misplaced blame (Score:5, Funny)
Insightful? Jesus eff-ing Christ. Now the slashbots don't like standards. I bet you wouldn't be presenting the same argument if this discussion was about the transition from MSVC 6.0 to 7.0/7.1.
Parent
Re:Misplaced blame (Score:5, Funny)
Customer: Thanks for fixing it so quickly!
Mechanic: We didn't fix it. We just brought it up to standards. Oh, by the way, your air conditioning no longer works, and your rear brakes are now disabled.
Customer: Uhh.. What?
Mechanic: That's right. The standard refrigerant is now R-134A, so we removed your old R-14 air conditioning system. Also, disc brakes are now standard in the autmotive world, so we removed your drum brakes. Don't drive too fast.
Customer: What the fuck?
Mechanic: Oh, I almost forgot. Your car doesn't have airbags. We're going to have to remove your car's body and replace it with a giant tube frame lined with air mattresses.
Parent
Re:Misplaced blame (Score:5, Insightful)
Parent
Re:Why? (Score:5, Insightful)
Standards are the reason that computers are tolerable to use for any purpose.
If a programmer can't be bothered to follow an international standard of his own language, there is no guarantee that the code is future-proof. One can hardly blame the compiler vendor, as we can't expect a compiler to mindlessly maintain backwards compatibility with every weird use of a bug and every bizarre code construct that has ever been supported in the past.
The ability to compile code written for GCC in another compiler is a *good* thing. If it requires informing the programmer that their code has always been broken, then so be it. A little inconvenience is a small price to pay for standards compliance, or should we expect that the GCC authors "embrace and extend" C and other languages until so much code relies on weird GCC nuggets that programmers (and users) are "locked in" to using just that compiler? (But Douglas Adams forbid if Microsoft does the same thing!)
Maybe I am missing something. If so, please enlighten me (This is not a sarcastic remark--I haven't done much research on what 4.0 has broken so I may be way out of line).
Sheesh, for as hard as the GCC authors work, and for as much GCC has improved in the last 10 years, the contributers sure get a lot of flak. Anyone who doesn't contribute code themselves should be greatful (or at least appreciative) of their efforts, even when they do make mistakes.
Parent
Is anyone else curious what SSA trees are? (Score:4, Interesting)
Re:Is anyone else curious what SSA trees are? (Score:5, Informative)
Parent
Re:Is anyone else curious what SSA trees are? (Score:5, Informative)
To put it simply, SSA is an intermediate representation where each variable in a block is defined only *once*. If a variable is defined multiple times, the target of any subsequent definitions of the same variable is replaced by a new variable name.
SSA helps to simplify later optimizations passes of a compiler (for example: eliminating unused definitions, etc) as described in greater detail (with examples and flowcharts) in the article linked to.
That's the SSA form in short. Now I need to ask somebody the difference between the standard SSA form and "SSA for trees".
Parent
Re:Is anyone else curious what SSA trees are? (Score:5, Informative)
Trying to recall my knowledge of optimizing compilers:
SSA makes optimization easier, since it is obvious where a variable was assigned (since it was assigned in only one location) and what value it contains (since there is only one value being assigned to it). The complexity moves to register allocation, where there can be many more variables to allocate because of SSA. Register allocation is Hard, but doing an ok job is quite possible. Most optimizations are impossible unless you can prove various properties about the variables involved, which is often much easier with variables in SSA form.
Parent
Re:Is anyone else curious what SSA trees are? (Score:5, Informative)
Hmm. Funny. Seems like perfect timing, in retrospect. I just held a presentation on SSA (and efficiently transforming code into SSA) today.
Get the slides here [udel.edu].
HTH
Parent
Re:Is anyone else curious what SSA trees are? (Score:5, Informative)
1) Tokenize the input. For example, if you were compiling perl, you might choose to turn "print $foo" into three tokens; KEYWORD_PRINT, TYPE_SCALAR, and IDENTIFIER('foo'). The output is typically a stream of tokens. This step might be done by lex or flex.
2) Parse the sequence of tokens using a set of rules called a grammar. For example, "TYPE_SCALAR" followed by "IDENTIFIER()" is might match a rule to generate a variable called "$foo", and "KEYWORD_PRINT" followed by a variable means call the function print on the contents of the variable. The output is typically an abstract syntax tree (AST); a high-level data structure representing the program. This step might be done by yacc or bison.
3) Match the AST against a series of rules to output the final code. This might actually be two steps; you might generate something into a low-level register transfer language (RTL) that looks very much like assembly, and then turn THAT into actual machine instructions.
At each stage, you might choose to optimize the output. You might also insert optimizations passes between steps. (For example, you might insert a pass between 2 and 3 to optimize the AST into a simpler AST.)
Before SSA, GCC sort of skipped making any high-level AST; it used to go from parsing almost immediately into a RTL. You can still optimize RTL, but since it's pretty low-level, it misses out on higher-level context and made some optimizations really difficult.
SSA is simply a form used for the high-level AST. Why SSA? It is a very nice form to optimize. Read the wikipedia article for more details on why SSA is particularly useful for some optimizations.
Page 181 of this PDF file [linux.org.uk] from the 2003 GCC Summit explains the flow of the GCC compiler.
Parent
Sweetness (Score:5, Informative)
debian (Score:5, Funny)
Re:debian (Score:5, Insightful)
Parent
Re:debian (Score:5, Funny)
Parent
Re:debian (Score:5, Informative)
Parent
Autovectorization (Score:5, Interesting)
vectorization very rarely works (Score:5, Insightful)
Without automatic vectorization, the performance benefit of compiling for 686 as opposed to 386 is simply minimal. A lot of people have done benchmarks on this, and found out that tuning for 686 with gcc only provides 1-2% improvements in the best case. Keep in mind that current X86 processors execute instructions out-of-order, so instruction scheduling for a specific pipeline is not going to do much (it's very important for in-order machines, though)
Parent
Re:Autovectorization (Score:5, Interesting)
Parent
Re:Autovectorization (Score:5, Informative)
Also, there aren't nearly enough people using MOVNTDQ to avoid polluting the instruction pipeline and dumping useless garbage into the system cache. If you're copying stuff into main memory and you aren't going to use it for a while, use MOVNTDQ to get a big speed win. If you do need it cached, use MOVDQA to get both caching and 128 bit transfers in one instruction! We all paid for these fancy schmancy new instructions in our processors, and it's extremely annoying to see programmers not use them.
Parent
Figured this had to happen (Score:5, Interesting)
Re:Figured this had to happen (Score:5, Informative)
Well, you're wrong because GCC doesn't follow Apple's schedule, or anyone else's for that matter. Even a cursory glance at the GCC mailing list will tell you that.
The reason Apple can promise this is that they're not actually shipping GCC 4. They're shipping their own fork of the GCC 4 code. It's probably about 99% the same code, but don't make the mistake of thinking they're shipping exactly what the FSF is distributing.
Parent
Re:Figured this had to happen (Score:5, Informative)
According to http://gcc.gnu.org/install/specific.html#powerpc-
i.e. you're using a forked version of GCC, and definitely not 4.0.0 out of the box.
the whole notion of "a fork" runs 100% counter to all that open-source stuff
No, actually, the importance of the ability to fork and wisdom to know when to fork is very important to "that open-source stuff".
Parent
*chuckle* (Score:5, Funny)
Readme.SCO (Score:5, Interesting)
The GCC team has been urged to drop support for SCO Unix from GCC, as a protest against SCO's irresponsible aggression against free software and GNU/Linux. We have decided to take no action at this time, as we no longer believe that SCO is a serious threat.
For more on the FSF's position regarding SCO's attacks on free software, please read:
http://www.gnu.org/philosophy/sco/sco.html
Something fun with compiling... (Score:5, Funny)
Screenshots? (Score:5, Funny)
Re:Screenshots? (Score:5, Funny)
Parent
Patent issues (Score:5, Informative)
They mean this patent [uspto.gov] owned by this company [microsoft.com]. What a surprise.
Shouldn't they have done this 10 years ago? (Score:5, Interesting)
One _ancient_ compiler (10+ years) I have to use, already has this feature -- and on a large scale: it'll do it over several screensful of code. What took GCC so long?
Unfortunately, this compiler I mention also has a bug: once it's factored out 'i' in a piece of code like that below, it then complains that 'i' is an unused variable. So you have to do something with 'i' to suppress that warning, which kinda defeats the purpose of the autovectorization.
Sample code:
int a[256], b[256], c[256];
foo () {
int i;
for (i=0; i256; i++){
a[i] = b[i] + c[i];
}
}
TR1 included! (Score:5, Informative)
Re:What a coincidence (Score:5, Informative)
While it is true the syntax has changed (much for the better: templates are now supported in managed C++ code and so are generics, keywords replace ugly __gc, and more), support for the old syntax is still in the compiler (/clr:oldSyntax), and IntelliSense.
However, you will be unable to mix new syntax and old syntax code in the same project without taking some penalties (IntelliSense will break, at the least). The designer will even spit out old syntax code when designing an old form or control.
While the old syntax is definitely on its last legs, the VC++ team was very concerned about not screwing over those (early) adopters of C++ code for the CLR thus far.
A good resource to read up more on the subject would be Herb Sutter's Blog [msdn.com], Stan Lippman's Blog [msdn.com], or any of the other VC++ team member's blogs.
Take this from a former VC++ teammate who left during the Whidbey product cycle (posting AC since I've never bothered to get a slashdot account).
Parent
Re:Compatibility? Linux testing? (Score:5, Informative)
Parent
Re:gcc -v on Fedora 4 test 2 (Score:5, Funny)
> gcc version 4.0.0 20050405 (Red Hat 4.0.0-0.40)
aren't they supposed to release a broken 3.96 first???
Parent
Re:works great! (Score:5, Funny)
It doesn't always get modded fun&@^4-- NO CARRIER
Parent