Re: Stack based-Register Based

Martin.Ward@durham.ac.uk (Martin Ward)
4 Feb 2001 22:12:53 -0500

          From comp.compilers

Related articles
[3 earlier articles]
Re: Stack based-Register Based roedy@mindprod.com (Roedy Green) (2001-01-26)
Re: Stack based-Register Based peter_flass@yahoo.com (2001-01-26)
Re: Stack based-Register Based andrewb@votehere.net (Andrew Berg) (2001-01-28)
Re: Stack based-Register Based rog@vitanuova.com (2001-02-01)
Re: Stack based-Register Based ucapjab@ucl.ac.uk (Jonathan Barker) (2001-02-01)
Re: Stack based-Register Based rpw3@rigden.engr.sgi.com (2001-02-04)
Re: Stack based-Register Based Martin.Ward@durham.ac.uk (2001-02-04)
Re: Stack based-Register Based anton@mips.complang.tuwien.ac.at (2001-02-04)
Re: Stack based-Register Based anton@mips.complang.tuwien.ac.at (2001-02-04)
Re: Stack based-Register Based joachim_d@gmx.de (Joachim Durchholz) (2001-02-15)
Re: Stack based-Register Based joachim_d@gmx.de (Joachim Durchholz) (2001-02-25)
Re: Stack based-Register Based joachim_d@gmx.de (Joachim Durchholz) (2001-02-25)
Re: Stack based-Register Based henry@spsystems.net (2001-02-25)
[1 later articles]
| List of all articles for this month |

From: Martin.Ward@durham.ac.uk (Martin Ward)
Newsgroups: comp.compilers
Date: 4 Feb 2001 22:12:53 -0500
Organization: Compilers Central
Keywords: optimize, theory
Posted-Date: 04 Feb 2001 22:12:53 EST

"Jonathan Barker" <ucapjab@ucl.ac.uk> writes:
> However, I don't know that provably optimal (or even associative)
> optimisers exist.


There is a proof that an optimal optimiser doesn't exist.


Given any finite optimising compiler, C(x), there must be some
program P which does not halt, but for which C(P) is not ABORT.
(If C(P) = "ABORT" for every halting program P then you have solved
the Halting Problem!)


Then the new compiler:


C'(x) == IF x = P THEN RETURN("ABORT") ELSE C(x) FI


optimises better than C(x) on program P, and just as well as C(x)
on every other program.


Therefore C(x) is not optimal.


This is known as the "Full Employment Theorem for Compiler Writers":
for any optimising compiler there exists a better one.


I am sure you are all glad to know that :-)


Martin


Martin.Ward@durham.ac.uk http://www.dur.ac.uk/martin.ward/ Erdos number: 4
G.K.Chesterton web site: http://www.dur.ac.uk/martin.ward/gkc/


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.