]> granicus.if.org Git - clang/commitdiff
[X86] Prevent clang clobber checking for asm flag constraints.
authorNirav Dave <niravd@google.com>
Sun, 17 Feb 2019 03:53:23 +0000 (03:53 +0000)
committerNirav Dave <niravd@google.com>
Sun, 17 Feb 2019 03:53:23 +0000 (03:53 +0000)
Update getConstraintRegister as X86 Asm flag output constraints are no
longer fully alphanumeric,

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354211 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/Targets/X86.h
test/CodeGen/inline-asm-x86-flag-output.c

index 2b126268beb14c32111c86a6f8d6a0abb2ba1090..b69a050d237eee60161bc2f8f50ff2af1b6f09bf 100644 (file)
@@ -198,7 +198,7 @@ public:
                                   StringRef Expression) const override {
     StringRef::iterator I, E;
     for (I = Constraint.begin(), E = Constraint.end(); I != E; ++I) {
-      if (isalpha(*I))
+      if (isalpha(*I) || *I == '@')
         break;
     }
     if (I == E)
index f647e3e3c1ecd16aedbda4ac25eeb800eb7f361b..74ad3a46e70c27acc59545247e58931f0b34f0a2 100644 (file)
@@ -363,3 +363,14 @@ int test_ccs(long nr, volatile long *addr) {
     return 0;
   return 1;
 }
+
+_Bool check_no_clobber_conflicts() {
+  //CHECK-LABEL: @check_no_clobber_conflicts
+  //CHECK:  = tail call i8 asm "", "={@cce},~{cx},~{dirflag},~{fpsr},~{flags}"()
+  _Bool b;
+  asm(""
+      : "=@cce"(b)
+      :
+      : "cx");
+  return b;
+}