ICSE2025

Understanding Compiler Bugs in Real Development

Hao Zhong

被引用 3 次

摘要

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);