]> granicus.if.org Git - clang/commit
[inline-asm]No error for conflict between inputs\outputs and clobber list
authorMarina Yatsina <marina.yatsina@intel.com>
Mon, 26 Dec 2016 12:23:42 +0000 (12:23 +0000)
committerMarina Yatsina <marina.yatsina@intel.com>
Mon, 26 Dec 2016 12:23:42 +0000 (12:23 +0000)
commit158bdde29231fe764b5849ef5eb21398b6345536
treec75cd2ba03a7d5bf0b9df43b93c129d47acfeb27
parent2f5a0f873a9cfe147b84c758d17f660b887881f6
[inline-asm]No error for conflict between inputs\outputs and clobber list

According to extended asm syntax, a case where the clobber list includes a variable from the inputs or outputs should be an error - conflict.
for example:

const long double a = 0.0;
int main()
{

char b;
double t1 = a;
__asm__ ("fucompp": "=a" (b) : "u" (t1), "t" (t1) : "cc", "st", "st(1)");

return 0;
}

This should conflict with the output - t1 which is st, and st which is st aswell.
The patch fixes it.

Commit on behald of Ziv Izhar.

Differential Revision: https://reviews.llvm.org/D15075

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290539 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Basic/TargetInfo.h
lib/Basic/TargetInfo.cpp
lib/Basic/Targets.cpp
lib/Headers/intrin.h
lib/Sema/SemaStmtAsm.cpp
test/Sema/asm.c