错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Analysis of Assembly Code Similarities of Different C++ Compilers

  • Esra Çelik,
  • Deniz Dal

摘要

A compiler is an important system software responsible for converting high-level programming code into low-level machine code. This process involves a one-to-many relationship in which a single high-level code can produce multiple machine code variations that all share the same functionality. Compilers are able to optimize code to improve runtime performance or reduce memory requirements, depending on specific performance criteria. Today, there are a variety of compilers, each tailored to produce optimized output to meet different requirements and target platforms. MSVC++, CLANG/LLVM, and GCC g++ can be given as examples for well-known C++ compilers. The focus of our study represents a significant contribution to the literature, as it examines for the first time the similarities within assembly code outputs produced by the latest versions of MSVC++, CLANG/LLVM, and GCC g++. This investigation was facilitated by the use of the tool named Measure Of Software Similarity, also known as MOSS in short. The study was conducted in two phases: First, we assembled a set of 24 different C++ benchmarks that included well-defined control structures, data elements, and functions. Then, in the second phase, we generated three different assembly code representations for each benchmark using the corresponding compilers. The result of our analysis showed that across all benchmarks, the highest degree of code similarity was observed between GCC g++ and CLANG/LLVM, while the lowest similarity was observed between GCC g++ and MSVC++. It was also notable that MSVC++ produced a comparatively larger amount of assembly code compared to the other compilers. We anticipate that the research results of this study will help raise awareness of compiler selection and thus improve the quality of code produced for future scientific projects.