[fpc-devel] Pure function development

Jonas Maebe jonas at freepascal.org
Thu Apr 30 11:48:01 CEST 2020

On 30/04/2020 07:24, Sven Barth via fpc-devel wrote:
> Well, Jonas is right that if you have a node tree that only has constant
> nodes as inputs the tnode.simplify method should (in theory) be able to
> completely collapse that (under the assumption that this is also handled
> by call nodes and such).

Simplify by itself cannot do that, but simplify + constant propagation
can (once constant propagation gets extended). There is no reason why it
should not be able to handle out-parameters, and it can already collapse
entire (simple) functions into a single assignment of a constant to a
function result (when combined with -Oodeadstore).

I cannot think of a single reason why a particular
propagation/simplification/emulation/... feature should not be supported
by constant propagation, but should be supported when evaluating pure


More information about the fpc-devel mailing list