Understanding Compiler Bugs in Real Development
Hao Zhong
Abstract
Compilers are critical in development, but compiler bugs can cause hidden and serious bugs in their compiled code. To deepen the understanding of compiler bugs, in the prior empirical studies, researchers read the bug reports and patches of compilers, and analyze their causes, locations, and patterns. Although they derive many interesting findings, their studies are limited. First, as bug reports seldom explain which projects encounter compiler bugs, it is infeasible to understand the outreaching impact. Second, before compiler bugs are fixed, programmers can bypass such bugs. The bug reports of compilers do not introduce such workarounds. Finally, the distribution of compiler bugs can be distorted, since researchers and compiler developers also file bug reports. In this paper, we propose a novel angle to analyze compiler bugs. Instead of compiler bug reports, we collect compiler bugs that are mentioned in real development. When programmers encounter compiler bugs in real development, they can leave traces in their commit messages. By searching such messages, we collected 644 unique commits whose messages explicitly mention the urls of compiler bugs. From this angle, in this paper, we conduct the first empirical study to analyze compiler bugs in the wild. We summarize our results into seven useful findings for users, compiler developers, and researchers. For example, for researchers, we find that some large workarounds of compiler bugs involve repetitive and systematic changes, which indicates a new research opportunity for code migration tools. Furthermore, we attempt to apply our findings in real development, and we obtain positive feedback. 1return _mm_set_epi32( * (int * )__P, (int)0,(int)0,(int)0); 2 + return _mm_set_epi32(0, 0, 0, ( * (__m32_u * )__P)[0]); google / XNNPACK Public Commit Work around _mm_loadu_si32 broken on latest gcc See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99754 for details master (#3149) Mar* authored and xnnpack-bot committed on Jun 15, 2022 1 parent 56ddd07 commit b627348 Code Issues 15 Pull requests 39 Actions Security Insights Browse files 216 src/amalgam/avx.c Large diffs are not rendered by default. 224 src/amalgam/avx2.c Large diffs are not rendered by default. 8 src/amalgam/avx512skx.c 3511 3511 const __m512i vbias = _mm512_load_si512(params->avx512.bias); 3512 3512 const __m512i va_multiplier = _mm512_load_si512(params->avx512.a_multiplier); 3513 3513 const __m512i vb_multiplier = _mm512_load_si512(params->avx512.b_multiplier); 3514 const __m128i vshift = _mm_loadu_si32(params->avx512.shift); -3514 const __m128i vshift = _mm_load_si128((const __m128i*) params->avx512.shift); + Load diff Load diff Showing 343 changed files with 10,063 additions and 10,063 deletions. Split Unified (a) a commit of XNNPACK 1 src/amalgam/avx2.c 2 @@ -3231,19 +3231,19 ... 3 -...= _mm_loadu_si32(w); 4 +...= _mm_cvtsi32_si128(((const int * ) w)[0]); 5 src/amalgam/avx512skx.c 6 @@ -3511,7 +3511,7 ... 7 -...= _mm_loadu_si32(params->avx512.shift); 8 +...= _mm_load_si128((const __m128i * ) params->avx512.shift);
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext def1cd5c-480d-46b8-9f85-e86bb3ea8410Builds on7
- A comprehensive study of deep learning compiler bugsQingchao Shen, Haoyang Ma, Junjie Chen, Yongqiang Tian et al.FSE 2021 · 123 citations
- UniSan: Proactive Kernel Memory Initialization to Eliminate Data LeakagesKangjie Lu, Chengyu Song, Taesoo Kim, Wenke LeeCCS 2016 · 81 citations
- Enhanced Compiler Bug Isolation via Memoized SearchJunjie Chen, Haoyang Ma, Lingming ZhangASE 2020 · 36 citations
- Enriching Compiler Testing with Real Program from Bug ReportHao ZhongASE 2022 · 24 citations
- Compiler Test-Program Generation via Memoized Configuration SearchJunjie Chen, Chenyao Suo, Jiajun Jiang, Peiqi Chen et al.ICSE 2023 · 19 citations
Related papers
- Silent Bugs Matter: A Study of Compiler-Introduced Security BugsJianhao Xu, Kangjie Lu, Zhengjie Du, Zhu Ding et al.USENIX Security 2023
- Well-typed programs can go wrong: a study of typing-related bugs in JVM compilersStefanos Chaliasos, Thodoris Sotiropoulos, Georgios-Petros Drosos, Charalambos Mitropoulos et al.OOPSLA 2021 · 31 citations
- FLUX: Finding Bugs with LLVM IR Based Unit Test CrossoversEric Liu, Shengjie Xu, David LieASE 2023 · 8 citations
- CombCT: Compiler Testing via Combinatorial TestingChuan Luo, Shaoke Cui, Jiahao Yan, Junjie Chen et al.ICSE 2026
- On the Feasibility of Deduplicating Compiler Bugs with BisectionXintong Zhou, Zhenyang Xu, Yongqiang Tian, Chengnian SunISSTA 2026 · 1 citation
