Difference: ProjectHome (12 vs. 13)

Revision 132008-01-27 - XiaomingGu

Line: 1 to 1
 
META TOPICPARENT name="CS255Spring08"
Line: 10 to 10
 

Browsing Gcc code and debugging

Added:
>
>
  • Using Emacs (especially useful when you work remotely)
 

Gcc Resources

Line: 18 to 19
 

Useful tips

Changed:
<
<
  • Check out code and install: see Gcc-4.2.2 notes on installation
>
>
 
  • Use qsub -I at node64 to get a node to accelerate the make and install: see ClusterJobs
  • To prevent the problem of hardware incompatibility, you'd better build your compiler and use it and run the compiled executables on the same kind of machines.
  • Output gimple tree in c-like form: use option -fdump-tree-gimple
  • Invoke your pass: use -O2 -fcs255
Added:
>
>
  • Output gimple tree in c-like form after the pass for cs255: use option -fdump-cs255-tree-gimple
  • Use make for your testing: see An Example for Makefile
  • How to turn in your code: see Turn in for cs255
 

Part 1: Trivial

Changed:
<
<
In this part, we count and output the number of executed statements of a run of a program. So you need to maintain a global counter which is initialized to 0 and increased after each gimple statement and reported when the program exits. Following are the three parts of the intrumented code:
>
>
In this part, we count and output the number of executed statements of a run of a program. So you need to maintain a global counter which is initialized to 0 and increased before each real gimple statement (i.e. not label statement) and reported when the program exits. Following are the three parts of the instrumented code which are already defined as three functions in cs255-lib.c:
 
  • Initialization: added at the entry of main function
Changed:
<
<
  • Increasing: added after each statements
>
>
  • Increasing: added before each statements
 
  • Report: added at all possible exits of the program
Changed:
<
<
This part is very easy. Its purpose is to make you get familiar with Gcc and concentrate on real stuffs of the class after it.
>
>
This part is very easy. Its purpose is to make you get familiar with Gcc and concentrate on real stuffs of the class after it. What you need to do is to put the code in cs255.c which part is tagged with Do It Yourself. The code for counting the number of basic blocks and statements statically is already in the file. And the code for counting the number of basic blocks dynamically is there too. Read the existing code is the best way to write your own code. Remember to add #include "cs255-lib.h" in your own testing cases.
 

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding URCS? Send feedback