From: Chris Lattner Date: Sun, 3 May 2009 09:05:53 +0000 (+0000) Subject: look at the right operand when increasing the size of an asm output, X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0bdaa5b576237195a260d347f2646cf42ec7d745;p=clang look at the right operand when increasing the size of an asm output, this fixes http://llvm.org/bugs/show_bug.cgi?id=3373#c20 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70685 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp index 0e9cec42c8..6874dc076b 100644 --- a/lib/CodeGen/CGStmt.cpp +++ b/lib/CodeGen/CGStmt.cpp @@ -848,10 +848,8 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) { for (InputNo = 0; InputNo != S.getNumInputs(); ++InputNo) { TargetInfo::ConstraintInfo &Input = InputConstraintInfos[InputNo]; if (Input.hasTiedOperand() && - Input.getTiedOperand() == i) { - InputNo = i; + Input.getTiedOperand() == i) break; - } } assert(InputNo != S.getNumInputs() && "Didn't find matching input!"); diff --git a/test/CodeGen/asm.c b/test/CodeGen/asm.c index 8aa392aa80..db6567058d 100644 --- a/test/CodeGen/asm.c +++ b/test/CodeGen/asm.c @@ -77,6 +77,19 @@ unsigned char t13(unsigned input) { return output; } +struct large { + int x[1000]; +}; + +unsigned long t15(int x, struct large *P) { + __asm__("xyz " + : "=r" (x) + : "m" (*P), "0" (x)); + return x; +} + + + // bitfield destination of an asm. struct S {