<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Just a thought that I'd chuck in on this... I did wonder how
      practical it would be to store checksums of all compiled
      procedures and the like and to look for collisions.  When studying
      how the compiler is built, I noticed a lot of the internal
      methods, due to conditional defines, would compile into identical
      code, so merging them would reduce the binary size if the linker
      is able to strip out procedures that are never called.  Granted, I
      haven't done research on how Free Pascal does Whole Program
      Optimisation yet, especially as it requiring a separate
      compilation pass has always put me off.  I would have thought that
      the linker should be able to handle it right there and then
      because it has all the information it needs.</p>
    <p>Gareth aka. Kit<br>
    </p>
    <div class="moz-cite-prefix">On 14/07/2019 02:01, Sven Barth via
      fpc-devel wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAFMUeB8o3N-6s6YBmZocZSpzcYnagktmor-zPXO-SSWgrvoWow@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="auto">
        <div>
          <div class="gmail_quote">
            <div dir="ltr" class="gmail_attr">Ben Grasset <<a
                href="mailto:operator97@gmail.com"
                moz-do-not-send="true">operator97@gmail.com</a>>
              schrieb am Sa., 13. Juli 2019, 21:52:<br>
            </div>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div dir="ltr">
                <div dir="ltr">On Sat, Jul 13, 2019 at 3:47 PM Michael
                  Van Canneyt <<a
                    href="mailto:michael@freepascal.org" target="_blank"
                    rel="noreferrer" moz-do-not-send="true">michael@freepascal.org</a>>
                  wrote:<br>
                </div>
                <div class="gmail_quote">
                  <blockquote class="gmail_quote" style="margin:0px 0px
                    0px 0.8ex;border-left:1px solid
                    rgb(204,204,204);padding-left:1ex">
                    No doubt, but this will lead to a bloated binary. I
                    want less code (both<br>
                    source and assembler), not more.<br>
                  </blockquote>
                  <div><br>
                  </div>
                  <div>Well, it would be one instantiation per unique
                    type it was used on. </div>
                </div>
              </div>
            </blockquote>
          </div>
        </div>
        <div dir="auto"><br>
        </div>
        <div dir="auto">Not necessarily. If you have two units that
          don't know about each other that specialize the function with
          the same enum then you'd have two specializations already.</div>
        <div dir="auto"><br>
        </div>
        <div dir="auto">This would need either a WPO pass or COMDAT
          support. Both are on my ToDo list, especially as the former is
          needed if the output format does not support the idea of
          COMDATs (e.g. PE/COFF and ELF do).</div>
        <div dir="auto"><br>
        </div>
        <div dir="auto">Regards, </div>
        <div dir="auto">Sven </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
fpc-devel maillist  -  <a class="moz-txt-link-abbreviated" href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a>
<a class="moz-txt-link-freetext" href="https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel">https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel</a>
</pre>
    </blockquote>
  <div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br />
<table style="border-top: 1px solid #D3D4DE;">
        <tr>
        <td style="width: 55px; padding-top: 13px;"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank"><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" width="46" height="29" style="width: 46px; height: 29px;" /></a></td>
                <td style="width: 470px; padding-top: 12px; color: #41424e; font-size: 13px; font-family: Arial, Helvetica, sans-serif; line-height: 18px;">Virus-free. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank" style="color: #4453ea;">www.avast.com</a>
                </td>
        </tr>
</table><a href="#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"> </a></div></body>
</html>