From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e93f73587e2bc1c3 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!198.186.194.249.MISMATCH!transit3.readnews.com!news-xxxfer.readnews.com!news-out.readnews.com!postnews3.readnews.com!not-for-mail Date: Tue, 27 Jul 2010 18:23:03 -0400 From: "Peter C. Chapin" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.7) Gecko/20100713 Lightning/1.0b2 Thunderbird/3.1.1 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Sharing generic bodies across instantiations. References: <4c4e2d69$0$2378$4d3efbfe@news.sover.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <4c4f5c28$0$2375$4d3efbfe@news.sover.net> Organization: SoVerNet (sover.net) NNTP-Posting-Host: 50291879.news.sover.net X-Trace: DXC=m9Y\RWXb;GBXlC9O1Z7SIBK6_LM2JZB_C7AN`KiBGR^C:WUUlR<856O:0[J3OgibECBTLicR4SE`C X-Complaints-To: abuse@sover.net Xref: g2news1.google.com comp.lang.ada:12618 Date: 2010-07-27T18:23:03-04:00 List-Id: On 2010-07-27 16:06, anon@att.net wrote: > Now as for GNAT it uses the optimization based on the GCC back end > ( -OX where X in 0 .. 4 ). GNAT still preforms a syntactical check of the > Optimize pragma statement, then treat's the statement as a comment like a > number of other built-in Ada pragma statement. Which allows GNAT to > replicate code and let the GCC handle rather its switches to shared or not. > And at this time GCC does not understand the Ada's concept replication > versus the sharing code for optimization. Thanks for all the replies to my question. I want to emphasize that my interest is not so much in what is done by current compilers but rather what is allowed by the standard. Is the standard (even the latest standard) written in such a way as to make a shared implementation of generic bodies possible? It sounds like the answer is yes. In contrast I have the impression that in C++ it is not really possible, or at least not feasible, for a compiler to share template bodies across instantiations. That is, the nature of C++ essentially requires a replication strategy. To be honest I'm not sure why I think this and I might be wrong. This isn't a C++ group so it's probably not appropriate to explore C++'s issues in too much detail here, but I will say that haven't heard any serious talk in the C++ community about implementations sharing template bodies. Peter