diff options
author | Anders Carlsson <andersca@mac.com> | 2009-08-02 03:40:19 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-08-02 03:40:19 +0000 |
commit | 7df966e04001125b2dbe73488c91539deeb73ac9 (patch) | |
tree | 42d56d86fdc36ab555364faeb5245e2524c16c76 | |
parent | 8e3889f12ef80a3769d5d2153b0e7fccf32417f3 (diff) | |
download | bcm5719-llvm-7df966e04001125b2dbe73488c91539deeb73ac9.tar.gz bcm5719-llvm-7df966e04001125b2dbe73488c91539deeb73ac9.zip |
Don't evaluate inout constraints twice. Fixes PR3800.
llvm-svn: 77854
-rw-r--r-- | clang/lib/CodeGen/CGStmt.cpp | 4 | ||||
-rw-r--r-- | clang/test/CodeGen/asm-inout.c | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp index 5b17b7b9008..2361c4a3342 100644 --- a/clang/lib/CodeGen/CGStmt.cpp +++ b/clang/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/clang/test/CodeGen/asm-inout.c b/clang/test/CodeGen/asm-inout.c new file mode 100644 index 00000000000..e0e42a319df --- /dev/null +++ b/clang/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)); +} |