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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,be7fa91648ac3f12 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!newsread.com!news-xfer.newsread.com!news-feed01.roc.ny.frontiernet.net!nntp.frontiernet.net!newscon06.news.prodigy.com!prodigy.net!border1.nntp.dca.giganews.com!nntp.giganews.com!cyclone1.gnilink.net!gnilink.net!news-out.ntli.net!newsrout1-gui.ntli.net!ntli.net!newspeer1-win.ntli.net!newsfe6-win.ntli.net.POSTED!53ab2750!not-for-mail From: "Dr. Adrian Wrigley" Subject: Re: Large arrays (again), problem case for GNAT User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.) Message-Id: Newsgroups: comp.lang.ada References: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Date: Thu, 14 Apr 2005 15:39:18 GMT NNTP-Posting-Host: 81.100.88.147 X-Complaints-To: http://www.ntlworld.com/netreport X-Trace: newsfe6-win.ntli.net 1113493158 81.100.88.147 (Thu, 14 Apr 2005 16:39:18 BST) NNTP-Posting-Date: Thu, 14 Apr 2005 16:39:18 BST Organization: ntl Cablemodem News Service Xref: g2news1.google.com comp.lang.ada:10466 Date: 2005-04-14T15:39:18+00:00 List-Id: On Thu, 14 Apr 2005 11:18:22 -0400, Robert A Duff wrote: > The original example that started this thread *did* touch every page; > it's a mystery to me why this didn't work. It *did* work. And it wrote the correct values to the correct addresses (I checked this). This failure at the end was writing into the last element using: Big (Big_T'Last) := 0.0; The reason this fails is that the offset into 'Big' is (incorrectly) calculated at compile time (since Big_T'Last is constant). The calculation is faulty, apparently based on bits offset in a 32-bit signed quantity. This exceeds 2Gbit (silently), and generates code to access 'Big' with a negative offset - which touches unallocated addresses. This analysis is supported by the incorrect calculation of the address of the last value, output a few lines earlier. The work-around for my code at present is to take out the word 'constant' in the declaration of 'Size'. Now works nicely! -- Adrian