[clang] [Clang] Fix assertion failure (#189260) (PR #189305)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 30 06:25:36 PDT 2026


================
@@ -2781,6 +2756,10 @@ void CodeGenFunction::EmitStoreThroughLValue(RValue Src, LValue Dst,
             Builder.getInt1Ty(), IRStoreTy->getPrimitiveSizeInBits());
         Vec = Builder.CreateBitCast(Vec, IRVecTy);
         // iN --> <N x i1>.
+
+        if(SrcVal->getType() != Builder.getInt1Ty())
+            SrcVal = Builder.CreateTrunc(SrcVal,Builder.getInt1Ty());
----------------
AaronBallman wrote:

In the issue, @jhuber6 suggested using `CreateBitCast`; is there a reason for a trunc instead?

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


More information about the cfe-commits mailing list