This is an archive of the discontinued LLVM Phabricator instance.

Remove a couple of memset usages from TSan, introduced in r288624.
ClosedPublic

Authored by sammccall on Dec 5 2016, 5:28 AM.

Details

Reviewers
dvyukov
Summary

TSan runtime shouldn't contain memset, so internal_memset is used instead and
syntax that emits memset is avoided.

This doesn't fail in-tree due to TSan being build with -03, but it fails
when TSan is built with -O0, and is (I think) a true positive.

Event Timeline

sammccall updated this revision to Diff 80254.Dec 5 2016, 5:28 AM
sammccall retitled this revision from to Remove a couple of memset usages from TSan, introduced in r288624..
sammccall updated this object.
sammccall added a reviewer: dvyukov.
sammccall added a subscriber: llvm-commits.
dvyukov accepted this revision.Dec 5 2016, 5:45 AM
dvyukov edited edge metadata.

LGTM

This revision is now accepted and ready to land.Dec 5 2016, 5:45 AM
djasper closed this revision.Dec 5 2016, 6:48 AM
djasper added a subscriber: djasper.

Submitted as r288672.

Do we have a way to catch this? Something I should have done before submitting this change?

Also, why don't we build with -ffreestanding? Shouldn't that prevent all such calls?

You need to reconfigure with -DCOMPILER_RT_DEBUG=ON to get -O0 build.
There is no way to stop llvm from emitting calls to memset/memcpy. -ffreestanding does not help.