comp.lang.ada
 help / color / mirror / Atom feed
From: Ludovic Brenta <ludovic@ludovic-brenta.org>
Subject: Re: Possible compiler bug with this simple program
Date: Fri, 29 Aug 2008 22:39:56 +0200
Date: 2008-08-29T22:39:56+02:00	[thread overview]
Message-ID: <87y72fr1wj.fsf@ludovic-brenta.org> (raw)
In-Reply-To: ef981f3e-ab01-4238-9b0e-f8516ee16922@b30g2000prf.googlegroups.com

Jerry writes:
> On Aug 28, 12:56 am, Ludovic Brenta <ludo...@ludovic-brenta.org>
> 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.



  reply	other threads:[~2008-08-29 20:39 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-28  7:28 Possible compiler bug with this simple program Jerry
2008-08-28  7:56 ` Ludovic Brenta
2008-08-28 21:08   ` Jerry
2008-08-29 20:39     ` Ludovic Brenta [this message]
2008-08-29 21:20       ` Jerry
2008-08-29 21:31         ` Jerry
2008-09-02 22:10     ` Santiago Urueña
2008-08-28  8:03 ` Niklas Holsti
2008-08-28 15:54   ` Adam Beneschan
2008-08-28 15:56     ` Adam Beneschan
2008-08-28 21:01   ` Randy Brukardt
2008-08-28 21:29     ` Jerry
2008-08-30  1:00       ` Randy Brukardt
2008-08-30  4:47         ` Jerry
2008-09-01 11:19           ` Jerry
2008-09-03  4:22             ` Jerry
2008-09-03 14:20               ` Adam Beneschan
2008-09-04  0:22                 ` Jerry
2008-09-04  1:18                   ` Adam Beneschan
2008-09-04  3:53                     ` Randy Brukardt
2008-09-04  1:31                   ` Jeffrey R. Carter
2008-09-04 14:35                     ` Adam Beneschan
2008-09-04 14:42                       ` Jacob Sparre Andersen
2008-09-06  3:03                       ` Jerry
2008-09-05  8:17                     ` Ludovic Brenta
2008-09-05 15:56                       ` Adam Beneschan
2008-09-05 17:09                       ` Jeffrey R. Carter
2008-09-04 20:49                   ` Simon Wright
2008-08-28 21:16 ` Jerry
2008-08-29  7:41   ` Niklas Holsti
2008-08-30  0:50     ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox