[fpc-pascal] why fpc do not use a known return function value

Sven Barth pascaldragon at googlemail.com
Tue Feb 3 14:27:53 CET 2015


Am 03.02.2015 12:13 schrieb "Jonas Maebe" <jonas.maebe at elis.ugent.be>:
>
> On 03/02/15 11:33, misu kun wrote:
> > i mean even if you initilize c with a const value.
>
> That is irrelevant.
>
> > i enabled {$optimization constprop} but nothing changed !
>
> I misread the original assembler code you posted, due to how you phrased
> the subject of your mail. The inline function is actually already
> completely evaluated at compile time (you probably compiled with -O3
> before) and the compiler does use the statically evaluated function
> return value (rather than calling the function).
>
> It's however true that there appear to be a few missing optimizations to
> fold the rest of the address calculation, but those are minor.

But three times the addition of "c" will stay, right? Afterall globals are
considered volatile...

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20150203/abaee591/attachment.html>


More information about the fpc-pascal mailing list