GNAT 4.0 strange behaviour
"jimmaureenrogers@worldnet.att.net" <jimmaureenrogers@worldnet.att.net> writes:
It certainly _changes_ (well, I'm pretty sure it did, but I've been
playing around for a little while, so maybe I got confused ...). As it
does if you add
A_I := 0;
before James's 'part 1' (prints all 0's), or if you change
optimisation level (-O2 gave
0 1 1 1 0 1 1 0 0 1 1 1 0 1 1 0 0 1 1 0 1 1 1 0 0 1 1 1 0 1 1 0 0 1 1 0 1 1 1 0 0 1 1 1 0 1 1 0 0 1 1 0 1 1 1 0 0 1 1 0 1 1 1 0
). This is 4.0.0 on powerpc-apple-darwin7.9.0.
I think if it was a size problem, there would have been a compilation
error with
type Bitboard is array (0 .. 63) of Bit;
pragma Pack (Bitboard);
for Bitboard'Size use 64;
or come to that with
for Bit'Size use 1;
(remember that Natural'Size is 31).
Looks like a bug. To report bugs, go to http://gcc.gnu.org, there are
links at the bottom on the left.
As a general rule, using overlays like this is not something to be
done casually, Ada.Unchecked_Conversion is usually better. That said,
I've not seen overlays give this sort of problem before.
|