Re: Possible compiler bug with this simple program



On Aug 29, 1:39 pm, Ludovic Brenta <ludo...@xxxxxxxxxxxxxxxxxx> wrote:
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 receivedhttp://bugs.debian.org/497067, BTW.

--
Ludovic Brenta.

Thanks, Ludovic. I'll try these things and report back.

The bug report that you reference is (obviously) from the person who
initially noticed the problem on his 64-bit machine.

In his post he asks for others to try the simple example (which is a
linked tarball from the bug page that you listed) to collect more
evidence that the problem is only on 64-bit machines and not 32-bit
machines.

Here is the tarball link that might work from here:
http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=10;filename=simple_test_case.tar.gz;att=1;bug=497067

Jerry
.



Relevant Pages

  • Re: store contents of structure into an array
    ... Hey, did I get you heated up 'cos I said, "I dont care!". ... of the structure is equal to the size of the array. ... in movies and a war may ensue between the humans and the ... machines and in such a situation humans shall be severly limited by ...
    (comp.lang.c)
  • FileStream problem...
    ... It's a distributed application across a cluster of machines ... from there, the character array is blahblahblah, right? ... Offset and length were out of bounds for the array ...
    (microsoft.public.dotnet.distributed_apps)
  • Re: array indexing... you cant use long ???!
    ... ensure that they get a 32 bit number on older machines. ... believe it would provoke laughter in other quarters. ... Do you really need the entire contents of your database ... to be in memory at one time, and in the form of an array? ...
    (comp.lang.java.programmer)
  • Re: Bug/Gross InEfficiency in HeathFields fgetline program
    ... Without definitions for N, array, and x, I'm left to assume that they all have reasonable definitions. ... As long as N <= INT_MAX, and assuming that array is defined as having at least N elements, and 'x' has a value that can safely be converted to the type of array, I see no way to interpret what I said as endorsing failure of that loop on such machines. ... Unless you specify that int shall be able to address any array. ... size-named types which were added in C99 fundamental types, preferably with a nicer naming convention. ...
    (comp.lang.c)
  • Win32_NetworkAdapterConfiguration Loop through W2K machines
    ... I have knocked up a script to retrieve IP info from an array of machines. ... works fine as long as every machine is Windows 2003 or Windows XP, ...
    (microsoft.public.scripting.vbscript)