Revert "PR28977 tc-i386.c internal error in parse_register"
authorJan Beulich <jbeulich@suse.com>
Wed, 23 Mar 2022 11:29:39 +0000 (12:29 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 23 Mar 2022 11:29:39 +0000 (12:29 +0100)
This reverts commit 5fac3f02edacfca458f7eeaaaa33a87e26e0e332,
which was superceeded / replaced by 4faaa10f3fab.

gas/config/tc-i386.c

index aea19aa5d883490b0839e8f72d55a8e6fdab5175..ec82144ed1b73aa9397c5fdd36d206314bbd3a84 100644 (file)
@@ -12978,18 +12978,17 @@ parse_register (char *reg_string, char **end_op)
        {
          const expressionS *e = symbol_get_value_expression (symbolP);
 
-         if (e->X_op == O_register
-             && (valueT) e->X_add_number < i386_regtab_size)
+         know (e->X_op == O_register);
+         know (e->X_add_number >= 0
+               && (valueT) e->X_add_number < i386_regtab_size);
+         r = i386_regtab + e->X_add_number;
+         if (!check_register (r))
            {
-             r = i386_regtab + e->X_add_number;
-             if (!check_register (r))
-               {
-                 as_bad (_("register '%s%s' cannot be used here"),
-                         register_prefix, r->reg_name);
-                 r = &bad_reg;
-               }
-             *end_op = input_line_pointer;
+             as_bad (_("register '%s%s' cannot be used here"),
+                     register_prefix, r->reg_name);
+             r = &bad_reg;
            }
+         *end_op = input_line_pointer;
        }
       *input_line_pointer = c;
       input_line_pointer = save;