From 5a9d82a6df29af137fb8677853eb9bd65ad147b3 Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Thu, 24 Oct 1996 12:08:23 -0700 Subject: [PATCH] (make_range, case PLUS_EXPR): Normalize an unsigned range that wraps around 0. From-SVN: r13030 --- gcc/fold-const.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gcc/fold-const.c b/gcc/fold-const.c index cb45cd28ee2..9b7fe455539 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -2809,7 +2809,15 @@ make_range (exp, pin_p, plow, phigh) || (n_high != 0 && TREE_OVERFLOW (n_high))) break; - low = n_low, high = n_high; + /* Check for an unsigned range which has wrapped around the maximum + value thus making n_high < n_low, and normalize it. */ + if (n_low && n_high && tree_int_cst_lt (n_high, n_low)) + { + low = n_high, high = n_low; + in_p = ! in_p; + } + else + low = n_low, high = n_high; exp = arg0; continue; -- 2.30.2