Performance of Compiler-Assisted Memory Safety Checking
• SEI Report
Publisher
Software Engineering Institute
CMU/SEI Report Number
CMU/SEI-2014-TN-014DOI (Digital Object Identifier)
10.1184/R1/6581987.v1Topic or Tag
Abstract
Buffer overflows affect a large installed base of C code. This technical note describes the criteria for deploying a compiler-based memory safety checking tool and the performance that can be achieved with two such tools whose source code is freely available. The note then describes a modification to the LLVM compiler to enable hoisting bounds checks from loops and functions. This proof-of-concept prototype has been used to demonstrate how these optimizations can be performed reliably on bounds checks to improve their performance. However, the performance of bounds propagation is the dominant cost, and the overall runtime cost for bounds checking for C remains expensive, even after these optimizations are applied. Nevertheless, optimized bounds checks are adequate for non-performance-critical applications, and improvements in processor technology may allow optimized bounds checking to be used with performance-critical applications.
Cite This SEI Report
Keaton, D., & Seacord, R. (2014, July 31). Performance of Compiler-Assisted Memory Safety Checking. (SEI Report CMU/SEI-2014-TN-014). Retrieved August 8, 2026, from https://doi.org/10.1184/R1/6581987.v1.
@techreport{keaton_2014,
author={Keaton, David and Seacord, Robert},
title={Performance of Compiler-Assisted Memory Safety Checking},
month={Jul},
year={2014},
number={{CMU/SEI-2014-TN-014},
institution={Software Engineering Institute, Carnegie Mellon University},
doi={10.1184/R1/6581987.v1},
url={https://doi.org/10.1184/R1/6581987.v1},
note={Accessed: 2026-Aug-8}
}
Keaton, David, and Robert Seacord. "Performance of Compiler-Assisted Memory Safety Checking." (CMU/SEI-2014-TN-014). Software Engineering Institute, Carnegie Mellon University. Software Engineering Institute, July 31, 2014. https://doi.org/10.1184/R1/6581987.v1.
D. Keaton, and R. Seacord, "Performance of Compiler-Assisted Memory Safety Checking," Software Engineering Institute, Carnegie Mellon University. Software Engineering Institute, SEI Report CMU/SEI-2014-TN-014, 31-Jul-2014 [Online]. Available: https://doi.org/10.1184/R1/6581987.v1. [Accessed: 8-Aug-2026].
Keaton, David, and Robert Seacord. "Performance of Compiler-Assisted Memory Safety Checking." (SEI Report CMU/SEI-2014-TN-014). Software Engineering Institute, Carnegie Mellon University, Software Engineering Institute, 31 Jul. 2014. https://doi.org/10.1184/R1/6581987.v1. Accessed 8 Aug. 2026.
Keaton, David; & Seacord, Robert. Performance of Compiler-Assisted Memory Safety Checking. CMU/SEI-2014-TN-014. Software Engineering Institute. 2014. DOI: 10.1184/R1/6581987.v1. https://doi.org/10.1184/R1/6581987.v1