Default discriminant problem/GNAT compiler bug?

I am working my way through "Programming with Ada95" by J. Barnes and am

trying to perform the exercises in Chapter 16.2 "Default Discriminants"

using GNAT 2.07.

Barnes defines a polynomial type with a default discriminant that serves

as the size of the array that holds the polynomial coefficients.

type polynomial (N:Index := 0) is

record

A : Integer_Vector(0..N);

end record;

He states that if we make a declaration of

P, Q : polynomial;

without an initial value of a discriminant, then the record is not

constrained and can be changed by assignment.

I tried this but noticed that an assignment of an unconstrained record

CHANGES the values of other local polynomial variables (created either in

a contrained way or uncontrained way).

This does not seem logical. Either

1) I don't understand what I am doing (always possbile!)

2) Barnes is wrong (not likely)

3) there is a bug in the GNAT compiler.

All the essentials are below:

Help!

Michael Bartz

The University of Memphis

-- test program for polynomials

-- Michael Bartz

with poly; use poly;

with text_io; use text_io;

procedure test is

package int_io is new integer_io(integer);

use int_io;

P : Polynomial := (3,(5,0,4,2));

Q : Polynomial := (1,(0,1));

Z : Polynomial;

begin

Z := (4, (5, 5, 5, 5, 5));

put("Z = ");

poly.print(Z);

put("Z.N = "); put(Z.N); new_line;

put("Q = ");

poly.print(Q);

put("P = ");

poly.print(P);

end test;

OUTPUT:

Z = Degree = (4) 5 5 5 5 5

Z.N = 4

Q = Degree = (5) 5 5 5 1 -277148592 3

P = Degree = (3) 5 0 4 2

-- Specs for the polynomial package

-- Michael Bartz

package poly is

subtype Index is Integer range 0..Integer'Last;

type Integer_Vector is array(Index range <>) of Integer;

type polynomial (N:Index := 0) is

record

A : Integer_Vector(0..N);

end record;

procedure print(P : Polynomial);

end poly;

--

Michael Bartz

The University of Memphis