* Richard Henderson: > For the record, I believe we've addressed these issues sometime > within the last year or two. The TYPE_MIN/MAX_VALUE for an enum > should be set to the range truely required by the relevant language > standards (different between C and C++). > > I don't know for a fact that Ada has been adjusted for this though.
>From GIGI (around line 4115 in declc): if ((kind == E_Enumeration_Type && Present (First_Literal (gnat_entity))) || (kind == E_Floating_Point_Type && !Vax_Float (gnat_entity))) { tree gnu_scalar_type = gnu_type; [...] 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.