Re: [fpc-devel] Optimizing unused return values of inline functions

2017-08-20 Thread Michael Van Canneyt
On Sun, 20 Aug 2017, Benito van der Zander wrote: Hi, why does fpc not remove the calculation of the return value of inline functions, when the return value is unused? For example type TUtility = class function doSomething: TUtility; inline; end; It is a popular pattern to add result :

[fpc-devel] Optimizing unused return values of inline functions

2017-08-20 Thread Benito van der Zander
Hi, why does fpc not remove the calculation of the return value of inline functions, when the return value is unused? For example type TUtility = class function doSomething: TUtility; inline; end; function TUtility.dosomething: TUtility; begin writeln(); result := self; end; adds a