Institute for Communication Technologies and Embedded Systems

Enhanced structural analysis for C code reconstruction from IR code

Authors:
Engel, F. ,  Leupers, R.Ascheid, G. ,  Ferger, M. ,  Beemster, M.
Book Title:
14th International Workshop on Software and Compilers for Embedded Systems
Publisher:
ACM
Series:
SCOPES '11
Pages:
p.p. 21--27
Address:
New York, NY, USA
Date:
Jun. 2011
ISBN:
978-1-45030-763-5
DOI:
10.1145/1988932.1988936
Language:
English
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.
Download:
BibTeX