[clang] [clang] Bind the __builtin_bit_cast operand as std::bit_cast binds its parameter (PR #231830)

via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 18 15:53:19 PDT 2026


================
@@ -2658,6 +2658,8 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) {
     Address Addr =
         SourceLVal.getAddress().withElementType(CGF.ConvertTypeForMem(DestTy));
     LValue DestLV = CGF.MakeAddrLValue(Addr, DestTy);
+    if (SourceLVal.isVolatileQualified())
+      DestLV.getQuals().addVolatile();
----------------
Nemi26 wrote:

This emits one volatile load of the operand's size, typed as the destination (an i64 load from a volatile double). The access width matches GCC's; only the instruction class differs. If matching GCC's `movsd` matters, I can load as `From` and bitcast the value instead.

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


More information about the cfe-commits mailing list