SecSIGSecurity Special Interest Group of US MensaCuriosity. Perspective. Security.

Research Library · Idea

CompCert

CompCert is a formally verified C compiler, developed by Xavier Leroy and colleagues and written and proved using the Coq proof assistant. It targets PowerPC, ARM, RISC-V and x86 in 32-bit and 64-bit forms. It is intended for life-critical and mission-critical software and is described as exempt from miscompilation issues. 1

The central theorem is semantic preservation. The executable code the compiler produces is proved to behave as specified by the semantics of the source C program, and each transformation pass in the compiler's core is proved to preserve semantics. 1

The guarantee has limits. The C parsing and type-checking front end is not verified, nor are assembling and linking. The guarantee applies only to whole programs compiled with CompCert, and it is lost when object files are linked with code compiled by gcc. The compiler supports most of ISO C99 but excludes unstructured switch by default, setjmp/longjmp and variable-length arrays. The project page describes performance as decent but not outstanding, at roughly 90% of GCC at -O1 on ARMv8. The page shows signs of recent maintenance. 1

Source · CompCert C (opens in a new tab) · CompCert project (Xavier Leroy)

References

  1. CompCert C (opens in a new tab) · CompCert project (Xavier Leroy) ↩ ↩ ↩

Research articles

See what connects to it on the map of ideas →

See also