]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
MIPS16/GAS: Streamline forced size suffix handling code
authorMaciej W. Rozycki <macro@orcam.me.uk>
Mon, 10 Feb 2025 22:11:25 +0000 (22:11 +0000)
committerMaciej W. Rozycki <macro@orcam.me.uk>
Mon, 10 Feb 2025 22:11:25 +0000 (22:11 +0000)
Clean up after commit 112cf77b1855 ("MIPS: use is_whitespace()") and
untangle the code flow in the handling of forced size suffixes, noting
that owing to the loop right above the only data `c' can hold at this
point is '\0', '.', or a white-space character.  No functional change.

gas/config/tc-mips.c

index c5d36c24558fe9814c25d0ebd88a823a39f05d7f..d01b6a5ba05180b7cb604211a0dc6d45001acb40 100644 (file)
@@ -14394,17 +14394,8 @@ mips16_ip (char *str, struct mips_cl_insn *insn)
   c = *end;
 
   l = 0;
-  switch (c)
+  if (c == '.')
     {
-    case '\0':
-      break;
-
-    default:
-      if (is_whitespace (*s))
-       s++;
-      break;
-
-    case '.':
       s++;
       if (*s == 't')
        {
@@ -14416,16 +14407,14 @@ mips16_ip (char *str, struct mips_cl_insn *insn)
          l = 4;
          s++;
        }
-      if (l != 0)
+      if (l == 0 || (*s != '\0' && !is_whitespace (*s++)))
        {
-         if (*s == '\0')
-           break;
-         else if (is_whitespace (*s++))
-           break;
+         set_insn_error (0, _("unrecognized opcode"));
+         return;
        }
-      set_insn_error (0, _("unrecognized opcode"));
-      return;
     }
+  else if (is_whitespace (c))
+    s++;
   forced_insn_length = l;
 
   *end = 0;