This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix resolve_asm_operand_names
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 10 Jun 2010 15:17:03 +0200
- Subject: [PATCH] Fix resolve_asm_operand_names
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
This patch makes sure we don't replace %%[foo] in asm patterns,
only %[foo] or %%%[foo].
void foo (void)
{
asm volatile ("%%[a] %[a] %%%[a] %%[a] %[a]" : : [a] "i" (6));
}
before: %0 $6 %$6 %0 $6
after: %[a] $6 %$6 %[a] $6
Ok for trunk?
2010-06-10 Jakub Jelinek <jakub@redhat.com>
* stmt.c (resolve_asm_operand_names): Fix handling
of %%.
--- gcc/stmt.c.jj 2010-05-25 11:27:47.000000000 +0200
+++ gcc/stmt.c 2010-06-10 14:59:49.000000000 +0200
@@ -1319,7 +1319,7 @@ resolve_asm_operand_names (tree string,
break;
else
{
- c += 1;
+ c += 1 + (c[1] == '%');
continue;
}
}
@@ -1341,7 +1341,7 @@ resolve_asm_operand_names (tree string,
p += 2;
else
{
- p += 1;
+ p += 1 + (p[1] == '%');
continue;
}
Jakub