https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88274
--- Comment #12 from rguenther at suse dot de <rguenther at suse dot de> --- On Fri, 30 Nov 2018, ebotcazou at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88274 > > --- Comment #11 from Eric Botcazou <ebotcazou at gcc dot gnu.org> --- > > It's the opposite, we need to hide TYPE_MIN/MAX_VALUE to preserve checks in > > Ada, otherwise the optimizer happily removes them. > > To be more explicit: in Ada, you can check at run time whether a value is > valid > for its nominal subtype (i.e. you can check if it's within the range) so you > cannot have the obvious TYPE_MIN/MAX_VALUE on this nominal subtype, otherwise > these checks will be elided by VRP. OK, so we don't have coverage for VRP optimizations on such types from Ada. That leaves us with -fstrict-enums, defaulted to off. I seriously question the value of VRP trying to look at TYPE_MIN/MAX_VALUE then.