]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
PR exp/1978
authorAndreas Schwab <schwab@linux-m68k.org>
Thu, 11 Aug 2005 13:45:40 +0000 (13:45 +0000)
committerAndreas Schwab <schwab@linux-m68k.org>
Thu, 11 Aug 2005 13:45:40 +0000 (13:45 +0000)
* valarith.c (value_binop): Fix result type for the shift
operators.

gdb/ChangeLog
gdb/valarith.c

index b5d805d1016cee5c0670c94eaf7ad029ce5768b9..637919add066520d140e4d9a292556f6ddcd9576 100644 (file)
@@ -1,3 +1,9 @@
+2005-08-11  Andreas Schwab  <schwab@suse.de>
+
+       PR exp/1978
+       * valarith.c (value_binop): Fix result type for the shift
+       operators.
+
 2005-08-09  Mark Kettenis  <kettenis@gnu.org>
 
        * sparc64obsd-tdep.c: Tweak comments.
index ef03fb9839cfc0afd3d3041f67abb1930238715e..2e1471c3bc464a983f4db2f59f321393c962b7d7 100644 (file)
@@ -883,7 +883,14 @@ value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
          Use the signedness of the operand with the greater length.
          If both operands are of equal length, use unsigned operation
          if one of the operands is unsigned.  */
-      if (promoted_len1 > promoted_len2)
+      if (op == BINOP_RSH || op == BINOP_LSH)
+       {
+         /* In case of the shift operators the type of the result only
+            depends on the type of the left operand.  */
+         unsigned_operation = is_unsigned1;
+         result_len = promoted_len1;
+       }
+      else if (promoted_len1 > promoted_len2)
        {
          unsigned_operation = is_unsigned1;
          result_len = promoted_len1;