================
@@ -433,8 +439,14 @@ bool SemaARM::BuiltinARMAtomicStoreHintCall(unsigned 
BuiltinID,
                   diag::err_atomic_hint_has_invalid_hint_type)
              << Hint->getType() << Hint->getSourceRange();
 
-    if (llvm::toAArch64MemoryHint(HintAP->getZExtValue()) ==
-        llvm::AArch64MemoryHint::NONE) {
+    auto MemoryHint = llvm::toAArch64MemoryHint(HintAP->getZExtValue());
+    if (!IsStore && MemoryHint != llvm::AArch64MemoryHint::SHUH &&
+        MemoryHint != llvm::AArch64MemoryHint::SHUH_PH)
+      return Diag(TheCall->getBeginLoc(),
+                  diag::err_atomic_hint_has_invalid_hint_type)
+             << *HintAP << Hint->getSourceRange();
----------------
kmclaughlin-arm wrote:

I'm wondering if we should treat an invalid hint on the fetch builtin the same 
way as other invalid hints, i.e. just emit a warning that it will be dropped?

https://github.com/llvm/llvm-project/pull/227711
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to