Enriching Compiler Testing with Real Program from Bug Report
Abstract
Differential testing is widely used to detect bugs in compilers. Its basic idea is to compile test programs with different compilers, and compare their compilation results to detect bugs. In this research line, researchers have proposed various approaches to generate test programs. The state-of-the-art approaches can be roughly divided into random-based and mutation-based approaches: random-based approaches generate random programs and mutation-based approaches mutate programs to generate more test programs. Both lines of approaches mainly generate random code, but it is more beneficial to use real programs, since it is easier to learn the impacts of compiler bugs and it becomes reasonable to use both valid and invalid code. However, most real programs from code repositories are ineffective to trigger compiler bugs, partially because they are compiled before they are submitted. In this experience paper, we apply two techniques such as differential testing and code snippet extraction to the specific research domain of compiler testing. Based on our observations on the practice of testing compilers, we identify bug reports of compilers as a new source for compiler testing. To illustrate the benefits of the new source, we implement a tool, called LeRe, that extracts test programs from bug reports and uses differential testing to detect compiler bugs with extracted programs. After we enriched the test programs, we have found 156 unique bugs in the latest versions of gcc and clang. Among them, 103 bugs are confirmed as valid, and 9 bugs are already fixed. Our found bugs contain 59 accept-invalid bugs and 33 reject-valid bugs. In these bugs, compilers wrongly accept invalid programs or reject valid programs. The new source enables us detecting accept-invalid and reject-valid bugs that were usually missed by the prior approaches. The prior approaches seldom report the two types of bugs. Besides our found bugs, we also present our analysis on our invalid bug reports. The results are useful for programmers, when they are switching from one compiler to another, and can provide insights, when researchers apply differential testing to detect bugs in more types of software.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
11 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Validating SMT Solvers via Skeleton Enumeration Empowered by Historical Bug-Triggering Inputs cites History-Driven Test Program Synthesis for JVM Testing
- Compiler Test-Program Generation via Memoized Configuration Search cites A comprehensive study of deep learning compiler bugs
- Compiler Test-Program Generation via Memoized Configuration Search cites History-Driven Test Program Synthesis for JVM Testing
- Compiler Test-Program Generation via Memoized Configuration Search cites SLEMI: equivalence modulo input (EMI) based mutation of CPS models for finding compiler bugs in Simulink
- Compiler Test-Program Generation via Memoized Configuration Search cites Enhanced Compiler Bug Isolation via Memoized Search
- History-Driven Test Program Synthesis for JVM Testing cites A comprehensive study of deep learning compiler bugs
- History-Driven Test Program Synthesis for JVM Testing cites Enhanced Compiler Bug Isolation via Memoized Search
- Clozemaster: Fuzzing Rust Compiler by Harnessing Llms for Infilling Masked Real Programs cites Validating SMT Solvers via Skeleton Enumeration Empowered by Historical Bug-Triggering Inputs
- Clozemaster: Fuzzing Rust Compiler by Harnessing Llms for Infilling Masked Real Programs cites Large Language Models are Edge-Case Generators: Crafting Unusual Programs for Fuzzing Deep Learning Libraries
- Clozemaster: Fuzzing Rust Compiler by Harnessing Llms for Infilling Masked Real Programs cites SLEMI: equivalence modulo input (EMI) based mutation of CPS models for finding compiler bugs in Simulink
- Large Language Models are Edge-Case Generators: Crafting Unusual Programs for Fuzzing Deep Learning Libraries cites History-Driven Test Program Synthesis for JVM Testing
- Large Language Models Can Connect the Dots: Exploring Model Optimization Bugs with Domain Knowledge-Aware Prompts cites A comprehensive study of deep learning compiler bugs
- Large Language Models Can Connect the Dots: Exploring Model Optimization Bugs with Domain Knowledge-Aware Prompts cites Large Language Models are Edge-Case Generators: Crafting Unusual Programs for Fuzzing Deep Learning Libraries
Cited by top-tier papers11
- Large Language Models are Edge-Case Generators: Crafting Unusual Programs for Fuzzing Deep Learning LibrariesYinlin Deng, Chunqiu Steven Xia, Chenyuan Yang, Shizhuo Dylan Zhang et al.ICSE 2024 · 85 citations
- Compiler Test-Program Generation via Memoized Configuration SearchJunjie Chen, Chenyao Suo, Jiajun Jiang, Peiqi Chen et al.ICSE 2023 · 19 citations
- Validating SMT Solvers via Skeleton Enumeration Empowered by Historical Bug-Triggering InputsMaolin Sun, Yibiao Yang, Ming Wen, Yongcong Wang et al.ICSE 2023 · 9 citations
- Large Language Models Can Connect the Dots: Exploring Model Optimization Bugs with Domain Knowledge-Aware PromptsHao Guan, Guangdong Bai, Yepang LiuISSTA 2024 · 8 citations
- Clozemaster: Fuzzing Rust Compiler by Harnessing Llms for Infilling Masked Real ProgramsHongyan Gao, Yibiao Yang, Maolin Sun, Jiangchang Wu et al.ICSE 2025 · 6 citations
Builds on7
- A comprehensive study of deep learning compiler bugsQingchao Shen, Haoyang Ma, Junjie Chen, Yongqiang Tian et al.FSE 2021 · 123 citations
- Probabilistic Delta debuggingGuancheng Wang, Ruobing Shen, Junjie Chen, Yingfei Xiong et al.FSE 2021 · 56 citations
- History-Driven Test Program Synthesis for JVM TestingYingquan Zhao, Zan Wang, Junjie Chen, Mengdi Liu et al.ICSE 2022 · 51 citations
- Enhanced Compiler Bug Isolation via Memoized SearchJunjie Chen, Haoyang Ma, Lingming ZhangASE 2020 · 36 citations
- SLEMI: equivalence modulo input (EMI) based mutation of CPS models for finding compiler bugs in SimulinkShafiul Azam Chowdhury, Sohil Lal Shrestha, Taylor T. Johnson, Christoph CsallnerICSE 2020 · 35 citations
Related papers
- Boosting Compiler Testing by Injecting Real-World CodeShaohua Li, Theodoros Theodoridis, Zhendong SuPLDI 2024 · 24 citations
- CombCT: Compiler Testing via Combinatorial TestingChuan Luo, Shaoke Cui, Jiahao Yan, Junjie Chen et al.ICSE 2026
- Finding Unstable Code via Compiler-Driven Differential TestingShaohua Li, Zhendong SuASPLOS 2023 · 19 citations
- On the Feasibility of Deduplicating Compiler Bugs with BisectionXintong Zhou, Zhenyang Xu, Yongqiang Tian, Chengnian SunISSTA 2026 · 1 citation
- Test-case reduction and deduplication almost for free with transformation-based compiler testingAlastair F. Donaldson, Paul Thomson, Vasyl Teliman, Stefano Milizia et al.PLDI 2021 · 39 citations
