From: Richard Guenther Date: Tue, 17 Aug 2010 09:50:12 +0000 (+0000) Subject: fold-const.c (fold_comparison): Strip nops inside POINTER_PLUS_EXPR. X-Git-Tag: releases/gcc-4.6.0~4974 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=743ad76e9e7e6481b1b1764d4e5654158565deff;p=thirdparty%2Fgcc.git fold-const.c (fold_comparison): Strip nops inside POINTER_PLUS_EXPR. 2010-08-17 Richard Guenther * fold-const.c (fold_comparison): Strip nops inside POINTER_PLUS_EXPR. From-SVN: r163298 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e6f43ed6d788..f46429ee208d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2010-08-17 Richard Guenther + + * fold-const.c (fold_comparison): Strip nops inside + POINTER_PLUS_EXPR. + 2010-08-17 Shujing Zhao PR c/40563 diff --git a/gcc/fold-const.c b/gcc/fold-const.c index d63411ea89aa..02ddac57da44 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -8683,6 +8683,7 @@ fold_comparison (location_t loc, enum tree_code code, tree type, else if (TREE_CODE (arg0) == POINTER_PLUS_EXPR) { base0 = TREE_OPERAND (arg0, 0); + STRIP_SIGN_NOPS (base0); if (TREE_CODE (base0) == ADDR_EXPR) { base0 = TREE_OPERAND (base0, 0); @@ -8705,6 +8706,7 @@ fold_comparison (location_t loc, enum tree_code code, tree type, else if (TREE_CODE (arg1) == POINTER_PLUS_EXPR) { base1 = TREE_OPERAND (arg1, 0); + STRIP_SIGN_NOPS (base1); if (TREE_CODE (base1) == ADDR_EXPR) { base1 = TREE_OPERAND (base1, 0);