[fpc-devel] question about parameter loading code

Fuxin Zhang zhangfx at lemote.com
Sun Jun 10 17:40:51 CEST 2012

> Dear sirs,
>    C code is something like:
>   addiu sp,sp,-LocalSize
>   sw    fp, 4(sp)
>   move  fp, sp
> in this way, I don't know how to generate parameter references since no
> usable base register to get fixed offset for parameters in
> create_paraloc_info_intern.

Can we use a special virtual register as base here? Then after the stack
size is known, we could replace the base/offset with real fp and offset.

1, At what time can the stack size of a procedure be known/fix?
2, Is there any other access to the para array before gen_load_para_value?

Also for the debug stabs generation, we could mark the symbol need to get
special treating, and handle it when writing it out.
> Could you give some hints?
> Best Regards
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel

More information about the fpc-devel mailing list