* config/tc-ppc.c (ppc_parse_name): Skip leading '%'.
authorAlan Modra <amodra@gmail.com>
Fri, 19 Oct 2007 10:48:17 +0000 (10:48 +0000)
committerAlan Modra <amodra@gmail.com>
Fri, 19 Oct 2007 10:48:17 +0000 (10:48 +0000)
(md_assemble): When parsing PPC_OPERAND_CR, add '%' to set of
chars that can start a name.

gas/ChangeLog
gas/config/tc-ppc.c

index 25e70dbf2adde6e6acd5a957851da135bba06235..59112826e386974d1d1059b548f7094a50d985be 100644 (file)
@@ -1,3 +1,9 @@
+2007-10-19  Alan Modra  <amodra@bigpond.net.au>
+
+       * config/tc-ppc.c (ppc_parse_name): Skip leading '%'.
+       (md_assemble): When parsing PPC_OPERAND_CR, add '%' to set of
+       chars that can start a name.
+
 2007-10-18  Carlos O'Donell  <carlos@systemhalted.org>
 
        * config/tc-hppa.c (pa_ip): Fix comment typo.
index 713d25be8f67a652ef0cf2c160f3342e1347b013..2a598479054ebc21cf96af9300893160193ffe7f 100644 (file)
@@ -684,6 +684,8 @@ ppc_parse_name (const char *name, expressionS *expr)
   if (! cr_operand)
     return 0;
 
+  if (*name == '%')
+    ++name;
   val = reg_name_search (cr_names, sizeof cr_names / sizeof cr_names[0],
                         name);
   if (val < 0)
@@ -2454,10 +2456,16 @@ md_assemble (char *str)
        {
          if (! register_name (&ex))
            {
+             char save_lex = lex_type['%'];
+
              if ((operand->flags & PPC_OPERAND_CR) != 0)
-               cr_operand = TRUE;
+               {
+                 cr_operand = TRUE;
+                 lex_type['%'] |= LEX_BEGIN_NAME;
+               }
              expression (&ex);
              cr_operand = FALSE;
+             lex_type['%'] = save_lex;
            }
        }