https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55561

--- Comment #53 from Dmitry Vyukov <dvyukov at google dot com> ---
If we instrument libgomp with tsan, this can introduce lots of extraneous
synchronization which is useful only for verification of libgomp itself, but
harmful for libgomp users (as it will lead to false positives).

What can be useful (but not top priority if nobody complains) is to insert some
manual annotations for tsan into libgomp. I don't know enough about libgomp
internals and have not used libgomp+tsan, so don't know what exactly they must
do. But potentially they can do:
1. Tell tsan about accesses to user memory. I.e. if libgomp still accesses some
user memory in some cases, then can tell tsan about that.
2. Tell tsan about precise synchronization model for user. E.g. I suspect that
interactions with scheduler in parallel for construct synchronize all user
threads (if the scheduler calls pthread_mutex_lock/unlock); this
synchronization can lead to false positives in user programs. We can suppress
that synchronization and instead tell tsan what is the documented
synchronization guarantees for user.
3. Improve reports.

Reply via email to