From: Jakub Jelinek Date: Tue, 17 Dec 2002 13:52:38 +0000 (+0100) Subject: re PR rtl-optimization/8794 (optimization improperly eliminates certain expressions) X-Git-Tag: releases/gcc-3.2.2~171 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9d164caa08e6d11e68ae8ce761348a99b4a8640;p=thirdparty%2Fgcc.git re PR rtl-optimization/8794 (optimization improperly eliminates certain expressions) PR opt/8794 * combine.c (force_to_mode) [MINUS]: Only replace with (not Y) if all bits in fuller_mask (not just mask) are set in C. * gcc.c-torture/execute/20021118-3.c: New test. From-SVN: r60210 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 624ff10ef13a..49962b81341d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2002-12-17 Jakub Jelinek + + PR opt/8794 + * combine.c (force_to_mode) [MINUS]: Only replace with (not Y) if all + bits in fuller_mask (not just mask) are set in C. + 2002-12-12 John David Anglin * pa.h (BIGGEST_ALIGNMENT): Change 32-bit value to 64 bits. diff --git a/gcc/combine.c b/gcc/combine.c index 65564d98310d..5e8ad1ac3a28 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -6857,10 +6857,10 @@ force_to_mode (x, mode, mask, reg, just_select) return force_to_mode (x, mode, mask, reg, next_select); } - /* Similarly, if C contains every bit in the mask, then we may + /* Similarly, if C contains every bit in the fuller_mask, then we may replace with (not Y). */ if (GET_CODE (XEXP (x, 0)) == CONST_INT - && ((INTVAL (XEXP (x, 0)) | (HOST_WIDE_INT) mask) + && ((INTVAL (XEXP (x, 0)) | (HOST_WIDE_INT) fuller_mask) == INTVAL (XEXP (x, 0)))) { x = simplify_gen_unary (NOT, GET_MODE (x), diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 09d09e28fcaf..bb479eca3dc0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2002-12-17 Jakub Jelinek + + * gcc.c-torture/execute/20021118-3.c: New test. + 2002-12-12 Eric Botcazou * gcc.c-torture/compile/20021212-1.c: New test.