No, the language (or, more precisely, GNAT) defines them as 0 and
     2**size - 1.  Otherwise the 'Valid attribute doesn't work.  Necessary
     range checks will be optimized away, too.

No, enumeration types are defined as having precisely the set of
values specifically listed.  In the presence of rep clauses, these may
not even be a contiguous set.

The language doesn't define the concept of a "base type" for enumeration
types, but I think Gigi has to pretend there is such a thing and make
it the full range of the underlying precision.  That would make the
enumeration type a subtype.  The problem is that I think there's code
in the middle-end that assumes that all subtypes are INTEGER_TYPE, so
there's a real mess here about what should be done.

But there's no question that the type directly corresponding to the
Ada type needs the proper bounds: the issue is that we may be able to
promote computations in it into a wider type corresponding to the
"base type" of integers.

Reply via email to