Enhanced structural analysis for C code reconstruction from IR code

  • Authors:
  • Felix Engel;Rainer Leupers;Gerd Ascheid;Max Ferger;Marcel Beemster

  • Affiliations:
  • RWTH Aachen University, Aachen, Germany;RWTH Aachen University, Aachen, Germany;RWTH Aachen University, Aachen, Germany;ACE Associated Compiler Experts bv., Amsterdam, The Netherlands;ACE Associated Compiler Experts bv., Amsterdam, The Netherlands

  • Venue:
  • Proceedings of the 14th International Workshop on Software and Compilers for Embedded Systems
  • Year:
  • 2011

Quantified Score

Hi-index 0.00

Visualization

Abstract

Modern compilers parse their input, which usually is a high-level programming language, and then convert the resulting parse tree into an intermediate representation (IR). This IR has the important property of being source language and target processor independent, which allows for generalized optimizations. This flexibility, however, also discards some of the high-level properties of the source language. In this paper we present an analysis that can extract most of the control flow structures typically found in the C programming language from a medium level IR. Mirtoc is an implementation of this analysis for the specific case of CCMIR, the IR used in ACE's CoSy® compiler framework. A compiler based on mirtoc is able to emit C code that is well structured, readable by a human and can be compiled by a back end compiler with relatively low overhead. This enables the use of optimizers based on medium level IRs in a source-to-source flow.