[clang] [Clang] Fix crash for incompatible types in inline assembly (PR #119098)

via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 12 06:09:55 PST 2024


================
@@ -664,11 +664,22 @@ StmtResult Sema::ActOnGCCAsmStmt(SourceLocation AsmLoc, bool IsSimple,
       SmallerValueMentioned |= OutSize < InSize;
     }
 
+    // If the input is an integer register while the output is floating point,
+    // there is no way they can work together.
+    bool FPBoundToInt = false;
+    if (InputDomain != AD_FP && OutputDomain == AD_FP) {
+      FPBoundToInt = true;
+    }
+    if (InputDomain == AD_FP && OutputDomain != AD_FP) {
+      FPBoundToInt = true;
+    }
----------------
AdUhTkJm wrote:

I think this might be clearer than expressions like `(InputDomain == AD_FP) ^ (OutputDomain == AD_FP)`. By the way the previous parts uses "Tied", so I think I'd change it this way.

https://github.com/llvm/llvm-project/pull/119098


More information about the cfe-commits mailing list