llvm.org GIT mirror llvm / 4247b13
[msan] Do not insert check on volatile store. Volatile bitfields can cause valid stores of uninitialized bits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173153 91177308-0d34-0410-b5e6-96231b3b80d8 Evgeniy Stepanov 6 years ago
2 changed file(s) with 15 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
450450 IRB.CreateAlignedStore(Shadow, ShadowPtr, I.getAlignment());
451451 DEBUG(dbgs() << " STORE: " << *NewSI << "\n");
452452 (void)NewSI;
453 // If the store is volatile, add a check.
454 if (I.isVolatile())
455 insertCheck(Val, &I);
453
456454 if (ClCheckAccessAddress)
457455 insertCheck(Addr, &I);
458456
846844 ///
847845 /// Stores the corresponding shadow and (optionally) origin.
848846 /// Optionally, checks that the store address is fully defined.
849 /// Volatile stores check that the value being stored is fully defined.
850847 void visitStoreInst(StoreInst &I) {
851848 StoreList.push_back(&I);
852849 }
562562 ; CHECK: @VACopy
563563 ; CHECK: call void @llvm.memset.p0i8.i64({{.*}}, i8 0, i64 24, i32 8, i1 false)
564564 ; CHECK: ret void
565
566
567 ; Test handling of volatile stores.
568 ; Check that MemorySanitizer does not add a check of the value being stored.
569
570 define void @VolatileStore(i32* nocapture %p, i32 %x) nounwind uwtable {
571 entry:
572 store volatile i32 %x, i32* %p, align 4
573 ret void
574 }
575
576 ; CHECK: @VolatileStore
577 ; CHECK-NOT: @__msan_warning
578 ; CHECK: ret void