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.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, REPLYTO_WITHOUT_TO_CC 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!news3.google.com!feeder.news-service.com!feeder.erje.net!news.ett.com.ua!not-for-mail From: anon@att.net Newsgroups: comp.lang.ada Subject: Re: Sharing generic bodies across instantiations. Date: Wed, 28 Jul 2010 11:47:39 +0000 (UTC) Organization: ETT newsserver Message-ID: References: <4c4e2d69$0$2378$4d3efbfe@news.sover.net> <4c4f5c28$0$2375$4d3efbfe@news.sover.net> Reply-To: anon@anon.org NNTP-Posting-Host: dialup-4.225.175.227.dial1.dallas1.level3.net X-Complaints-To: usenet@news.ett.com.ua X-Notice: Filtered by postfilter v. 0.6.1 X-Newsreader: IBM NewsReader/2 2.0 Xref: g2news1.google.com comp.lang.ada:12628 Date: 2010-07-28T11:47:39+00:00 List-Id: In <4c4f5c28$0$2375$4d3efbfe@news.sover.net>, "Peter C. Chapin" writes: >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 For any compiler that uses the GCC backend (like GNAT, GCC C/C++) will use replicated for generic routines It's easier for the compiler to handle "oops" programming. And that the way the GCC backend is written.