diff --git a/gcc/fold-const.c b/gcc/fold-const.c index c0aac0a1f7c..f7c2b8a73f1 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -2551,6 +2551,8 @@ range_test (jcode, type, lo_code, hi_code, var, lo_cst, hi_cst) { utype = unsigned_type (utype); var = convert (utype, var); + lo_cst = convert (utype, lo_cst); + hi_cst = convert (utype, hi_cst); } return fold (convert (type,