[fpc-devel] Register allocation question

Sergei Gorelkin sergei_gorelkin at mail.ru
Sat Apr 9 22:22:24 CEST 2011


09.04.2011 23:10, Florian Klämpfl пишет:
>
> Problem is, this might hurt non leaf functions. Maybe the register
> allocators can be initialized differently for leave and non-leave functions?

I understand the concern, but it should be handled somehow already. If we consider a non-leaf 
function that is complex enough to consume all 14 registers, what difference does the order of 
allocation make? When making a call, it must know which registers will be destroyed and which won't, 
otherwise result will be wrong anyway.
What I see confirms what I think: non-leaf functions continue to use rbx, rsi and rdi, not r8..r11.
Must admit I don't understand how it happens: trgobj.preserved_by_proc is nowhere read, 
saved_standard_registers are only encountered in prolog and epilog generation code.

Sergei



More information about the fpc-devel mailing list