Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2009-09

[patch] a tweak to reduce the number of temps

3 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Sergei Gorelkin

Hello,

It looks that I could finally figure out why the hell every type conversion was done involving an intermediate temp.

This happened because node processing order was a bit incorrect. See the attached patch. Since argument of firstpass is passed by reference, freeing the old node before firstpassing the new one actually causes the tree contain an invalid pointer for the duration of firstpassing that new node.

In case of string type conversion, the typeconvn was replaced by a calln, but that calln never optimized its return location because it failed the test "if aktassignmentnode.right=self"; aktassignmentnode.right was still equal to the typeconvn.

The patch has great effect on generated code in general and on low-level RTL stuff in particular.

Regards,
Sergei

Reply by email