aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@redhat.com>2002-04-13 09:29:03 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2002-04-13 09:29:03 +0000
commitfc552851609146aa068cad21f052d10d2552c357 (patch)
tree7ce196bd09b2829aee78182cc4a87bbe0cf3c046 /gcc
parentc8825221047b9d22cac2af7d52b7c7cba4fa6967 (diff)
downloadgcc-fc552851609146aa068cad21f052d10d2552c357.zip
gcc-fc552851609146aa068cad21f052d10d2552c357.tar.gz
gcc-fc552851609146aa068cad21f052d10d2552c357.tar.bz2
stmt.c (check_unique_operand_names): Expect operand names to be strings rather than identifiers.
* 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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/c-parse.in4
-rw-r--r--gcc/cp/parse.y4
-rw-r--r--gcc/stmt.c20
4 files changed, 25 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5b4897e..b0243de 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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).
diff --git a/gcc/c-parse.in b/gcc/c-parse.in
index e6d6137..c6d4b4f 100644
--- a/gcc/c-parse.in
+++ b/gcc/c-parse.in
@@ -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:
diff --git a/gcc/cp/parse.y b/gcc/cp/parse.y
index 8a33c87..ae1c2a4 100644
--- a/gcc/cp/parse.y
+++ b/gcc/cp/parse.y
@@ -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:
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 4f0cb17..32a1541 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -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;
}