# HG changeset patch # User Frits van Bommel # Date 1236470278 -3600 # Node ID 11e28922ac76db142703dc74432a0436a8364887 # Parent 12ea38902e83ef240c71043b1c224e6016577474 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]; } } }}} diff -r 12ea38902e83 -r 11e28922ac76 gen/asm-x86-64.h --- a/gen/asm-x86-64.h Sat Mar 07 19:38:00 2009 +0100 +++ b/gen/asm-x86-64.h Sun Mar 08 00:57:58 2009 +0100 @@ -2144,11 +2144,8 @@ ( ( operand->baseReg == Reg_ESP || ( operand->baseReg == Reg_RSP ) ) && ! sc->func->naked ) ) ) { - if ( mode == Mode_Output ) - { - e = new AddrExp ( 0, e ); - e->type = decl->type->pointerTo(); - } + e = new AddrExp ( 0, e ); + e->type = decl->type->pointerTo(); #if !IN_LLVM /* DMD uses the same frame offsets for naked functions. */ diff -r 12ea38902e83 -r 11e28922ac76 gen/asmstmt.cpp --- a/gen/asmstmt.cpp Sat Mar 07 19:38:00 2009 +0100 +++ b/gen/asmstmt.cpp Sun Mar 08 00:57:58 2009 +0100 @@ -415,6 +415,26 @@ asmblock->clobs.insert(clobstr); } + if (Logger::enabled()) { + typedef std::deque::iterator It; + { + Logger::println("Output values:"); + LOG_SCOPE + size_t i = 0; + for (It I = output_values.begin(), E = output_values.end(); I != E; ++I) { + Logger::cout() << "Out " << i++ << " = " << **I << '\n'; + } + } + { + Logger::println("Input values:"); + LOG_SCOPE + size_t i = 0; + for (It I = input_values.begin(), E = input_values.end(); I != E; ++I) { + Logger::cout() << "In " << i++ << " = " << **I << '\n'; + } + } + } + // excessive commas are removed later... // push asm statement