paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Understanding GCC builtins to develop better tools

理解 GCC 内建函数以开发更好的工具
FSE Proceedings of the 2019 27th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering2019匹配度 3/10 · 论文是 PL/编译器工具支持的经验研究,关注 GCC builtin 使用与工具实现缺陷,与静态分析、LLM/Agent、浮点程序分析及贝叶斯程序分析均无直接交叉;仅对理解工具实现缺陷和形式化验证工具有间接参考。引用 0 inbox
Manuel Rigger, Stefan Marr, Bram Adams, Hanspeter Mössenböck
crossref: 2026-09-12

AI 速览

一句话:通过分析 4,913 个 C 项目的 GCC builtin 使用与演化,量化工具所需支持并揭示现有工具的实现缺陷。

许多工具需要支持 C 编译器内建函数(builtins)才能处理流行项目,但维护者缺乏关于实现哪些 builtins 的指导。本文对 GitHub 上 4,913 个 C 项目的 builtin 使用进行大规模实证研究,分析其使用分布与随时间演化,并对现有工具的支持情况进行系统测试。结果表明,37% 的项目依赖至少一个 builtin;支持 30% 项目只需 10 个 builtins,支持 90% 项目约需 110 个 builtins,成本适中。多数项目随时间不断新增 builtins,说明其并非遗留特性。工具测试发现许多工具部分或完全缺乏 builtin 支持,且若干工具存在错误实现,甚至包括经形式验证的 CompCert 编译器。

问题
工具开发者缺乏指导,不确定是否以及应实现哪些 GCC builtins 来支持流行 C 项目,导致工具支持不完整或存在错误。
方法
对 GitHub 上 4,913 个 C 项目的 builtin 使用进行大规模实证分析,统计使用比例、覆盖所需 builtin 数量及项目层面的时间演化,并对现有工具进行 builtin 支持的系统测试。
评估
37% 的项目至少使用一个 builtin;10 个 builtin 覆盖超 30% 项目,约 110 个覆盖 90%;多数项目持续新增 builtin;测试发现许多工具缺乏支持且存在错误实现,包括 CompCert。
原文摘要(Abstract)

C programs can use compiler builtins to provide functionality that the C language lacks. On Linux, GCC provides several thousands of builtins that are also supported by other mature compilers, such as Clang and ICC. Maintainers of other tools lack guidance on whether and which builtins should be implemented to support popular projects. To assist tool developers who want to support GCC builtins, we analyzed builtin use in 4,913 C projects from GitHub. We found that 37% of these projects relied on at least one builtin. Supporting an increasing proportion of projects requires support of an exponentially increasing number of builtins; however, implementing only 10 builtins already covers over 30% of the projects. Since we found that many builtins in our corpus remained unused, the effort needed to support 90% of the projects is moderate, requiring about 110 builtins to be implemented. For each project, we analyzed the evolution of builtin use over time and found that the majority of projects mostly added builtins. This suggests that builtins are not a legacy feature and must be supported in future tools. Systematic testing of builtin support in existing tools revealed that many lacked support for builtins either partially or completely; we also discovered incorrect implementations in various tools, including the formally verified CompCert compiler.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot5163,
  title = {Understanding GCC builtins to develop better tools},
  author = {Manuel Rigger and Stefan Marr and Bram Adams and Hanspeter Mössenböck},
  booktitle = {FSE},
  year = {2019},
  doi = {10.1145/3338906.3338907}
}