]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/8794 (optimization improperly eliminates certain expressions)
authorJakub Jelinek <jakub@redhat.com>
Tue, 17 Dec 2002 13:52:38 +0000 (14:52 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 17 Dec 2002 13:52:38 +0000 (14:52 +0100)
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

gcc/ChangeLog
gcc/combine.c
gcc/testsuite/ChangeLog

index 624ff10ef13a11c37a9db445c5c083fb5e89c187..49962b81341d287637c31ac78fa4537dd52a4795 100644 (file)
@@ -1,3 +1,9 @@
+2002-12-17  Jakub Jelinek  <jakub@redhat.com>
+
+       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  <dave@hiauly1.hia.nrc.ca>
 
        * pa.h (BIGGEST_ALIGNMENT): Change 32-bit value to 64 bits.
index 65564d98310df8e30fab2e7839220a8be76d93ca..5e8ad1ac3a28ba0a607e143c637a93bc72a1ca8a 100644 (file)
@@ -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),
index 09d09e28fcaf2c2d5548f901ac2bc90489fccad1..bb479eca3dc095e3275c6efd06bf4497c0e9c5e8 100644 (file)
@@ -1,3 +1,7 @@
+2002-12-17  Jakub Jelinek  <jakub@redhat.com>
+
+       * gcc.c-torture/execute/20021118-3.c: New test.
+
 2002-12-12  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
        * gcc.c-torture/compile/20021212-1.c: New test.