Project for CSC 255/455, Spring 2009

Introduction

In the project, you will add your own optimization passes in the Gnu C compiler, GCC 4.2.2. It is not the most recent GCC, but should be sufficient to . You have to know the basic framework of Gcc and how to manipulate the intermediate form, the gimple tree, for program analysis and transformation. This page includes many suggestions that will help you in the process. Please read the entire page and the page on source browsing and debugging before you start. Wish you a happy journey with Gcc. If you are not familiar with subversion, take a look at the VersionStuff page.

mkdir gcc
cd gcc
svn co file:///p/compiler/repos/gcc-4.2.2/trunk gcc-4.2.2
   // if outside the firewall, use
   // svn co svn+ssh://usr_id@server_name.cs.rochester.edu/p/compiler/repos/gcc-4.2.2/trunk gcc-4.2.2
mkdir obj
cd obj
../gcc-4.2.2/configure --prefix=INSTALL_DIR
  // INSTALL_DIR is the directory you want to install the binary
make BOOT_CFLAGS='-O0 -g'
  // '-O0 -g' is used to build a debuggable compiler. For a normal build, just use 'make'
make install

To make it easy to use the debugger later, you may want to change the optimization level in obj/Makefile after configure and before make, by replacing all O2 with O1.

The generic installation procedure for GCC is here. Installation parameters for configure are described here. http://gcc.gnu.org/wiki/DebuggingGCC

* Set ALLOWTOPICCHANGE = ChenDing, BinBao

Edit | Attach | Watch | Print version | History: r30 | r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r3 - 2009-01-25 - BinBao
 
  • Edit
  • Attach
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding URCS? Send feedback