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,e5a3abec221df39 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news1.google.com!news3.google.com!feeder.news-service.com!feeder4.cambrium.nl!feed.tweaknews.nl!posting.tweaknews.nl!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Possible compiler bug with this simple program References: <1edc3682-855f-405b-8348-72b423377b1a@i20g2000prf.googlegroups.com> <891f5fdc-195e-47a3-a269-04d1d9234b97@m3g2000hsc.googlegroups.com> Date: Fri, 29 Aug 2008 22:39:56 +0200 Message-ID: <87y72fr1wj.fsf@ludovic-brenta.org> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:+DHoAdKzcVQ8q9ZTimV7C28649g= MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Organization: Tele2 X-Trace: DXC=JRX_3XHLDCPcK50ZlXRB2V6`Y6aWje^YZ4Lah2Z00FOYHfAm5UI]M3PhCln0WR]Y`U>n5 Jerry writes: > On Aug 28, 12:56 am, Ludovic Brenta > wrote: >> I cannot test your program now but it seems to me that perhaps you >> should specify the alignment of the arrays and Long_Floats. Also, it >> might be a good idea to double-check that on the Intel Core 2, the >> long floats are really 64 bits and not 80 bits wide. It could be that >> the compiler got that wrong but I doubt it. >> > And that would look something like this? > > for Long_Float'Alignment use 64; > for Real_Vector'Alignment use ???; Yes. In addition, these might help: for Real_Vector'Component_Size use 64; for Real_Vector'Alignment use 64; pragma Pack (Real_Vector); I'm actually puzzled as to why the program appears to work on 32-bit platforms. I would expect a Storage_Error when accessing X (0) since, per your declaration, X'First = Integer'First = -2**31, so X (0) is probably way past the end of the array. The first thing I would try is using Natural instead of Integer as the array index subtype. If that fails, try specifying the 'Alignment and 'Component_Size. If that still fails, look at the assembly code emitted on amd64. I just received http://bugs.debian.org/497067, BTW. -- Ludovic Brenta.