stmt.c (check_unique_operand_names): Expect operand names to be strings rather than...
authorRichard Sandiford <rsandifo@redhat.com>
Sat, 13 Apr 2002 09:29:03 +0000 (09:29 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Sat, 13 Apr 2002 09:29:03 +0000 (09:29 +0000)
* stmt.c (check_unique_operand_names): Expect operand names to
be strings rather than identifiers.  Use simple_cst_equal to
compare them.
(resolve_operand_name_1): Make same identifier to string change here.
* c-parse.in (asm_operand): Convert a named operand into a string.
* cp/parse.y (asm_operand): Likewise.

From-SVN: r52269

gcc/ChangeLog
gcc/c-parse.in
gcc/cp/parse.y
gcc/stmt.c

index 5b4897e379bcec07eef0e58541cec8200121637f..b0243de561972d9289b7a2c071888e7a663e1399 100644 (file)
@@ -1,3 +1,12 @@
+2002-04-13  Richard Sandiford  <rsandifo@redhat.com>
+
+       * stmt.c (check_unique_operand_names): Expect operand names to
+       be strings rather than identifiers.  Use simple_cst_equal to
+       compare them.
+       (resolve_operand_name_1): Make same identifier to string change here.
+       * c-parse.in (asm_operand): Convert a named operand into a string.
+       * cp/parse.y (asm_operand): Likewise.
+
 2002-04-13  Andreas Schwab  <schwab@suse.de>
 
        * config/ia64/ia64.h (CPP_SPEC): Include %(cpp_cpu).
index e6d61378b9bd941db045507d1e9089df3472e928..c6d4b4fe0030964f831193d76627db3a3a8c8e23 100644 (file)
@@ -2467,7 +2467,9 @@ asm_operand:
          STRING '(' expr ')'
                { $$ = build_tree_list (build_tree_list (NULL_TREE, $1), $3); }
        | '[' identifier ']' STRING '(' expr ')'
-               { $$ = build_tree_list (build_tree_list ($2, $4), $6); }
+               { $2 = build_string (IDENTIFIER_LENGTH ($2),
+                                    IDENTIFIER_POINTER ($2));
+                 $$ = build_tree_list (build_tree_list ($2, $4), $6); }
        ;
 
 asm_clobbers:
index 8a33c870f077a4535bb1a15da485c5f8fa59a76e..ae1c2a48010faf06339a6e2da6795b57715a5f4d 100644 (file)
@@ -3637,7 +3637,9 @@ asm_operand:
          STRING '(' expr ')'
                { $$ = build_tree_list (build_tree_list (NULL_TREE, $1), $3); }
        | '[' identifier ']' STRING '(' expr ')'
-               { $$ = build_tree_list (build_tree_list ($2, $4), $6); }
+               { $2 = build_string (IDENTIFIER_LENGTH ($2),
+                                    IDENTIFIER_POINTER ($2));
+                 $$ = build_tree_list (build_tree_list ($2, $4), $6); }
        ;
 
 asm_clobbers:
index 4f0cb179547687ca2bb4971246dc712d8d7b9ae8..32a1541cb057973c2658ad4bdb9915fff6628e31 100644 (file)
@@ -2034,7 +2034,7 @@ check_unique_operand_names (outputs, inputs)
        continue;
 
       for (j = TREE_CHAIN (i); j ; j = TREE_CHAIN (j))
-       if (i_name == TREE_PURPOSE (TREE_PURPOSE (j)))
+       if (simple_cst_equal (i_name, TREE_PURPOSE (TREE_PURPOSE (j))))
          goto failure;
     }
 
@@ -2045,10 +2045,10 @@ check_unique_operand_names (outputs, inputs)
        continue;
 
       for (j = TREE_CHAIN (i); j ; j = TREE_CHAIN (j))
-       if (i_name == TREE_PURPOSE (TREE_PURPOSE (j)))
+       if (simple_cst_equal (i_name, TREE_PURPOSE (TREE_PURPOSE (j))))
          goto failure;
       for (j = outputs; j ; j = TREE_CHAIN (j))
-       if (i_name == TREE_PURPOSE (TREE_PURPOSE (j)))
+       if (simple_cst_equal (i_name, TREE_PURPOSE (TREE_PURPOSE (j))))
          goto failure;
     }
 
@@ -2056,7 +2056,7 @@ check_unique_operand_names (outputs, inputs)
 
  failure:
   error ("duplicate asm operand name '%s'",
-        IDENTIFIER_POINTER (TREE_PURPOSE (TREE_PURPOSE (i))));
+        TREE_STRING_POINTER (TREE_PURPOSE (TREE_PURPOSE (i))));
   return false;
 }
 
@@ -2150,20 +2150,20 @@ resolve_operand_name_1 (p, outputs, inputs)
   /* Resolve the name to a number.  */
   for (op = 0, t = outputs; t ; t = TREE_CHAIN (t), op++)
     {
-      tree id = TREE_PURPOSE (TREE_PURPOSE (t));
-      if (id)
+      tree name = TREE_PURPOSE (TREE_PURPOSE (t));
+      if (name)
        {
-         const char *c = IDENTIFIER_POINTER (id);
+         const char *c = TREE_STRING_POINTER (name);
          if (strncmp (c, p + 1, len) == 0 && c[len] == '\0')
            goto found;
        }
     }
   for (t = inputs; t ; t = TREE_CHAIN (t), op++)
     {
-      tree id = TREE_PURPOSE (TREE_PURPOSE (t));
-      if (id)
+      tree name = TREE_PURPOSE (TREE_PURPOSE (t));
+      if (name)
        {
-         const char *c = IDENTIFIER_POINTER (id);
+         const char *c = TREE_STRING_POINTER (name);
          if (strncmp (c, p + 1, len) == 0 && c[len] == '\0')
            goto found;
        }