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.7 required=5.0 tests=BAYES_00,MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,cbd507df3efa824b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-01-30 10:40:08 PST Path: supernews.google.com!sn-xit-02!sn-xit-04!supernews.com!xfer13.netnews.com!netnews.com!newspeer1.nac.net!news.maxwell.syr.edu!nntp2.deja.com!nnrp1.deja.com!not-for-mail From: Robert Dewar Newsgroups: comp.lang.ada Subject: Re: Help with Atomic_Components and whole array assignment Date: Tue, 30 Jan 2001 18:26:20 GMT Organization: Deja.com Message-ID: <9570vu$fv0$1@nnrp1.deja.com> References: <94h55t$9a1$1@nnrp1.deja.com> <94hml1$o64$1@nnrp1.deja.com> <94hno6$p8s$1@nnrp1.deja.com> <3A76E455.AABF2490@averstar.com> NNTP-Posting-Host: 205.232.38.14 X-Article-Creation-Date: Tue Jan 30 18:26:20 2001 GMT X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; U) X-Http-Proxy: 1.0 x62.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 X-MyDeja-Info: XMYDJUIDrobert_dewar Xref: supernews.google.com comp.lang.ada:4719 Date: 2001-01-30T18:26:20+00:00 List-Id: In article <3A76E455.AABF2490@averstar.com>, Tucker Taft wrote: > I don't agree with Robert on this. Have you tried writing it > as a loop rather than an aggregate assignment. I suspect > that all Ada compilers would use separate assignments, > including GNAT. True enough > In any case, I believe they should use separate assignments. Yes, this article of faith has been discussed in a previous message but I see nothing in the RM to justify this statement. > > Package Machine_Code here we come... > > This is not necessarily the right conclusion in my view. > Most device drivers are written without dropping into machine > code these days. Ada of all languages should not change > that. If specific instructions are required (as is often the case with device drivers), then there is nothing in the C, or Ada (or any other) standard that guarantees that a particular instruction will be generated. If you are counting on this, and it just happens that your compiler let's you get away with it, you are writing implementation dependendent bogus code, and I think this should be avoided. The GNU/Linux kernel had endless problems from assumptions of this kind, and finally they have all been replaced by machine language insertions, to avoid the problems. What happened in this case is that new improved and correct gcc compilers blew the kernel out of the water by breaking these undocumented assumptions. The same can happen to you if you follow Tuck's advice. Note that even from what Tuck claims, he specifically notes that nothing in the RM requires a particular instruction to be used. So for example, if you have a word variable, and you read it and copy it somewhere else, there is nothing to stop the compiler from using a floating-point instruction for the purpose, even if what you want and need is an integer load. Sent via Deja.com http://www.deja.com/