https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78750
--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
The following should fix it.
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 20515e7..08bf148 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -3025,7 +3025,8 @@ get_size_range (tree exp, tree range[2])
return true;
}
- if (TREE_CODE (exp) == SSA_NAME)
+ tree type = TREE_TYPE (exp);
+ if (TREE_CODE (exp) == SSA_NAME && INTEGRAL_TYPE_P (type))
{
wide_int min, max;
enum value_range_type range_type = get_range_info (exp, &min, &max);
@@ -3033,8 +3034,8 @@ get_size_range (tree exp, tree range[2])
if (range_type == VR_RANGE)
{
/* Interpret the bound in the variable's type. */
- range[0] = wide_int_to_tree (TREE_TYPE (exp), min);
- range[1] = wide_int_to_tree (TREE_TYPE (exp), max);
+ range[0] = wide_int_to_tree (type, min);
+ range[1] = wide_int_to_tree (type, max);
return true;
}
else if (range_type == VR_ANTI_RANGE)