> I'm not entirely certain that this is the best way this handles
> get_type_bounds, though it's the best I could think of. This is
> currently a static function that returns the upper and lower bounds of
> an integer type, in mpz_t form -- or, more accurately, what it returns
> are the maximum and minimum representable values for an unsigned integer
> or a two's-complement signed integer using the full bitfield used by the
> type; there is of course no guarantee that these are in fact within the
> legal range of the type. It's used in mpz_to_double_int to determine if
> a value is in range or not; it's also used elsewhere in
> tree-ssa-loop-niter.c. Because of the caveats about it not really
> returning the upper and lower bounds, I don't think it's a useful
> function to export generally, so I simply duplicated it as a static
> function in double-int.c and left the original in tree-ssa-loop-niter.c.
now, this looks wrong to me. I do not really want to argue whether it is
"useful function to export generally", however, obviously you need the
functionality at at least two places. If you prefer, change the name of
the function/improve the comments to reflect your doubts (i.e., that it
does not really return bounds of the type, but rather minimum and
maximum value of the realization of the type), but just cloning the
function whenever you need it somewhere is IMHO not a good idea.