[fpc-devel] (patch) An attempt to improve assignments/functionresult reuse

Jonas Maebe jonas.maebe at elis.ugent.be
Sun Dec 16 10:52:40 CET 2007

On 16 Dec 2007, at 10:12, Florian Klaempfl wrote:

> Sergei Gorelkin schrieb:
>> I am not sure that we need the particular DFA from optdfa.pas, but
>> something to reduce conservativeness of escape analysis is definitely
>> needed. Otherwise, temps that are needed for just one particular  
>> case of
>> x:=f(x) are being created almost everywhere.
>> DFA comes from Jonas's advice from one of the first messages:
> When Jonas posted this message first, I didn't understand because I
> thought I read it too quick, but after carefull reading, I still don't
> understand it :) The first paragraph talks about alias analysis while
> the second talks about dfa.

You need the latter to perform the former in a context-sensitive way.  
Context-sensitive means that the outcome of your analysis is tailored  
to a particular point in the procedure, rather than valid in any  
context/at any point in the procedure.

However, you can only do this if you know what has been executed  
before you reached that particular point, and that is where DFA comes  

> Let it consider from a practical point :) Which piece of code makes  
> too
> conservative assumptions? The big if in ncgld.maybechangetemp?

No, it's the big if in tcallnode.maybe_create_funcret_node. The  
conservative/context-insensitive parts are the ti_addr_taken and  
addr_taken checks. These are computed globally for the entire current  
procedure, rather than statement per statement based on which  
statements can have been executed before the current statement is  


More information about the fpc-devel mailing list