summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-08-02 03:40:19 +0000
committerAnders Carlsson <andersca@mac.com>2009-08-02 03:40:19 +0000
commit5a23264452fbf8ad3c65e0869fa902f7a0e918a1 (patch)
tree19718078355e3a0e2eb7a22f742f321fe8a67e2e
parent637ec3237da533470fd14e64f7597934291467c7 (diff)
Don't evaluate inout constraints twice. Fixes PR3800.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77854 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/CGStmt.cpp4
-rw-r--r--test/CodeGen/asm-inout.c8
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp
index 5b17b7b900..2361c4a334 100644
--- a/lib/CodeGen/CGStmt.cpp
+++ b/lib/CodeGen/CGStmt.cpp
@@ -917,8 +917,8 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) {
else
InOutConstraints += OutputConstraint;
- InOutArgTypes.push_back(Arg->getType());
- InOutArgs.push_back(Arg);
+ InOutArgTypes.push_back(Dest.getAddress()->getType());
+ InOutArgs.push_back(Dest.getAddress());
}
}
diff --git a/test/CodeGen/asm-inout.c b/test/CodeGen/asm-inout.c
new file mode 100644
index 0000000000..e0e42a319d
--- /dev/null
+++ b/test/CodeGen/asm-inout.c
@@ -0,0 +1,8 @@
+// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm %s -o %t &&
+// RUN: grep "load i8\*\*\* %p.addr" %t | count 1
+
+// PR3800
+void f(void **p)
+{
+ __asm__ volatile("" :"+m"(*p));
+}