stmt.c (resolve_operand_names): Handle operand modifiers.
authorRichard Henderson <rth@redhat.com>
Mon, 24 Dec 2001 06:15:31 +0000 (22:15 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Mon, 24 Dec 2001 06:15:31 +0000 (22:15 -0800)
        * stmt.c (resolve_operand_names): Handle operand modifiers.

        * gcc.dg/asm-4.c: Test operand modifiers.

From-SVN: r48299

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

index 4996eb1346d71e6052799f4fc0809d171bd6e8bc..7df5b1892598e7da968cac0d99c64cef873449b3 100644 (file)
@@ -1,3 +1,7 @@
+2001-12-23  Richard Henderson  <rth@redhat.com>
+
+       * stmt.c (resolve_operand_names): Handle operand modifiers.
+
 2001-12-23  Richard Henderson  <rth@redhat.com>
 
        * stmt.c (parse_input_constraint): Break out from ...
index 5682a26868cd142b575de33f084b58b0b3bb04d5..c87612aa3c38081f0a71fefd315111c12064bb3a 100644 (file)
@@ -2080,8 +2080,16 @@ resolve_operand_names (string, outputs, inputs, pconstraints)
   p = buffer;
   while ((p = strchr (p, '%')) != NULL)
     {
-      if (*++p != '[')
-       continue;
+      if (p[1] == '[')
+       p += 1;
+      else if (ISALPHA (p[1]) && p[2] == '[')
+       p += 2;
+      else
+       {
+         p += 1;
+         continue;
+       }
+
       p = resolve_operand_name_1 (p, outputs, inputs);
     }
 
index 1b6eb89bd0c760df0a8d345091f4067a29fe4d33..cddb9abb10c59567f20a7c4522373fc4451873bb 100644 (file)
@@ -1,3 +1,7 @@
+2001-12-23  Richard Henderson  <rth@redhat.com>
+
+       * gcc.dg/asm-4.c: Test operand modifiers.
+
 2001-12-23  Richard Henderson  <rth@redhat.com>
 
        * gcc.c-torture/execute/20011219-1.c (main): Make "i" a long.
index 662f5d55612e739a74861a5f9009c8d260e146e3..862888ad345aa7abc8cff6c299fd8bc5a560d15a 100644 (file)
@@ -3,12 +3,14 @@
 
 int main()
 {
-  int x;
+  int x, y, z;
 
   asm volatile ("test0 X%0Y%[arg]Z" : [arg] "=g" (x));
-  asm volatile ("test1 X%[out]Y%[in]Z" : [out] "=g" (x) : [in] "0"(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));
 }
 
 /* ??? Someone explain why the back reference dosn't work.  */
 /* { dontdg-final { scan-assembler "test0 X(.*)Y\1Z" } } */
 /* { dontdg-final { scan-assembler "test1 X(.*)Y\1Z" } } */
+/* { dontdg-final { scan-assembler "test2 X(.*)Y\1Z" } } */