]> granicus.if.org Git - clang/commitdiff
look at the right operand when increasing the size of an asm output,
authorChris Lattner <sabre@nondot.org>
Sun, 3 May 2009 09:05:53 +0000 (09:05 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 3 May 2009 09:05:53 +0000 (09:05 +0000)
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

lib/CodeGen/CGStmt.cpp
test/CodeGen/asm.c

index 0e9cec42c81f5e4f32c6b456209667fabef3f0dc..6874dc076b6343a5219ab5d756d7bd96696d5700 100644 (file)
@@ -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!");
         
index 8aa392aa8071b6214d7ef2ba95473dd567cd0ceb..db6567058d709184e89b48fbd5e2dab4b21b16fc 100644 (file)
@@ -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 {