[fpc-devel] Little feature teaser

Sven Barth pascaldragon at googlemail.com
Sat Aug 3 09:36:19 CEST 2013

Am 02.08.2013 23:26 schrieb "Florian Klämpfl" <florian at freepascal.org>:
> Am 02.08.2013 17:46, schrieb Sven Barth:
> > - using an array declared as a ranged array (array[0..2] of LongInt) the
> > for-loop is inlined and optimized a bit (especially depending on the
> > optimization settings), but the compiler does not yet fold the loop...
> >
> At least I fixed loop unrolling for for-in loops.

Cool! I'll need to test that with my test code :)

Now we "only" need need support for open arrays in inline functions...
(yes, I've read the comment near the hint, that's why the "only" is in
quotes ;) )

And regarding that: open arrays can only be with a "const" and none
modifier, right? (and maybe "constref"?) So couldn't we just create a temp
of the passed array that looks exactly like when we pass it to a function
with open array argument? (at least in those cases where we pass e.g. an
array range) This way we wouldn't need to adjust the array indices in the
inlined function and would at least get rid of the call...

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20130803/50923e2e/attachment.html>

More information about the fpc-devel mailing list