aboutsummaryrefslogtreecommitdiff
path: root/gcc/stmt.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2002-02-06 17:38:40 -0800
committerRichard Henderson <rth@gcc.gnu.org>2002-02-06 17:38:40 -0800
commitedd1967d0c957ab48836fe0cc0128d012c6b6c6c (patch)
tree0dff9e44d22a2396c142a7018e5bd673b236bb05 /gcc/stmt.c
parent448f456d7a9043f135f13ea300f8ac124906adfe (diff)
downloadgcc-edd1967d0c957ab48836fe0cc0128d012c6b6c6c.zip
gcc-edd1967d0c957ab48836fe0cc0128d012c6b6c6c.tar.gz
gcc-edd1967d0c957ab48836fe0cc0128d012c6b6c6c.tar.bz2
re PR c/5609 (ICE on named operands in inline assembler)
PR c/5609 * 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. From-SVN: r49560
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r--gcc/stmt.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 99f910a..17b4d0b 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -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';