Mercurial > projects > ldc
comparison gen/asm-x86-64.h @ 1053:11e28922ac76
Always pass an address expression (not a var expression) to asm operands of
type Arg_Memory.
This fixes the following code:
{{{
void f(real x) { asm { fld x[RBP]; } }
void g(int x) { asm { mov EAX, x[RBP]; } }
}}}
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Sun, 08 Mar 2009 00:57:58 +0100 |
parents | 16e2c750c857 |
children | 8bc277ef23a5 |
comparison
equal
deleted
inserted
replaced
1052:12ea38902e83 | 1053:11e28922ac76 |
---|---|
2142 decl->isVarDeclaration() && | 2142 decl->isVarDeclaration() && |
2143 ( ( ( operand->baseReg == Reg_EBP || ( operand->baseReg == Reg_RBP ) ) && ! sc->func->naked ) || | 2143 ( ( ( operand->baseReg == Reg_EBP || ( operand->baseReg == Reg_RBP ) ) && ! sc->func->naked ) || |
2144 ( ( operand->baseReg == Reg_ESP || ( operand->baseReg == Reg_RSP ) ) && ! sc->func->naked ) ) ) | 2144 ( ( operand->baseReg == Reg_ESP || ( operand->baseReg == Reg_RSP ) ) && ! sc->func->naked ) ) ) |
2145 { | 2145 { |
2146 | 2146 |
2147 if ( mode == Mode_Output ) | 2147 e = new AddrExp ( 0, e ); |
2148 { | 2148 e->type = decl->type->pointerTo(); |
2149 e = new AddrExp ( 0, e ); | |
2150 e->type = decl->type->pointerTo(); | |
2151 } | |
2152 | 2149 |
2153 #if !IN_LLVM | 2150 #if !IN_LLVM |
2154 /* DMD uses the same frame offsets for naked functions. */ | 2151 /* DMD uses the same frame offsets for naked functions. */ |
2155 if ( sc->func->naked ) | 2152 if ( sc->func->naked ) |
2156 operand->constDisplacement += 4; | 2153 operand->constDisplacement += 4; |