• GCC;
  • compiler;
  • RTL;
  • machine description


GCC (GNU Compiler Collection) is a popular compiler because it is open source, generates high-quality code, and is portable. The emergence of various embedded systems has led to considerable interest in the portability of GCC. For GCC, a source programming language is parsed and internally transferred to the corresponding intermediate representation, RTL (Register Transfer Language). A machine description (MD)file, which describes the mapping relationships between RTL and the corresponding target assembly instructions, is provided at the stage of code generation. Therefore, GCC retargeting requires the construction of a target MD file. However, it is difficult for developers to understand and construct the MD because this requires considerable time spent studying the GCC intermediate representation and the strategy of code generation. In this paper, we propose a systematic methodology to help developers in retargeting GCC. The entire process is divided into seven levels according to the features of the supported source programming language. Based on this systematic methodology, a Web-based assistance tool is also developed to guide developers through the retargeting. The assistance tool operates like a wizard to provide developers with the necessary procedures at each level and then generates the corresponding GCC files. Finally, we demonstrate the utility and practicality of the assistance tool based on the proposed methodology by applying it to the retargeting of GCC to a 32-bit embedded processor—the helper function unit of the UniCore VisoMT processor, as developed by the System-on-Chips (SoC) Research Center of National Chung Cheng University, Taiwan. Copyright © 2011 John Wiley & Sons, Ltd.