Research and Development of Compiler Based on GCC

Open-source GCC compiler has the advantage of high-level optimization ability and portability. Aiming at specific target platform, this paper carried out practical research and development of compiler based on GCC. Through analysis and research, this paper presented a thought: taking the analysis of RTL code as main direction to study RTL generation mechanisms and RTL code matching principles, which helps to understand the overall architecture of GCC and retargeting mechanisms of GCC. Through GCC porting practice, methods to modify the machine description for some typical instructions were presented. In the end, the generated compiler was tested by a basic C program to verify its correctness. This paper has guiding significance and reference value for understanding of compilers, GCC research, porting and optimization.