A compiler bug arises if the behaviour of a compiled concurrent program, as allowed by its architecture memory model, is not a behaviour permitted by the source program under its source model. One might reasonably think that most compiler bugs have been found in the decade since the introduction of the C/C++ memory model. We observe that processor implementations are increasingly exploiting the behaviour of relaxed architecture models. As such, compiled programs may exhibit bugs not seen on older hardware. To account for this we require model-based compiler testing. While this observation is not surprising, its implications are broad. Compilers and their testing tools will need to be updated to follow hardware relaxations, concurrent test generators will need to be improved, and assumptions of prior work will need revisiting. We explore these ideas using a compiler toolchain bug we reported in LLVM.
翻译:如果编译后的并发程序在架构内存模型允许下的行为,不属于源程序在其源模型下允许的行为,则表明存在编译器缺陷。人们可能会合理地认为,自C/C++内存模型引入以来的十年间,大多数编译器缺陷已被发现。我们观察到,处理器实现正日益利用松弛架构模型的行为。因此,编译后的程序可能呈现出旧硬件上未曾出现的缺陷。为应对这一情况,我们需要基于模型的编译器测试。尽管这一观察结果并不令人惊讶,但其影响相当广泛:编译器及其测试工具需要更新以跟随硬件松弛化,并发测试生成器需要改进,先前工作的假设需要重新审视。我们通过在LLVM中报告的一个编译器工具链缺陷来探讨这些观点。