[clang] [llvm] [clang][X86] Reject register variables bound to status registers (PR #227576)

Akash Manna via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 10 03:55:01 PDT 2026


================
@@ -0,0 +1,21 @@
+; RUN: not llc -filetype=null -mtriple=x86_64-unknown-unknown %s 2>&1 | FileCheck %s
+
+; GH225033: {flags} is only valid as a clobber.
+
+; CHECK: error: could not allocate output register for constraint '{flags}'
----------------
akash-manna-sky wrote:

I don't think so. Sema only covers Clang's register variables; the constraint can also come straight from IR, and `={flags}` with an `i32` still dies with `Unable to copy EFLAGS physical register!` — EFLAGS can't be copied at all, so there is no value type for which it could work. The gate just makes `{flags}` behave like `{dirflag}` and `{fpsr}` below it.


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


More information about the cfe-commits mailing list