comp.lang.ada
 help / color / mirror / Atom feed
From: eachus@mitre-bedford.arpa  (Robert I. Eachus)
Subject: Re: Bug in AdaEd???
Date: 22 Sep 93 22:28:58 GMT	[thread overview]
Message-ID: <EACHUS.93Sep22172858@spectre.mitre.org> (raw)

In article <9309221412.AA02787@ieipisa.iei.pi.cnr.it> mazzanti@iei.pi.cnr.it (F
ranco Mazzanti) writes:

  > Paragraph 11.6(7) deals with predefined operators, but the assignment, or
  > the check to be performed before an assignment are not predefined operators
  > but "basic" operations (see Ref. Man 3.3.1).

    There is a subtle distinction in Ada 83 between predefined
operators and predefined operations.  Predefined operations include
the basic operations, enumeration literals, and the predefined
operators. See 3.3.3 (2) where unfortunately it uses the phrase "the
remaining operations."  (You might also want to look at 8.6(1), or at
the Ada 9X RM 3.2.3, where predefined operation does appear in
italics.)

     But, in any case, in the context of 11.6, if you look at
paragraph 3, you will see the phrase "predefined operations that are
either predefined operators or basic operations other than
assignments."  At first glance this looks like a definition of
predefined operations, but it is really excluding assignments from the
scope of the optimizations in paragraphs 4 and 5.  In other words,
that exclusion is there to prevent reordering of assignments.  But
assignments were intentionally included in the scope of 11.7,
specifically to allow elimination of assignments to dead variables.

     This is why there is no easy fix to the problem.  (Ada 9X has
some fixes, but we still need a new 11.6.)  There is no intent or
desire to require that assignments to dead variables be made, and
therefore any exceptions inherent in the assignment may not occur.
What is needed is a way for a programmer to say "trust me here, you
must make this check."  In Ada 9X it will be definitely be possible to
do this in a portable manner.  Current thinking has gotten as far as
either a pragma OR a local (or maybe statically enclosing) handler for
CONSTRAINT_ERROR will indicate that statements (assignments?) which
potentially raise CONSTRAINT_ERROR should not be optimized away.

     Compiler writers would also like the freedom to make more
optimizations and users would like their programs to run faster.  Of
course no one wants any changes which make existing code incompatible.
All in all a nasty can of worms.
--

					Robert I. Eachus

with Standard_Disclaimer;
use  Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...

             reply	other threads:[~1993-09-22 22:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-09-22 22:28 Robert I. Eachus [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-09-23 20:55 Bug in AdaEd??? Tucker Taft
1993-09-23 18:46 Tucker Taft
1993-09-22 21:07 Robert I. Eachus
1993-09-22 14:22 Norm an H. Cohen
1993-09-22 14:10 cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!howland.reston.ans.net!usc!cs.utexas.edu!not-for-mail
1993-09-22 13:36 cis.ohio-state.edu!news.sei.cmu.edu!firth
1993-09-22 11:45 Wes Groleau x1240 C73-8
1993-09-22  0:21 Robert I. Eachus
1993-09-21  4:19 Gene Ouye
1993-09-07  3:20 Robert Dewar
1993-09-06 14:06 Gene Ouye
replies disabled

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