From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,113cbde0422b98e8 X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Why no constraint error? Date: 1997/03/24 Message-ID: #1/1 X-Deja-AN: 227991958 References: <33369ACC.41C6@magellan.bgm.link.com> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 1997-03-24T00:00:00+00:00 List-Id: In article <33369ACC.41C6@magellan.bgm.link.com>, Samuel A. Mize 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