summaryrefslogtreecommitdiffhomepage
path: root/ir/be/beasm.c
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2018-05-04 06:41:47 +0200
committerSebastian Buchwald <Sebastian.Buchwald@kit.edu>2018-05-04 22:47:07 +0200
commite14193b0e83eb47a1fd1c620ed7503815b98c4d9 (patch)
tree5e36ddb4f04c60729da17d532167671e456246b4 /ir/be/beasm.c
parent11579d197df0c891d815de563055831c696b8164 (diff)
be: Always accept '#' and '%' as prefix when reading a register name.
GCC accepts this, too. This fixes backend/asm_clobber_prefix.c on amd64 and ia32.
Diffstat (limited to 'ir/be/beasm.c')
-rw-r--r--ir/be/beasm.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ir/be/beasm.c b/ir/be/beasm.c
index c3cf3a1..1622343 100644
--- a/ir/be/beasm.c
+++ b/ir/be/beasm.c
@@ -384,8 +384,13 @@ bool be_is_valid_asm_operand_kind(ir_node const *const node, char const modifier
return true;
}
-arch_register_t const *be_parse_register_name(char const *const clobber)
+arch_register_t const *be_parse_register_name(char const *clobber)
{
+ /* GCC always accepts '#' and '%' as register name prefix.
+ * See strip_reg_name() in varasm.c. */
+ if (clobber[0] == '#' || clobber[0] == '%')
+ clobber += 1;
+
arch_register_t const *const reg = arch_find_register(clobber);
if (reg)
return reg;