News Archive (1999-2012) | 2013-current at LinuxGizmos | Current Tech News Portal |    About   

Tutorial gets chummy with GNU compilers

Oct 31, 2008 — by Eric Brown — from the LinuxDevices Archive — 2 views

IBM DeveloperWorks has published a tutorial on GNU Compiler Collection (GCC) version 4. Written by Tim Jones, “Get to know GCC 4” describes the upgrade's new Tree SSA optimization framework and intermediate code representation, OpenMP multi-threading, and novel approaches to target and language support.

Jones starts with a brief overview and history of GCC, starting with Richard Stallman's release of GNU C Compiler in 1987. GCC is the world's most popular compiler toolchain, writes Jones, who indicates that its code can be used to build compilers for Ada, Fortran, Java, C++, and Objective-C. GCC 4.0, which he says represents a major transition from version 3, covers 30 processor families and runs on more than 60 platforms.

“GCC is the cornerstone of development in both the open source and closed source worlds,” writes Jones, a consulting engineer at Emulex. However, the compiler collection is of particular importance to embedded Linux development, he continues. Linux “is widely successful because it is run on so many different architectures,” he writes. “Once again, a port of GCC to the target environment enables Linux to be ported and run on it. Without trying to put too fine a point on it, GCC paves the way for Linux and embedded development.”

Tree SSA and autovectorization

After this pep talk, Jones gets down to business by describing the basic compiler stages of GCC 4.0, as well as the major 4.x enhancements. In particular, he describes the new optimization framework, which uses the new tree Static Single Assignment (Tree SSA) form. Unlike the pre-existing, low-level Register Transfer Language (RTL) framework, Tree SSA can better deal with higher-level information and “is designed to be both language independent and target independent while supporting improved analysis and richer optimizations,” writes Jones. He goes on how to explain how Tree SSA interacts with the new intermediate representations, Generic and Gimple.

Jones also explains the novel “autovectorization” feature, which “allows the compiler to identify scalar processing loops within code that can benefit from vector instructions available in the target processor.” This loop vectorization helps produce tighter, more efficient target code, he continues. Another loop-based optimization called Swing Modulo Scheduling (SMS) helps developers construct instruction pipelines “with the goal of minimizing cycle counts by exploiting instruction-level parallelism,” he writes.

Jones finishes up by exploring features added in subsequent versions, for example:

  • 4.1 — improved profiling support, more accurate branch probability estimation, better inline support, and the ability to exploit the instruction cache locality
  • 4.2 — OpenMP multi-threading implementation for generating code for task and data parallelism; enhanced language and processor support (Sun UltraSPARC T1 and Broadcom SB-1A MIPS core)
  • 4.3 — Support for processors such as Coldfire, IBM System z9 EC/BC, Cell's Synergistic Processor Unit (SPU), SmartMIPS, and others; new support for Thumb2 (compressed ARM instructions) and ARMv7, and tuning support for Intel Core2 and AMD Geode processors

Availability

The full IBM DeveloperWorks tutorial by Tim Jones, “Get to know GCC 4,” should be available here.


 
This article was originally published on LinuxDevices.com and has been donated to the open source community by QuinStreet Inc. Please visit LinuxToday.com for up-to-date news and articles about Linux and open source.



Comments are closed.