This is an archive of the discontinued LLVM Phabricator instance.

Fix data race in X86FloatingPoint.cpp ASSERT_SORTED
ClosedPublic

Authored by inglorion on Apr 17 2018, 3:49 PM.

Details

Summary

ASSERT_SORTED checks if a table is sorted, and uses a boolean to
prevent the check from being run again if it was earlier determined
that the table is in fact sorted. Unsynchronized reads and writes of
that boolean triggered ThreadSanitizer's data race detection. This
change rewrites the code to use std::atomic<bool> instead.

Fixes PR36922.

Diff Detail

Repository
rL LLVM

Event Timeline

inglorion created this revision.Apr 17 2018, 3:49 PM
rnk accepted this revision.Apr 18 2018, 1:16 PM

lgtm

This revision is now accepted and ready to land.Apr 18 2018, 1:16 PM
This revision was automatically updated to reflect the committed changes.