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.
KeywordsSyntax Tree Assembly Code Typical Instruction Branch Instruction Target Machine
Unable to display preview. Download preview PDF.
- 1.GCC Administrator, Using and Porting the GNU Compiler Collection(GCC) (October 2001)Google Scholar
- 2.Nisson, H.-P.: Porting GCC for Dunces (May 2000)Google Scholar
- 3.Peng, L., Liu, Y., Li, Z.: Analysis of Porting GCC for Control Transfer StructureGoogle Scholar
- 4.Ren, S., Zhao, K., Zhao, X.: The Intermediate Language and theBack-End Information Translation in GCC. Computer Engineering and Science 02, 74–82 (1995)Google Scholar
- 5.Stallman, R.: GNU Compiler Collection Internals, http://gcc.gnu.org/onlinedocs/gccint
- 6.Wu, K., Ren, X., Li, R., Li, L.: Study and implementation of porting GCC to Nios. EI Journal of Hunan University(Natural Sciences) 34, 70–73 (2007)Google Scholar
- 7.Yang, Q., Wang, X., Zhai, Y.: Integrated Curriculum Design Of Computer Systems. Tsinghua University Press (October 2008)Google Scholar
- 8.Yang, Q., Li, Z.: Minisys2 Instruction Set Quick Reference (unpublished)Google Scholar
- 9.Zhao, K., Shen, Z.: GCC’s Support to Multi-target Compiler Technology. Computer Engineering and Applications 32, 50–55 (1996)Google Scholar