面向翻译验证的局部内存动态(解除)分配建模
Modeling Dynamic (De)Allocations of Local Memory for Translation Validation
AI总结:
针对含动态局部内存分配的 C 到汇编编译,提出执行模型、精化定义及基于 SMT 的验证算法,并在百行级过程上完成黑盒翻译验证。
摘要:
端到端翻译验证是指在单次编译中,根据相应的输入源代码来验证编译器生成的可执行代码的问题。在存在动态分配的局部内存(其地址可能被程序观察到)时,这一问题变得尤为困难。在验证 C 过程到可执行代码的翻译这一背景下,验证器需要处理定长局部数组、被取地址的局部变量、被取地址的形式参数、变长局部数组、过程调用参数(包括可变参数)以及 alloca() 运算符。我们提供了一种执行模型、一种精化定义,以及一种可可靠地将精化检查转换为一阶逻辑查询的算法,这些查询可由现成的 SMT 求解器高效处理。在实验中,我们对包含上述局部内存分配构造、规模达 100 多行 SLOC 的 C 过程,与其由具备复杂循环和向量化变换的优化编译器生成的、规模达 200 多条指令的相应汇编实现之间,进行了黑盒翻译验证。
英文摘要:
End-to-End Translation Validation is the problem of verifying the executable code generated by a compiler against the corresponding input source code for a single compilation. This becomes particularly hard in the presence of dynamically-allocated local memory where addresses of local memory may be observed by the program. In the context of validating the translation of a C procedure to executable code, a validator needs to tackle constant-length local arrays, address-taken local variables, address-taken formal parameters, variable-length local arrays, procedure-call arguments (including variadic arguments), and the alloca() operator. We provide an execution model, a definition of refinement, and an algorithm to soundly convert a refinement check into first-order logic queries that an off-the-shelf SMT solver can handle efficiently. In our experiments, we perform blackbox translation validation of C procedures (with up to 100+ SLOC), involving these local memory allocation constructs, against their corresponding assembly implementations (with up to 200+ instructions) generated by an optimizing compiler with complex loop and vectorizing transformations.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。