On Tue, 2006-02-28 at 12:06 +0100, Eric Botcazou wrote: > [Sorry for the delay] No worries.
> I was actually referring to explicit constraints on TYPE_MAX_VALUE and > TYPE_MIN_VALUE derived from TYPE_PRECISION and TYPE_UNSIGNED, for example > that ceil(log2(TYPE_MAX_VALUE - TYPE_MIN_VALUE)) must be greater or equal to > TYPE_PRECISION. OK. > > I suspect we get this behavior from the Ada front-end as a > > side effect of the language and possibly the need to do > > runtime bounds checking on object values. But that's no > > excuse for a front-end to lie about the bounds of an object. > > I don't think the Ada front-end lies about the bounds of types, but it does > virtually use the whole spectrum of TYPE_PRECISION, TYPE_MAX_VALUE and > TYPE_MIN_VALUE settings, unlike the C-family of front-ends. > > This problem was already raised when Diego contributed the VRP pass and Diego > ajusted it to cope with Ada. AFAIK Ada and VRP work fine on the 4.1 branch. And IMHO the work-arond in VRP is a hack around this braindamage. Basically with the way Ada's setting of TYPE_MIN_VALUE/TYPE_MAX_VALUE effectively makes them useless as we can not rely on them to actually reflect the set of values allowed in an object. jeff