This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Uppercase condition codes


The parset for the thumb-2 IT instruction currently only accepts lowercase 
condition codes. Patch below makes it case insensitive, like the rest of the 
assembly syntax.  When condition codes are used as part of an opcode the 
string has already been converted to lower case, so this problem does not 
occur.

Tested on arm-eabi.
Applied to cvs HEAD.

Paul

2008-05-22  Paul Brook  <paul@codesourcery.com>

	gas/
	* config/tc-arm.c (parse_cond): Covert to lowercase before matching.

Index: gas/config/tc-arm.c
===================================================================
--- gas/config/tc-arm.c	(revision 208768)
+++ gas/config/tc-arm.c	(working copy)
@@ -5045,14 +5045,23 @@ parse_ror (char **str)
 static int
 parse_cond (char **str)
 {
-  char *p, *q;
+  char *q;
   const struct asm_cond *c;
+  int n;
+  /* Condition codes are always 2 characters, so matching up to
+     3 characters is sufficient.  */
+  char cond[3];
 
-  p = q = *str;
-  while (ISALPHA (*q))
-    q++;
+  q = *str;
+  n = 0;
+  while (ISALPHA (*q) && n < 3)
+    {
+      cond[n] = TOLOWER(*q);
+      q++;
+      n++;
+    }
 
-  c = hash_find_n (arm_cond_hsh, p, q - p);
+  c = hash_find_n (arm_cond_hsh, cond, n);
   if (!c)
     {
       inst.error = _("condition required");


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]