On Thu, Sep 22, 2022 at 05:02:19PM +0200, Aldy Hernandez wrote: > It has always irritated me that we don't have TYPE_MIN_VALUE and > TYPE_MAX_VALUE for floats (and for pointers for that matter). This > means, we have to recalculate it ad-nauseum in vrp_val_min and > vrp_val_max. > > I know we have dconstinf and dconstninf for floats, which we can just > wrap around a TREE_REAL_CST, but it still seems like we should be more > consistent here. If we know the endpoint for a type, we should cache > it in it.
This looks problematic. While for !MODE_HAS_INFINITIES there are clear values, otherwise the flag_finite_math_only flag has Optimization keyword, so it can change between different functions, while a type is a global entity that can be used by both __attribute__((optimize ("Ofast"))) and standard floating point functions. In some sense it is similar to TYPE_MODE which for vectors needs to be actually a function call that decides based on the current function. But then, having it in TYPE_*_VALUE doesn't have the benefits you want from it... Jakub