OSDN Git Service

* simplify-rtx.c (simplify_relational_operation): Sign extend
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 25 Oct 2000 23:02:14 +0000 (23:02 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 25 Oct 2000 23:02:14 +0000 (23:02 +0000)
        low words before sign extending to high words.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37061 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/simplify-rtx.c

index 1ddc191..67eebfe 100644 (file)
@@ -1,3 +1,8 @@
+2000-10-25  Richard Henderson  <rth@redhat.com>
+
+       * simplify-rtx.c (simplify_relational_operation): Sign extend
+       low words before sign extending to high words.
+
 2000-10-25  Nick Clifton  <nickc@redhat.com>
 
        * config/mcore/mcore.c: Include config.h before system.h.
index 85ce605..648dcb4 100644 (file)
@@ -1812,9 +1812,6 @@ simplify_relational_operation (code, mode, op0, op1)
 
       /* If WIDTH is nonzero and smaller than HOST_BITS_PER_WIDE_INT,
         we have to sign or zero-extend the values.  */
-      if (width != 0 && width <= HOST_BITS_PER_WIDE_INT)
-       h0u = h1u = 0, h0s = HWI_SIGN_EXTEND (l0s), h1s = HWI_SIGN_EXTEND (l1s);
-
       if (width != 0 && width < HOST_BITS_PER_WIDE_INT)
        {
          l0u &= ((HOST_WIDE_INT) 1 << width) - 1;
@@ -1826,6 +1823,8 @@ simplify_relational_operation (code, mode, op0, op1)
          if (l1s & ((HOST_WIDE_INT) 1 << (width - 1)))
            l1s |= ((HOST_WIDE_INT) (-1) << width);
        }
+      if (width != 0 && width <= HOST_BITS_PER_WIDE_INT)
+       h0u = h1u = 0, h0s = HWI_SIGN_EXTEND (l0s), h1s = HWI_SIGN_EXTEND (l1s);
 
       equal = (h0u == h1u && l0u == l1u);
       op0lt = (h0s < h1s || (h0s == h1s && l0u < l1u));