RCC - Reverse C Compiler

Home
Up
About Me
Research
Projects
Academics
Teaching
Publications
Contests
Personal
Site Map


Introduction

The rcc compiler takes C language program files as input and transforms the input functions, making them reversible. It generates as output both the reversible forms of the input functions as well as their corresponding inverse functions. For example, for each function foo(), it outputs two functions

  1. a function foo() whose body is augmented to make foo() reversible
  2. another function reverse_foo() which serves as an inverse function that undoes the effects of foo().

The source-to-source transformations performed by rcc are documented in the following technical report:

  • "Source-code Transformations for Efficient Reversibility", Kalyan Perumalla, Richard Fujimoto, Technical report GIT-CC-99-21, College of Computing, Georgia Tech, September 1999. Compressed Postscript
Another relevant publication is the following:
  • "Efficient Optimistic Parallel Simulations Using Reverse Computation", Christopher Carothers, Kalyan Perumalla and Richard Fujimoto, Best Paper, ACM/IEEE Workshop on Parallel and Distributed Simulation, 1999.
     
    Expanded version appeared in ACM Transactions on Modeling and Computer Simulation, Vol 9, No 3, July 1999. Postscript (Preprint)

Obtaining RCC

Please send email to kalyan@cc.gatech.edu to obtain a copy of RCC software.

Installing RCC

Change directory to RCC/kalyan-ctree_14/src and type "make". An "rcc" executable will be created in that directory.

Running RCC

Run "rcc infile.c > outfile.c" where infile.c is the input C program file, and outfile.c is the output file in which the transformed program should be placed. Additionally, a log file named infile.log will be generated by rcc recording a description of its actions on the input elements and transformations.

Modifying RCC

Most of the reverse code transformations are concentrated in the file proctree.c, starting with the process_tree() function which is the entry function into the reverse compilation.

The rcc compiler is written using the CTREE package orignally from University of Wisconsin (currently at www.spf-15.com/ctree.html ). CTREE afforded me an opportunity to get quickly started with rcc development, but in retrospect a more sophisticated tool might be better suited for sustained longer term (production version) development.

Optimizations

For specifying optimization parameters in input source-code, please see the list of pragma directives documented in the technical report mentioned previously.

Other Notes

As of Jun 14, 2001:

  • Reversal of some C statements is not yet fully completed. They include: switch, goto and labeled statements, among others.
  • The choice of void for return types of reverse functions is less than ideal.
  • There appears to be a bug that makes rcc fail sometimes when multiple files are given as input on a single command-line -- it is best to run rcc on one file at a time.

Home ] Up ] Next ]
Copyright © Kalyan S. Perumalla.  Last Updated 01/01/2005 02:28 AM -0500.  Disclaimer