OSDN Git Service

PR c/5609
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 7 Feb 2002 01:38:40 +0000 (01:38 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 7 Feb 2002 01:38:40 +0000 (01:38 +0000)
        * stmt.c (resolve_operand_name_1): Take more care with mixed
        named and unnamed operands.

        * gcc.dg/asm-4.c: Add case with an unnamed operand in the middle.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49560 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/stmt.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/asm-4.c

index 6b413d6..7560a0b 100644 (file)
@@ -1,3 +1,9 @@
+2002-02-06  Richard Henderson  <rth@redhat.com>
+
+       PR c/5609
+       * stmt.c (resolve_operand_name_1): Take more care with mixed
+       named and unnamed operands.
+
 2002-02-06  Janis Johnson  <janis187@us.ibm.com>
            Jan Hubicka  <jh@suse.cz>
 
index 99f910a..17b4d0b 100644 (file)
@@ -2149,15 +2149,23 @@ resolve_operand_name_1 (p, outputs, inputs)
   /* Resolve the name to a number.  */
   for (op = 0, t = outputs; t ; t = TREE_CHAIN (t), op++)
     {
-      const char *c = IDENTIFIER_POINTER (TREE_PURPOSE (TREE_PURPOSE (t)));
-      if (strncmp (c, p + 1, len) == 0 && c[len] == '\0')
-       goto found;
+      tree id = TREE_PURPOSE (TREE_PURPOSE (t));
+      if (id)
+       {
+         const char *c = IDENTIFIER_POINTER (id);
+         if (strncmp (c, p + 1, len) == 0 && c[len] == '\0')
+           goto found;
+       }
     }
   for (t = inputs; t ; t = TREE_CHAIN (t), op++)
     {
-      const char *c = IDENTIFIER_POINTER (TREE_PURPOSE (TREE_PURPOSE (t)));
-      if (strncmp (c, p + 1, len) == 0 && c[len] == '\0')
-       goto found;
+      tree id = TREE_PURPOSE (TREE_PURPOSE (t));
+      if (id)
+       {
+         const char *c = IDENTIFIER_POINTER (id);
+         if (strncmp (c, p + 1, len) == 0 && c[len] == '\0')
+           goto found;
+       }
     }
 
   *q = '\0';
index 759f06c..a32e28e 100644 (file)
@@ -1,3 +1,7 @@
+2002-02-06  Richard Henderson  <rth@redhat.com>
+
+       * gcc.dg/asm-4.c: Add case with an unnamed operand in the middle.
+
 2002-02-06  Janis Johnson  <janis187@us.ibm.com>
 
        * gcc.dg/20020206-1.c: New test.
index 862888a..0067598 100644 (file)
@@ -8,6 +8,7 @@ int main()
   asm volatile ("test0 X%0Y%[arg]Z" : [arg] "=g" (x));
   asm volatile ("test1 X%[out]Y%[in]Z" : [out] "=g" (y) : [in] "0"(y));
   asm volatile ("test2 X%a0Y%a[arg]Z" : : [arg] "p" (&z));
+  asm volatile ("test3 %[in]" : [inout] "=g"(x) : "[inout]" (x), [in] "g" (y));
 }
 
 /* ??? Someone explain why the back reference dosn't work.  */