Re: [fpc-devel] fpc trunk / parentfp for debugger / missing
On June 21, 2020 00:34:01 Jonas Maebe wrote: 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 I'll take a look at this tomorrow. Thanks for reporting. Yuriy. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Re: [fpc-devel] fpc trunk / parentfp for debugger / missing
On June 20, 2020 23:22:13 Florian Klämpfl wrote: Am 20.06.20 um 22:02 schrieb Karoly Balogh (Charlie/SGR): Hi, On Sat, 20 Jun 2020, Yuriy Sydorov wrote: I've added the generic cs_opt_unused_para optimization option. In future, if needed, more fine-grained related options can be introduced. So now the parentfp optimization is enabled for -O2 and higher. Yuriy, your changes seem to have broken ppdump.pp. For all platforms. I have fixed it. Thank you. I haven't been aware that optimization options are stored in ppu and ppudump need to be updated. Yuriy. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Re: [fpc-devel] fpc trunk / parentfp for debugger / missing
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
Re: [fpc-devel] fpc trunk / parentfp for debugger / missing
Am 20.06.20 um 22:02 schrieb Karoly Balogh (Charlie/SGR): Hi, On Sat, 20 Jun 2020, Yuriy Sydorov wrote: I've added the generic cs_opt_unused_para optimization option. In future, if needed, more fine-grained related options can be introduced. So now the parentfp optimization is enabled for -O2 and higher. Yuriy, your changes seem to have broken ppdump.pp. For all platforms. I have fixed it. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Re: [fpc-devel] fpc trunk / parentfp for debugger / missing
Hi, On Sat, 20 Jun 2020, Yuriy Sydorov wrote: > I've added the generic cs_opt_unused_para optimization option. > In future, if needed, more fine-grained related options can be introduced. > > So now the parentfp optimization is enabled for -O2 and higher. Yuriy, your changes seem to have broken ppdump.pp. For all platforms. Charlie ___ fpc-devel maillist - fpc-devel@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Re: [fpc-devel] fpc trunk / parentfp for debugger / missing
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. So now the parentfp optimization is enabled for -O2 and higher. Yuriy. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
[fpc-devel] HEADS UP: fixes updated to 3.2.1
Now FPC 3.2.0 has been released, the version of the fixes branch has been updated to 3.2.1. If you maintain scripts to compile/install the fixes branch, they might need adjustment ___ fpc-devel maillist - fpc-devel@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Re: [fpc-devel] fpc trunk / parentfp for debugger / missing
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. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Re: [fpc-devel] fpc trunk / parentfp for debugger / missing
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. > Enable it for -O2. It may be used in future to optimize unused $self. Yes. Jonas ___ fpc-devel maillist - fpc-devel@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Re: [fpc-devel] fpc trunk / parentfp for debugger / missing
On 20.06.2020 15:49, Jonas Maebe wrote: On 20/06/2020 14:31, Yuriy Sydorov wrote: On 20.06.2020 14:38, Jonas Maebe wrote: On 20/06/2020 13:15, Yuriy Sydorov wrote: On 20.06.2020 2:04, Martin wrote: I just updated to fpc trunk 45658 It seems sometime in the last 3 or 4 month a change was made that leads to "parentfp" being optimized away. Even with -O- or -O1 (many users do O1 for debugging) I've turned off optimization of parentfp when -O- in r45661. Maybe it can be tied to the -Oostackframe optimisation setting. Some CPU targets - jvm at least - doesn't support cs_opt_stackframe, but the parentfp optimization applies for any CPU target. At first sight, the only thing that needs to be done to "support" cs_opt_stackframe for the JVM target is to always set pi_has_stackparameter there. Yes, but currently it is not supported. :) The parentfp optimization need to be tied to some generic optimization. cs_opt_remove_empty_proc looks good for this. That feels rather unrelated to me. cs_opt_stackframe also is only vaguely related to the parentfp optimization. Maybe implement this in a clean way by adding a new generic optimization cs_opt_hiddenpara? Enable it for -O2. It may be used in future to optimize unused $self. Yuriy. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Re: [fpc-devel] fpc trunk / parentfp for debugger / missing
On 20/06/2020 14:31, Yuriy Sydorov wrote: > On 20.06.2020 14:38, Jonas Maebe wrote: >> On 20/06/2020 13:15, Yuriy Sydorov wrote: >>> On 20.06.2020 2:04, Martin wrote: I just updated to fpc trunk 45658 It seems sometime in the last 3 or 4 month a change was made that leads to "parentfp" being optimized away. Even with -O- or -O1 (many users do O1 for debugging) >>> >>> I've turned off optimization of parentfp when -O- in r45661. >> >> Maybe it can be tied to the -Oostackframe optimisation setting. > > Some CPU targets - jvm at least - doesn't support cs_opt_stackframe, but > the parentfp optimization applies for any CPU target. At first sight, the only thing that needs to be done to "support" cs_opt_stackframe for the JVM target is to always set pi_has_stackparameter there. > The parentfp optimization need to be tied to some generic optimization. > cs_opt_remove_empty_proc looks good for this. That feels rather unrelated to me. Jonas ___ fpc-devel maillist - fpc-devel@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Re: [fpc-devel] fpc trunk / parentfp for debugger / missing
On 20.06.2020 14:38, Jonas Maebe wrote: On 20/06/2020 13:15, Yuriy Sydorov wrote: On 20.06.2020 2:04, Martin wrote: I just updated to fpc trunk 45658 It seems sometime in the last 3 or 4 month a change was made that leads to "parentfp" being optimized away. Even with -O- or -O1 (many users do O1 for debugging) I've turned off optimization of parentfp when -O- in r45661. Maybe it can be tied to the -Oostackframe optimisation setting. Some CPU targets - jvm at least - doesn't support cs_opt_stackframe, but the parentfp optimization applies for any CPU target. The parentfp optimization need to be tied to some generic optimization. cs_opt_remove_empty_proc looks good for this. Yuriy. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Re: [fpc-devel] fpc trunk / parentfp for debugger / missing
On 20/06/2020 13:15, Yuriy Sydorov wrote: > On 20.06.2020 2:04, Martin wrote: >> I just updated to fpc trunk 45658 >> >> It seems sometime in the last 3 or 4 month a change was made that >> leads to "parentfp" being optimized away. >> Even with -O- or -O1 (many users do O1 for debugging) > > I've turned off optimization of parentfp when -O- in r45661. Maybe it can be tied to the -Oostackframe optimisation setting. Jonas ___ fpc-devel maillist - fpc-devel@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Re: [fpc-devel] fpc trunk / parentfp for debugger / missing
On 20.06.2020 2:04, Martin wrote: I just updated to fpc trunk 45658 It seems sometime in the last 3 or 4 month a change was made that leads to "parentfp" being optimized away. Even with -O- or -O1 (many users do O1 for debugging) I've turned off optimization of parentfp when -O- in r45661. Yuriy. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
[fpc-devel] FPC 3.2.0 released!
Hello, Finally, the Free Pascal 3.2.0 release is available from our servers and from sourceforge. Changes that may break backwards compatibility will be documented at: http://wiki.freepascal.org/User_Changes_3.2.0. For an overview of what is new see https://wiki.freepascal.org/FPC_New_Features_3.2 The website has been update for the major targets and work is still being done for the rest. All downloads are available at the main FTP server and sourceforge. https://sourceforge.net/projects/freepascal/files/ ftp://ftp.freepascal.org/pub/fpc/dist/3.2.0/ Enjoy! The Free Pascal Compiler Team ___ fpc-devel maillist - fpc-devel@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel