r/Compilers • u/mttd • 8d ago
Performance of a formally-verified C compiler vs. gcc -O2
https://ut-infraai.github.io/2026/11/13/trying-to-make-compcert-as-fast-as-gcc-o2/
29
Upvotes
r/Compilers • u/mttd • 8d ago
7
u/flatfinger 7d ago
For many tasks, a 28% penalty to limit many actions' side effects to those implied by the underlying platform would seem a cost worth paying. Proving that no individual actions within a program would be capable of violating memory safety invariants unless they have already been violated can be greatly facilitated if the number of individual actions that are capable of violating memory safety invariants is limited. Allowing memory safety to be breached by an otherwise-benign data race, the multiplication of two uint16_t values, or the execution a side-effect-free loop whose exit condition isn't proven to always be satisfiable, complicates such proofs (and in some cases may make them impossible).
2
u/marshaharsha 6d ago
Really cool article. I had never thought of the possibility of not proving a given optimization correct, but proving instead that each individual output program had the same semantics as the input program.