RCC - Reverse C Compiler

Kalyan Perumalla

http://www.cc.gatech.edu/~kalyan

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:

Another relevant publication is the following:

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 http://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 sourcecode, please see the list of pragma directives documented in the technical report mentioned previously.

Other Notes

As of Jun 14, 2001:


Kalyan Perumalla, 14 June 2001
Last updated 14 June 2001