@@ -6970,9 +6970,14 @@ tree_fits_shwi_p (const_tree t)
bool
tree_fits_uhwi_p (const_tree t)
{
- return (t != NULL_TREE
- && TREE_CODE (t) == INTEGER_CST
- && wi::fits_uhwi_p (wi::to_widest (t)));
+ if (t == NULL_TREE)
+ return false;
+ if (TREE_CODE (t) != INTEGER_CST)
+ return false;
+ if (TREE_INT_CST_EXT_NUNITS (t) == 1)
+ return TREE_INT_CST_ELT (t, 0) >= 0;
+ return (TREE_INT_CST_EXT_NUNITS (t) == 2
+ && TREE_INT_CST_ELT (t, 1) == 0);
}
/* T is an INTEGER_CST whose numerical value (extended according to