<s>
In	O
computing	O
,	O
compiler	B-Application
correctness	I-Application
is	O
the	O
branch	O
of	O
computer	O
science	O
that	O
deals	O
with	O
trying	O
to	O
show	O
that	O
a	O
compiler	B-Language
behaves	O
according	O
to	O
its	O
language	O
specification	O
.	O
</s>
<s>
Techniques	O
include	O
developing	O
the	O
compiler	B-Language
using	O
formal	B-Architecture
methods	I-Architecture
and	O
using	O
rigorous	O
testing	O
(	O
often	O
called	O
compiler	B-Language
validation	O
)	O
on	O
an	O
existing	O
compiler	B-Language
.	O
</s>
<s>
Two	O
main	O
formal	O
verification	O
approaches	O
for	O
establishing	O
correctness	O
of	O
compilation	B-Language
are	O
proving	O
correctness	O
of	O
the	O
compiler	B-Language
for	O
all	O
inputs	O
and	O
proving	O
correctness	O
of	O
a	O
compilation	B-Language
of	O
a	O
particular	O
program	O
(	O
translation	O
validation	O
)	O
.	O
</s>
<s>
Compiler	B-Language
validation	O
with	O
formal	B-Architecture
methods	I-Architecture
involves	O
a	O
long	O
chain	O
of	O
formal	O
,	O
deductive	O
logic	O
.	O
</s>
<s>
However	O
,	O
since	O
the	O
tool	O
to	O
find	O
the	O
proof	O
(	O
theorem	B-Application
prover	I-Application
)	O
is	O
implemented	O
in	O
software	O
and	O
is	O
complex	O
,	O
there	O
is	O
a	O
high	O
probability	O
it	O
will	O
contain	O
errors	O
.	O
</s>
<s>
A	O
prominent	O
example	O
of	O
this	O
approach	O
is	O
CompCert	B-Application
,	O
which	O
is	O
a	O
formally	O
verified	O
optimizing	O
compiler	B-Language
of	O
a	O
large	O
subset	O
of	O
C99	B-Language
.	O
</s>
<s>
Another	O
verified	O
compiler	B-Language
was	O
developed	O
in	O
CakeML	O
project	O
,	O
</s>
<s>
which	O
establishes	O
correctness	O
of	O
a	O
substantial	O
subset	O
of	O
Standard	B-Language
ML	I-Language
programming	O
language	O
using	O
the	O
HOL	O
(	O
proof	O
assistant	O
)	O
.	O
</s>
<s>
Another	O
approach	O
to	O
obtain	O
a	O
formally	O
correct	O
compiler	B-Language
is	O
to	O
use	O
semantics-directed	O
compiler	B-Language
generation	O
.	O
</s>
<s>
aims	O
to	O
automatically	O
establish	O
that	O
a	O
given	O
input	O
program	O
is	O
compiled	B-Language
correctly	O
.	O
</s>
<s>
Proving	O
correct	O
compilation	B-Language
of	O
a	O
given	O
program	O
is	O
potentially	O
easier	O
than	O
proving	O
a	O
compiler	B-Language
correct	O
for	O
all	O
programs	O
,	O
but	O
still	O
requires	O
symbolic	O
reasoning	O
,	O
because	O
a	O
fixed	O
program	O
may	O
still	O
work	O
on	O
arbitrarily	O
large	O
inputs	O
and	O
run	O
for	O
arbitrarily	O
long	O
amount	O
of	O
time	O
.	O
</s>
<s>
Translation	O
validation	O
can	O
reuse	O
an	O
existing	O
compiler	B-Language
implementation	O
by	O
generating	O
,	O
for	O
a	O
given	O
compilation	B-Language
,	O
a	O
proof	O
that	O
the	O
compilation	B-Language
was	O
correct	O
.	O
</s>
<s>
Translation	O
validation	O
can	O
be	O
used	O
even	O
with	O
a	O
compiler	B-Language
that	O
sometimes	O
generates	O
incorrect	O
code	O
,	O
as	O
long	O
as	O
this	O
incorrect	O
does	O
not	O
manifest	O
itself	O
for	O
a	O
given	O
program	O
.	O
</s>
<s>
However	O
,	O
if	O
translation	O
validation	O
succeeds	O
,	O
then	O
the	O
compiled	B-Language
program	O
is	O
guaranteed	O
to	O
be	O
correct	O
for	O
all	O
inputs	O
.	O
</s>
<s>
Testing	O
represents	O
a	O
significant	O
portion	O
of	O
the	O
effort	O
in	O
shipping	O
a	O
compiler	B-Language
,	O
but	O
receives	O
comparatively	O
little	O
coverage	O
in	O
the	O
standard	O
literature	O
.	O
</s>
<s>
The	O
1986	O
edition	O
of	O
Aho	O
,	O
Sethi	O
,	O
&	O
Ullman	O
has	O
a	O
single-page	O
section	O
on	O
compiler	B-Language
testing	O
,	O
with	O
no	O
named	O
examples	O
.	O
</s>
<s>
The	O
2006	O
edition	O
omits	O
the	O
section	O
on	O
testing	O
,	O
but	O
does	O
emphasize	O
its	O
importance	O
:	O
“	O
Optimizing	O
compilers	B-Language
are	O
so	O
difficult	O
to	O
get	O
right	O
that	O
we	O
dare	O
say	O
that	O
no	O
optimizing	O
compiler	B-Language
is	O
completely	O
error-free	O
!	O
</s>
<s>
A	O
number	O
of	O
articles	O
confirm	O
that	O
many	O
released	O
compilers	B-Language
have	O
significant	O
code-correctness	O
bugs	O
.	O
</s>
<s>
Sheridan	O
2007	O
is	O
probably	O
the	O
most	O
recent	O
journal	O
article	O
on	O
general	O
compiler	B-Language
testing	O
.	O
</s>
<s>
For	O
most	O
purposes	O
,	O
the	O
largest	O
body	O
of	O
information	O
available	O
on	O
compiler	B-Language
testing	O
are	O
the	O
Fortran	O
and	O
Cobol	O
validation	O
suites	O
.	O
</s>
<s>
Further	O
common	O
techniques	O
when	O
testing	O
compilers	B-Language
are	O
fuzzing	O
(	O
which	O
generates	O
random	O
programs	O
to	O
try	O
to	O
find	O
bugs	O
in	O
a	O
compiler	B-Language
)	O
and	O
test	O
case	O
reduction	O
(	O
which	O
tries	O
to	O
minimize	O
a	O
found	O
test	O
case	O
to	O
make	O
it	O
easier	O
to	O
understand	O
)	O
.	O
</s>
