OSDN Git Service

* emit-rtl.c (constant_subword): Also do sign extension in
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 25 Apr 2001 16:14:24 +0000 (16:14 +0000)
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 25 Apr 2001 16:14:24 +0000 (16:14 +0000)
BITS_PER_WORD == 16 case.

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

gcc/ChangeLog
gcc/emit-rtl.c

index 87bac60..c6c57ef 100644 (file)
@@ -1,3 +1,8 @@
+Wed Apr 25 17:09:50 2001  J"orn Rennecke <amylaar@redhat.com>
+
+       * emit-rtl.c (constant_subword): Also do sign extension in
+       BITS_PER_WORD == 16 case.
+
 2001-04-25  Jason Merrill  <jason_merrill@redhat.com>
 
        * loop.c (try_swap_copy_prop): Go back to checking insn.
index 480ff15..6fe21ae 100644 (file)
@@ -1369,7 +1369,7 @@ constant_subword (op, offset, mode)
          val = k[offset >> 1];
          if ((offset & 1) == ! WORDS_BIG_ENDIAN)
            val >>= 16;
-         val &= 0xffff;
+         val = ((val & 0xffff) ^ 0x8000) - 0x8000;
          return GEN_INT (val);
        }
       else
@@ -1448,7 +1448,7 @@ constant_subword (op, offset, mode)
        {
          if ((offset & 1) == ! WORDS_BIG_ENDIAN)
            val >>= 16;
-         val &= 0xffff;
+         val = ((val & 0xffff) ^ 0x8000) - 0x8000;
        }
 
       return GEN_INT (val);