[comp.lang.ada] Exceptions and optimization

mark@IPSA.ARPA (Mark Saaltink) (01/21/88)

I am trying to understand section 11.6 of the Ada Reference Manual.
The Ada Issue report AI-00315 (Legal Reorderings of Operations) helps
a bit, but seems to raise at least as many questions as it answers.

Here are two specific questions:

1. Does "propagate" mean "raise again", as suggested by sections 11.4.1(9)
and 11.4.2(8) of the RM, or does it mean "raise other than by a raise
statement", as suggested by 11(2)? Does the meaning of 11.6(7) depend
on which of these interpretations is used? In particular, if
"propagate" were changed to "raise" within 11.6(7), would the meaning of
the paragraph change?

2. AI-00315 has this example:

    a := 0;
    b := 1 / 0;
    a := 1;

along with the claim that the CONSTRAINT_ERROR for division by 0 might
be raised AFTER the execution of 'a := 1'. It is claimed that section 11.6
permits this reordering. The only part of 11.6 that could possibly apply
to this example seems to be paragraph (4). However, I can't see how that
applies in this example, since the proviso of that rule, namely that "an
operation must not be invoked in the alternative order if it is not invoked
in the canonical order", fails in this example (the assignment operation
inherent in 'a := 1' is certainly not invoked in the canonical order).
So I don't see what justifies this reordering.

Can anyone clarify these points for me?

Mark Saaltink (mark@ipsa.arpa)