comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Why no constraint error?
Date: 1997/03/24
Date: 1997-03-24T00:00:00+00:00	[thread overview]
Message-ID: <E7K3Gw.7KD@world.std.com> (raw)
In-Reply-To: 33369ACC.41C6@magellan.bgm.link.com


In article <33369ACC.41C6@magellan.bgm.link.com>,
Samuel A. Mize <smize@magellan.bgm.link.com> wrote:
>Tucker Taft wrote:
>Sorry -- "pessimizing?"  Could you supply a definition for the
>less experienced?  Do you mean "making less efficient through
>excessive pessimism?"  Thanks.

"To pessimize" is the opposite of "to optimize".  If the compiler goes
out of its way to do something that makes typical programs run slower
(than they otherwise would, whatever that might mean), then that's a
"pessimization".

>> Does GNAT remember that Target might become deinitialized by the
>> assignment, and hence do the check when Target is used as an index?
>
>No.

>> Or does GNAT see that Target is initialized to a valid value, and
>> presume that it never becomes deinitialized.
>
>No.  I tested the array case with a straight uninitialized
>variable, and it indexed to it.  (I used Normalize_Scalars
>to get a predictable value, but I don't *think* this would
>impact the presence/absence of this range check.)

>> I'm curious what approach GNAT adopts, and whether the above
>> would in fact reveal a bug if Target were used as an array index...
>
>No, it doesn't.

I don't understand the above three "No" answers -- they seem mutually
contradictory.  If "A(I) := ..." can overwrite memory that is not part
of the array A, when I is an uninitialized variable, then that's a
compiler bug.  Are you saying that GNAT does, or does not, have this
bug?  (Note that it wasn't a compiler bug in Ada 83 -- in Ada 83, it was
erroneous, whereas in Ada 95, it is a bounded error.)

- Bob




  reply	other threads:[~1997-03-24  0:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-03-20  0:00 Why no constraint error? Samuel Mize
1997-03-20  0:00 ` Samuel Mize
1997-03-21  0:00   ` Robert A Duff
1997-03-22  0:00     ` Tucker Taft
1997-03-22  0:00       ` Robert A Duff
1997-03-24  0:00         ` Tucker Taft
1997-03-24  0:00       ` Samuel A. Mize
1997-03-24  0:00         ` Robert A Duff [this message]
1997-03-24  0:00           ` Robert Dewar
1997-03-24  0:00         ` Robert Dewar
1997-03-22  0:00     ` Robert Dewar
1997-03-22  0:00       ` Robert A Duff
replies disabled

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