GCC 4.0

Jan 发表于 2005-04-24 17:43:59

Open Source GCC 4.0: Older, Faster
By Sean Michael Kerner

UPDATED: Open source development got a bit faster this week thanks to the release of the GCC 4.0 compiler (define). GCC is included in every Linux distribution and has been one of the leading compilers in use over the last 15 years.

GCC, which used to stand for GNU C Compiler and then changed to GNU Compiler Collection as it added languages beyond just C, has a long and critically important history in the free and open source (FOSS) movement.

The first GCC release was written by the "father" of the FOSS movement, Richard Stallman in 1987 as a free software compiler for the GNU project. Compilers are critically important tools that compile source code into object code that can be run on a given platform and, as such, play a fundamental role in building virtually every piece of usable code on a system.

GCC 4.0 offers support for a long list of architectures, including x86, x86-64, IA-64, PowerPC, SPARC and Alpha among others. The GPL-licensed compiler also has front ends for a number of programming languages, including Java, C and C++.

"Without a doubt, the most significant feature in GCC 4.0, and the reason that this version is called 4.0, rather than 3.5, is its new optimization infrastructure," current GCC release maintainer Mark Mitchell told internetnews.com. "Previous versions of GCC did almost all optimizations at, roughly speaking, the level of machine instructions. Unfortunately, by that point a lot of information has been lost. Therefore, GCC 4.0 does a lot of optimizations at a level much closer to the input program."

The new GCC 4.0 includes what the developers have termed "General Optimizer Improvements," as well as specific language improvements. In particular, C++ users will get a significant performance improvement with this new release.

"When compiling without optimizations, the C++ front end is much faster than in any previous versions of GCC," the GCC 4.0 changelog notes. "Independent testers have measured speed-ups up to 25 percent in real-world production code, compared to the 3.4 family, which was already the fastest version to date. Upgrading from older versions might show even bigger improvements."

Another C++ example cited by Mitchell is something called "scalar replacement of aggregates."

"If the compiler can see that an object never has its address taken, it will split the object up into separate pieces, which fit in machine registers," Mitchell explained. "Older versions of the compiler put the entire object into memory, which made operations on it much less efficient."

Cross-platform code re-use also got a boost with this release. The changelog explains that ELF visibility attributes can now be applied to a class type, which means that it now affects all member functions of a class without the need to specify each individually.

"The syntax is deliberately similar to the __declspec() system used by Microsoft Windows-based compilers, allowing cross-platform projects to easily reuse their existing macro system for denoting exports and imports," the GCC 4.0 changelog states.

Apple has already announced that it will ship GCC 4.0 with its next operating system version.

"I know that the GNU/Linux distributors are also excited about the release," Mitchell said. "It generally takes six months to a year before we see all the major distributions pick up the compiler."

Mitchell doesn't expect that GCC will lose its relevance any time soon.

"GCC will certainly be around for the forseeable future," he said. "A lot of other compilers have gone away over the last decade, but GCC is the compiler for GNU/Linux and the BSDs, and it's used with other popular operating systems like OS X and VxWorks."

GCC 4.0 is the base of the next round of optimization, which will be part of GCC 4.1.

"A lot of these focus on making additional use of the optimization infrastructure added in GCC 4.0," Mitchell said. "The goal is to make GCC generate even better code for all of the target architectures."
收藏: QQ书签 del.icio.us 订阅: Google 抓虾

最新评论

发表评论

* 昵称

已经注册过? 请登录

新用户请先注册 以便能显示头像及追踪评论回复

Email
网址
* 评论
表情
 
 

分类小组论坛
杂谈, 娱乐、八卦, 文学、艺术, 体育, 旅游、同城, 象牙塔, 情感, 时尚、生活, 星座, 科技

请注意遵守中华人民共和国法律法规, 如威胁到本站生存, 将依法向有关部门报告, 同时本站的相关记录可能成为对您不利的证据.

相关法律法规
全国人大常委会关于维护互联网安全的决定
中华人民共和国计算机信息系统安全保护条例
中华人民共和国计算机信息网络国际联网管理暂行规定
计算机信息网络国际联网安全保护管理办法
计算机信息系统国际联网保密管理规定