* Rename remote-es1800.c to remote-es.c
[deliverable/binutils-gdb.git] / gdb / c-exp.y
index f8c87c4967a1c41e8418edb9a0da094fd5fc8575..654bf75c356453652d3804f0bd14f9abb1b70118 100644 (file)
@@ -102,7 +102,6 @@ yyerror PARAMS ((char *));
 %union
   {
     LONGEST lval;
-    unsigned LONGEST ulval;
     struct {
       LONGEST val;
       struct type *type;
@@ -672,6 +671,7 @@ variable:   name_not_typename
                                case LOC_LABEL:
                                case LOC_BLOCK:
                                case LOC_CONST_BYTES:
+                               case LOC_OPTIMIZED_OUT:
 
                                  /* In this case the expression can
                                     be evaluated regardless of what
@@ -1043,9 +1043,18 @@ parse_number (p, len, parsed_float, putithere)
      /* If the number is too big to be an int, or it's got an l suffix
        then it's a long.  Work out if this has to be a long by
        shifting right and and seeing if anything remains, and the
-       target int size is different to the target long size. */
-
-    if ((TARGET_INT_BIT != TARGET_LONG_BIT && (n >> TARGET_INT_BIT)) || long_p)
+       target int size is different to the target long size.
+
+       In the expression below, we could have tested
+               (n >> TARGET_INT_BIT)
+       to see if it was zero,
+       but too many compilers warn about that, when ints and longs
+       are the same size.  So we shift it twice, with fewer bits
+       each time, for the same result.  */
+
+    if (   (TARGET_INT_BIT != TARGET_LONG_BIT 
+            && ((n >> 2) >> (TARGET_INT_BIT-2)))   /* Avoid shift warning */
+        || long_p)
       {
          high_bit = ((unsigned LONGEST)1) << (TARGET_LONG_BIT-1);
         unsigned_type = builtin_type_unsigned_long;
This page took 0.024599 seconds and 4 git commands to generate.