Added ~{memory} clobber when a jump_target is generated in inline asm (branch out of inline asm)

This commit is contained in:
Tomas Lindquist Olsen 2009-03-03 19:18:47 +01:00
parent f0d33b1b20
commit ae214b18e7
2 changed files with 9 additions and 3 deletions

View file

@ -594,6 +594,7 @@ void AsmBlockStatement::toIR(IRState* p)
// setup variable for output from asm
outSetterStmt->out_c = "=*m,";
outSetterStmt->out.push_back(jump_target);
asmblock->clobs.insert("~{memory},");
asmblock->s.push_back(outSetterStmt);
}

View file

@ -2593,7 +2593,11 @@ STUB(TupleExp);
STUB(SymbolExp);
#endif
#define CONSTSTUB(x) LLConstant* x::toConstElem(IRState * p) {error("non-const expression '%s' or const Exp type "#x" not implemented", toChars()); fatal(); return NULL; }
#define CONSTSTUB(x) LLConstant* x::toConstElem(IRState * p) { \
error("expression '%s' is not a constant", toChars()); \
fatal(); \
return NULL; \
}
CONSTSTUB(Expression);
CONSTSTUB(GEPExp);
CONSTSTUB(SliceExp);
@ -2761,9 +2765,10 @@ int TypedefDeclaration::cvMember(unsigned char*)
void obj_includelib(const char* lib)
{
char *arg = (char *)mem.malloc(64);
size_t n = strlen(lib)+3;
char *arg = (char *)mem.malloc(n);
strcpy(arg, "-l");
strncat(arg, lib, 64);
strncat(arg, lib, n);
global.params.linkswitches->push(arg);
}