In practice on typical 64-bit machines, the
MINIMIZED mode is
reasonably efficient, and can be generally used. It also helps
to ensure compatibility with code imported from some other
compiler to GNAT.
Setting all intermediate overflows checking (
makes sense if you want to
make sure that your code is compatible with any other possible
Ada implementation. This may be useful in ensuring portability
for code that is to be exported to some other compiler than GNAT.
The Ada standard allows the reassociation of expressions at
the same precedence level if no parentheses are present. For
A+B+C parses as though it were
the compiler can reintepret this as
introducing or eliminating an overflow exception. The GNAT
compiler never takes advantage of this freedom, and the
A+B+C will be evaluated as
If you need the other order, you can write the parentheses
A+(B+C) and GNAT will respect this order.
The use of
ELIMINATED mode will cause the compiler to
automatically include an appropriate arbitrary precision
integer arithmetic package. The compiler will make calls
to this package, though only in cases where it cannot be
Long_Long_Integer is sufficient to guard against
intermediate overflows. This package does not use dynamic
alllocation, but it does use the secondary stack, so an
appropriate secondary stack package must be present (this
is always true for standard full Ada, but may require
specific steps for restricted run times such as ZFP).
ELIMINATED mode causes expressions to use arbitrary
precision arithmetic, avoiding overflow, the final result
must be in an appropriate range. This is true even if the
final result is of type
still has the same bounds as its associated constrained
type at run-time.
ELIMINATED mode is only available on target
platforms for which
Long_Long_Integer is 64-bits (nearly all GNAT