Fix mn10200 build failure on redhat 5.0 linux.
authorJim Wilson <wilson@tuliptree.org>
Tue, 3 Nov 1998 20:28:12 +0000 (20:28 +0000)
committerJim Wilson <wilson@tuliptree.org>
Tue, 3 Nov 1998 20:28:12 +0000 (20:28 +0000)
* c-exp.y (parse_number): Check TARGET_LONG_LONG_BIT when setting
high_bit to avoid undefined negative shift.

gdb/ChangeLog
gdb/c-exp.y

index 909f9290da36dcb8b3b0d99b5a5467e9a506e923..07461932277fb4bdb5f99f19771fa52ff8c64370 100644 (file)
@@ -1,3 +1,8 @@
+1998-11-03  Jim Wilson  <wilson@cygnus.com>
+
+       * c-exp.y (parse_number): Check TARGET_LONG_LONG_BIT when setting
+       high_bit to avoid undefined negative shift.
+
 Mon Nov  2 15:26:33 1998  Geoffrey Noer  <noer@cygnus.com>
 
         * configure.in: Check cygwin* instead of cygwin32*.
index a6d21aebdd4531364ae68aa9922cdd103cd3f709..38279f3fc6ffff5e74fa8e227a2cfc4166647ea6 100644 (file)
@@ -1085,10 +1085,14 @@ parse_number (p, len, parsed_float, putithere)
     }
   else
     {
-      high_bit = (((ULONGEST)1)
-                 << (TARGET_LONG_LONG_BIT - 32 - 1)
-                 << 16
-                 << 16);
+      /* Avoid negative shift.  */
+      if (TARGET_LONG_LONG_BIT <= 32)
+       high_bit = ((ULONGEST)1 << TARGET_LONG_LONG_BIT - 1);
+      else
+       high_bit = (((ULONGEST)1)
+                   << (TARGET_LONG_LONG_BIT - 32 - 1)
+                   << 16
+                   << 16);
       if (high_bit == 0)
        /* A long long does not fit in a LONGEST.  */
        high_bit =