[Bug tree-optimization/125385] Expand ((float)a) CMP ((float)b) to use the ranges rather than the just type
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue May 19 23:12:58 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125385
--- Comment #1 from Drea Pinski <pinskia at gcc dot gnu.org> ---
A big hint here is range_fits_type_p.
And we should add a new method to format_helper which returns true if the ssa
fits the real format like there is can_represent_integral_type_p; maybe called
can_represent_integral_value_p.
The method pseducode of the function would be:
irange r = get_range_of (name);
int precision = significand_size (*this);
/* Signed types can allow for one more precision bit. */
if (!TYPE_UNSIGNED (TREE_TYPE (name)))
precision++;
return range_fits_type_p (r, precision, TYPE_SIGNED (TREE_TYPE (name)));
More information about the Gcc-bugs
mailing list