Modeling Dynamic (De)Allocations of Local Memory for Translation Validation

📅 2024-03-08
🏛️ Proc. ACM Program. Lang.
📈 Citations: 1
Influential: 0
📄 PDF

career value

207K/year
🤖 AI Summary
End-to-end compiler translation verification faces semantic consistency challenges due to dynamically allocated local memory—including `alloca`, variable-length arrays, and address-escaping variables—whose runtime behavior is difficult to model precisely. Method: We propose the first execution model and refinement relation supporting *all* forms of dynamic local memory allocation. Our approach defines a precise operational semantics that faithfully models address-taking operations, formal parameters, variadic arguments, and procedure calls, and soundly reduces the verification problem to first-order logic formulas decidable by SMT solvers. Contribution/Results: This work establishes the first rigorous semantic modeling and automated verification framework for address-observable dynamic stack memory. Within a black-box program verification setting, we successfully verify semantic equivalence between over 100 lines of C code—featuring complex loops, vectorization optimizations, and variadic functions—and their corresponding assembly implementations. Our method significantly extends the practical scope of translation validation.

Technology Category

Application Category

📝 Abstract
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.
Problem

Research questions and friction points this paper is trying to address.

Validating compiler-generated code with dynamic local memory allocations
Modeling complex memory constructs including arrays and address-taken variables
Converting refinement checks to SMT-solvable first-order logic queries
Innovation

Methods, ideas, or system contributions that make the work stand out.

Modeling dynamic memory allocation and deallocation for validation
Converting refinement checks into first-order logic queries
Validating C procedures against optimized assembly code
🔎 Similar Papers
No similar papers found.