diff options
| author | grischka <grischka> | 2016-11-20 14:50:56 +0100 |
|---|---|---|
| committer | grischka <grischka> | 2016-11-20 14:50:56 +0100 |
| commit | 4a3741bf02eb51c377312bdabc979e5ccbf5bf89 (patch) | |
| tree | 11b4469c57da947e9aa7ab60c8063e85b21fc2ab /tccasm.c | |
| parent | 47fd807f9b62945600cb15409c46cc70d3b1fa97 (diff) | |
| download | tinycc-4a3741bf02eb51c377312bdabc979e5ccbf5bf89.tar.gz tinycc-4a3741bf02eb51c377312bdabc979e5ccbf5bf89.tar.bz2 | |
x86_64-asm: =m operand fixes
The problem was with tcctest.c:
unsigned set;
__asm__("btsl %1,%0" : "=m"(set) : "Ir"(20) : "cc");
when with tcc compiled with the HAVE_SELINUX option, run with
tcc -run, it would use large addresses far beyond the 32bits
range when tcc did not use the pc-relative mode for accessing
'set' in global data memory. In fact the assembler did not
know about %rip at all.
Changes:
- memory operands use (%rax) not (%eax)
- conversion from VT_LLOCAL: use type VT_PTR
- support 'k' modifier
- support %rip register
- support X(%rip) pc-relative addresses
The test in tcctest.c is from Michael Matz.
Diffstat (limited to 'tccasm.c')
| -rw-r--r-- | tccasm.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -977,7 +977,8 @@ static void subst_asm_operands(ASMOperand *operands, int nb_operands, } modifier = 0; if (*str == 'c' || *str == 'n' || - *str == 'b' || *str == 'w' || *str == 'h') + *str == 'b' || *str == 'w' || + *str == 'h' || *str == 'k') modifier = *str++; index = find_constraint(operands, nb_operands, str, &str); if (index < 0) @@ -1029,7 +1030,8 @@ static void parse_asm_operands(ASMOperand *operands, int *nb_operands_ptr, skip('('); gexpr(); if (is_output) { - test_lvalue(); + if (!(vtop->type.t & VT_ARRAY)) + test_lvalue(); } else { /* we want to avoid LLOCAL case, except when the 'm' constraint is used. Note that it may come from |
