On Mon, 11 Apr 2011, Eric Botcazou wrote: > > Such types are still there for enumeral type kinds. Also the C family > > frontends leak arithmetic in array TYPE_DOMAIN types. > > The arithmetic needs to be fixed to use the base type instead (i.e. TREE_TYPE > of type, which is guaranteed to be sizetype for TYPE_DOMAIN types). > > > I don't see how we can do this for ENUM types. We use the > > TYPE_MIN/MAX_VALUEs for debug information. > > Like Ada. There is a hook (get_subrange_bounds), see > subrange_type_for_debug_p.
Hm, I see. Nothing I want to change at this moment though - for C and C++ this kind of changes would leak into their internal ASTs :/ > > I tried to assert this for INTEGER_TYPEs only, but as noted above the > > C family leaks TYPE_DOMAIN arithmetic. > > Gigi used to do so as well, now it always uses the base type. Yes, I know - it's good that at least Ada behaves well there now. Is your concern the cost of calling lower/upper_bound_in_type? Richard.