From: Jim Wilson Date: Thu, 24 Oct 1996 19:08:23 +0000 (-0700) Subject: (make_range, case PLUS_EXPR): Normalize an unsigned X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5a9d82a6df29af137fb8677853eb9bd65ad147b3;p=gcc.git (make_range, case PLUS_EXPR): Normalize an unsigned range that wraps around 0. From-SVN: r13030 --- 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;