From: Richard Kenner Date: Mon, 26 Apr 1993 23:12:11 +0000 (-0400) Subject: (fold): Signedness matters for comparisons and right shifts. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b8a914304da6ad15c03f90850858f97969809e95;p=gcc.git (fold): Signedness matters for comparisons and right shifts. From-SVN: r4243 --- diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 43995c60a0b..5845489d256 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -3040,8 +3040,17 @@ fold (expr) if (op == 0) continue; /* Valid for CALL_EXPR, at least. */ - /* Strip any conversions that don't change the mode. */ - STRIP_NOPS (op); + if (kind == '<' || code == RSHIFT_EXPR) + { + /* Signedness matters here. Perhaps we can refine this + later. */ + STRIP_TYPE_NOPS (op); + } + else + { + /* Strip any conversions that don't change the mode. */ + STRIP_NOPS (op); + } if (TREE_CODE (op) == COMPLEX_CST) subop = TREE_REALPART (op);