* Richard Henderson: > On Fri, Aug 05, 2005 at 10:15:04PM +0200, Florian Weimer wrote: >> TYPE_MIN_VALUE (gnu_scalar_type) >> = gnat_to_gnu (Type_Low_Bound (gnat_entity)); >> TYPE_MAX_VALUE (gnu_scalar_type) >> = gnat_to_gnu (Type_High_Bound (gnat_entity)); >> >> This is wrong (as discussed before) and is likely the cause of PR21573 >> (not VRP-related, the expanders for SWITCH_EXPR look at these >> attributes, too). I'm not sure if it is safe to delete these >> assignment statmeents because TYPE_MIN_VALUE/TYPE_MAX_VALUE are used >> quite extensively throught GIGI. > > Well, perhaps yes, perhaps no. What I don't know is if it is > actively illegal to assign 0 to an enumeration that doesn't > contain 0 as a member.
Illegal from which viewpoint? Language definition or GCC optimizers? > It's clear that if it is in fact illegal, that the Ada front > end has to use some other type than the enumeration to validate > the values going into the enumeration. In the Ada case, all the necessary compile-time checks should be performed by the front end anyway.