BackSmith: A Systematic Approach to Testing Compiler Backends
Compiler backends are critical for translating high-level code into efficient machine instructions, yet they remain relatively underexplored in compiler testing. Effective backend testing requires programs that expose low-level backend behaviors, but such features are difficult to generate and are frequently eliminated by earlier optimization passes. As a result, existing testing approaches often fail to adequately exercise backend behaviors and are therefore less effective at uncovering backend defects.
We present BackSmith, a black-box approach for testing compiler backends across compilers and architectures. BackSmith generates code snippets with two complementary properties: backend-oriented features that directly stress backend mechanisms such as instruction selection and register allocation, and optimization-resistant features that preserve program diversity by resisting excessive middle-end canonicalization. To further increase coverage of rare but critical backend behaviors, BackSmith also generates code snippets whose compiled assembly rarely arises during random generation. It then integrates all three kinds of features into seed programs for backend testing.
We evaluated BackSmith on 16 mature GCC and LLVM backends. Over five months of testing, BackSmith uncovered 104 previously unknown backend bugs, 88 of which have been confirmed or fixed, demonstrating the effectiveness of our approach in systematically exposing backend defects.
Mon 5 OctDisplayed time zone: Pacific Time (US & Canada) change
13:30 - 15:00 | Testing Compilers and SolversOOPSLA at Junior Ballroom 3&4 Chair(s): Harrison Goldstein University at Buffalo | ||
13:30 18mTalk | BackSmith: A Systematic Approach to Testing Compiler Backends OOPSLA Hongyu Chen Nanjing University, Yu Wang Nanjing University, Jianhua Zhao Nanjing University, Ke Wang Nanjing University DOI | ||
14:06 18mTalk | Seeking Evidence of Further Optimization: Detecting Missed Optimizations through Compiler’s Native Analyses OOPSLA Yi Zhang Nanjing University, Yu Wang Nanjing University, Ke Wang Nanjing University, Linzhang Wang Nanjing University DOI | ||
14:24 18mTalk | Validating Optimizing SMT Solvers via Cross-Theory Approximation OOPSLA Maolin Sun Nanjing University, Fuqi Jia Institute of Software at Chinese Academy of Sciences; University of Chinese Academy of Sciences, Yibiao Yang Nanjing University, Yuming Zhou Nanjing University DOI | ||