[fpc-devel] [Suggestion] Enumeration range-check intrinsic

Sven Barth pascaldragon at googlemail.com
Tue Jul 16 17:10:49 CEST 2019


Michael Van Canneyt <michael at freepascal.org> schrieb am Di., 16. Juli 2019,
16:31:

>
>
> On Tue, 16 Jul 2019, Ben Grasset wrote:
>
> > On Tue, Jul 16, 2019 at 5:28 AM Sven Barth via fpc-devel <
> > fpc-devel at lists.freepascal.org> wrote:
> >
> >> The output will then be two different addresses, thus showing that the
> >> code had been generated twice.
> >>
> >> However the compiler/linker is good at leaving out unused code and in
> this
> >> case only the two Assign specializations are kept as their addresses are
> >> taken, everything else is discarded. If you'd change one of the two to
> >> another non-virtual method then Assign of the one specialization and the
> >> other method of the other specialization would be kept.
> >>
> >> If you use virtual methods inside generics then things are less likely
> to
> >> be removed.
> >>
> >
> > Ah, I understand now.
> >
> > I guess my point overall was that, in my experience at least, while
> there's
> > indeed probably room for improvement in that area via something like WPO
> /
> > COMDAT support / e.t.c. as you'd suggested, the overall effect of
> generics
> > in FPC on binary size is not *unreasonable*.
> >
> > I use Delphi only semi-regularly, but it does seem to be somewhat more of
> > an actual issue there (as frankly binary size in recent Delphis is in
> > general, with generics or not, when compared to FPC.)
>
> I suspect this is also in part due to the liberal and generous use of
> extended RTTI.
>

Correct. We'll have to see how that works out with FPC...

Regards,
Sven

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


More information about the fpc-devel mailing list