Re: exceptions ( static analysis possible? ) (Bill Leonard)
Sun, 13 Aug 1995 00:48:04 GMT

          From comp.compilers

Related articles
Implementation and Optimization of exceptions ( static analysis possi (Steven D. Majewski) (1995-07-21)
Re: exceptions ( static analysis possible? ) (steve (s.s.) simmons) (1995-07-31)
Re: exceptions ( static analysis possible? ) (1995-08-13)
| List of all articles for this month |

Newsgroups: comp.compilers
From: (Bill Leonard)
Keywords: errors, optimize
Organization: Harris Computer Systems, Ft. Lauderdale FL
References: 95-07-142 95-08-031
Date: Sun, 13 Aug 1995 00:48:04 GMT

"steve (s.s.) simmons" <> writes:
> Certainly, you are right in the case with no optimizations. However,
> Ada's exception blocks do have a subtle. That is, you can't optimize
> across a exception block boundary in Ada when doing any global
> optimizations. It is a subtle, but important issue...

Actually, that's not quite true. There are some optimizations that you
can do.

For instance, you can move the evaluation of an expression outside the
exception block if it cannot raise an exception or if you can delay the
actual generation of the exception until you've entered the block. (The
latter is difficult, but I included it for completeness.)

The standard disallows moving an operation that could raise an exception
from one exception frame to another. But if an operation could not raise
an exception, then it can be moved freely. One additional assistance the
compiler gets from the standard here is that it is allowed to use a type
with a range wider than the type of the operands as long as it gets the
same result. So a compiler can do 32-bit arithmetic, for example, on
16-bit operands to insure that no overflow could occur, and the 32-bit
operations could then be moved outside of an exception block.

Bill Leonard
Harris Computer Systems Corporation
2101 W. Cypress Creek Road
Fort Lauderdale, FL 33309

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.