Correctly check gcc version.
[deliverable/binutils-gdb.git] / gas / expr.c
index e2e64991e466fea1e09813927cfb69a5e5d19d51..851a406e018096743c544605d12297c4c360bf92 100644 (file)
@@ -1,5 +1,5 @@
 /* expr.c -operands, expressions-
-   Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999
+   Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -833,25 +833,6 @@ operand (expressionP)
              integer_constant (0, expressionP);
              break;
            }
-          if (NUMBERS_WITH_SUFFIX)
-            {
-              /* Check for a binary constant.  */
-              for (s = input_line_pointer; *s == '0' || *s == '1'; s++)
-                ;
-              if (toupper (*s) == 'B')
-                {
-                  integer_constant (0, expressionP);
-                  break;
-                }
-              /* Check for an octal constant.  */
-              for (s = input_line_pointer; *s >= '0' && *s <= '7'; s++)
-                ;
-              if (toupper (*s) == 'Q')
-                {
-                  integer_constant (0, expressionP);
-                  break;
-                }
-            }
         }
       c = *input_line_pointer;
       switch (c)
@@ -895,7 +876,7 @@ operand (expressionP)
          break;
 
        case 'b':
-         if (LOCAL_LABELS_FB && ! flag_m68k_mri && ! NUMBERS_WITH_SUFFIX)
+         if (LOCAL_LABELS_FB && ! (flag_m68k_mri || NUMBERS_WITH_SUFFIX))
            {
              /* This code used to check for '+' and '-' here, and, in
                 some conditions, fall through to call
@@ -917,7 +898,7 @@ operand (expressionP)
          /* Fall through.  */
        case 'B':
          input_line_pointer++;
-         if (flag_m68k_mri)
+         if (flag_m68k_mri || NUMBERS_WITH_SUFFIX)
            goto default_case;
          integer_constant (2, expressionP);
          break;
@@ -930,7 +911,9 @@ operand (expressionP)
        case '5':
        case '6':
        case '7':
-         integer_constant (flag_m68k_mri ? 0 : 8, expressionP);
+         integer_constant ((flag_m68k_mri || NUMBERS_WITH_SUFFIX)
+                            ? 0 : 8, 
+                            expressionP);
          break;
 
        case 'f':
@@ -940,7 +923,8 @@ operand (expressionP)
                 number, make it one.  Otherwise, make it a local label,
                 and try to deal with parsing the rest later.  */
              if (!input_line_pointer[1]
-                 || (is_end_of_line[0xff & input_line_pointer[1]]))
+                 || (is_end_of_line[0xff & input_line_pointer[1]])
+                 || strchr (FLT_CHARS, 'f') == NULL)
                goto is_0f_label;
              {
                char *cp = input_line_pointer + 1;
@@ -980,7 +964,7 @@ operand (expressionP)
 
        case 'd':
        case 'D':
-         if (flag_m68k_mri)
+         if (flag_m68k_mri || NUMBERS_WITH_SUFFIX)
            {
              integer_constant (0, expressionP);
              break;
@@ -1027,6 +1011,7 @@ operand (expressionP)
       /* here with input_line_pointer->char after "(...)" */
       return segment;
 
+#ifdef TC_M68K
     case 'E':
       if (! flag_m68k_mri || *input_line_pointer != '\'')
        goto de_fault;
@@ -1037,6 +1022,7 @@ operand (expressionP)
        goto de_fault;
       ++input_line_pointer;
       /* Fall through.  */
+#endif
     case '\'':
       if (! flag_m68k_mri)
        {
@@ -1056,11 +1042,13 @@ operand (expressionP)
       (void) operand (expressionP);
       break;
 
+#ifdef TC_M68K
     case '"':
       /* Double quote is the bitwise not operator in MRI mode.  */
       if (! flag_m68k_mri)
        goto de_fault;
       /* Fall through.  */
+#endif
     case '~':
       /* ~ is permitted to start a label on the Delta.  */
       if (is_name_beginner (c))
@@ -1102,6 +1090,7 @@ operand (expressionP)
       }
       break;
 
+#if defined (DOLLAR_DOT) || defined (TC_M68K)
     case '$':
       /* $ is the program counter when in MRI mode, or when DOLLAR_DOT
          is defined.  */
@@ -1122,6 +1111,7 @@ operand (expressionP)
 
       current_location (expressionP);
       break;
+#endif
 
     case '.':
       if (!is_part_of_name (*input_line_pointer))
@@ -1185,6 +1175,7 @@ operand (expressionP)
       input_line_pointer--;
       break;
 
+#ifdef TC_M68K
     case '%':
       if (! flag_m68k_mri)
        goto de_fault;
@@ -1214,9 +1205,12 @@ operand (expressionP)
 
       current_location (expressionP);
       break;
+#endif
 
     default:
+#ifdef TC_M68K
     de_fault:
+#endif
       if (is_end_of_line[(unsigned char) c])
        goto eol;
       if (is_name_beginner (c))        /* here if did not begin with a digit */
@@ -1750,6 +1744,13 @@ expr (rankarg, resultP)
        }
 
       /* Optimize common cases.  */
+#ifdef md_optimize_expr
+      if (md_optimize_expr (resultP, op_left, &right))
+       {
+         /* skip */;
+       }
+      else
+#endif
       if (op_left == O_add && right.X_op == O_constant)
        {
          /* X + constant.  */
This page took 0.02522 seconds and 4 git commands to generate.