- /* Compute the minimum and maximum values for the type.
-
- [dcl.enum]
-
- For an enumeration where emin is the smallest enumerator and emax
- is the largest, the values of the enumeration are the values of the
- underlying type in the range bmin to bmax, where bmin and bmax are,
- respectively, the smallest and largest values of the smallest bit-
- field that can store emin and emax. */
-
- /* The middle-end currently assumes that types with TYPE_PRECISION
- narrower than their underlying type are suitably zero or sign
- extended to fill their mode. Similarly, it assumes that the front
- end assures that a value of a particular type must be within
- TYPE_MIN_VALUE and TYPE_MAX_VALUE.
-
- We used to set these fields based on bmin and bmax, but that led
- to invalid assumptions like optimizing away bounds checking. So
- now we just set the TYPE_PRECISION, TYPE_MIN_VALUE, and
- TYPE_MAX_VALUE to the values for the mode above and only restrict
- the ENUM_UNDERLYING_TYPE for the benefit of diagnostics. */
+ /* Set the underlying type of the enumeration type to the
+ computed enumeration type, restricted to the enumerator
+ values. */