The Verifiable-C manual says
Whatever observable property about a C program you prove using the Verifiable C program logic, that property will actually hold on the assembly-language program that comes out of the C compiler.
and then
The program logic is proved sound with respect to the semantics of CompCert C (...).
What if I use another compiler (say gcc - assuming gcc itself is correct wrt the C standard)?
Does the logic (or clightgen) assumes facts that may not be verified by some C compliant compiler that is not Compcert?
Edit:
I made a little experiment, I compiled the following with gcc and compcert.
#include<stdio.h>
#include<limits.h>
int signed_overflow_expression(int x, int y) {
return (x+y) > y;
}
int main(){
printf("%i",signed_overflow_expression(INT_MAX,1));
}
gcc prints 1 as explained here https://stackoverflow.com/a/54510856/1891138.
Compcert prints 0, because signed overflow is actually defined behaviour in Compcert C (see §6.5 in Compcert manual https://compcert.org/man/manual005.html).
However, VST does require that there are no signed overflows so I cannot prove anything that would be correct for Compcert and not gcc. This means that VST does not exactly model Compcert C but something that is closer from Standard C.
This seems to indicate that indeed I can use gcc, but I wonder if there are other situations where things can go wrong.