On 20/06/2020 20:50, Yuriy Sydorov wrote: > On 20.06.2020 16:17, Florian Klämpfl wrote: >> Am 20.06.20 um 15:04 schrieb Jonas Maebe: >>> On 20/06/2020 14:59, Yuriy Sydorov wrote: >>>> Maybe implement this in a clean way by adding a new generic >>>> optimization >>>> cs_opt_hiddenpara? >>> >>> Maybe cs_opt_unusedpara. It doesn't have to be limited to hidden >>> parameters. >> >> IMO there is even nothing wrong to have a completely separate switch >> like cs_opt_unusedparentfp. > > I've added the generic cs_opt_unused_para optimization option. > In future, if needed, more fine-grained related options can be introduced.
It broke compiling packages/ide/src/fpcodcmp.pp with the LLVM backend. The issue is when compiling line 234 ("InsertInS(P^.At(I))"). It's trying to load the framepointer parameter there from a register that was never initialised. I think that InsertItemsInS' parentfp got optimised away (because that procedure does not access parent variables/parameters), but it gets loaded anyway due when calling InsertInS because that procedure does need it. It may also be also broken with FPC's code generator, but simply not get detected at compile time. Jonas _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel