On 12/14/20 3:09 AM, Martin Liška wrote:
> On 12/10/20 4:50 PM, Martin Sebor wrote:
>> Most similar warnings mention the sanitizer option rather than
>> referring to the tool by name.  E.g.,
>>
>>    "transactional memory is not supported withÂ
>> %<-fsanitize=address%>"
>> or
>>
>>    "%<-fsanitize=leak%> is incompatible with %<-fsanitize=thread%>"
>>
>> For the sake of consistency (and also to provide a bit ofÂ
>> additional
>> detail) I would suggest to follow that style.
>>
>> Martin
>
> Thank you Martin for the useful feedback.
>
> I've just tested the updated patch.
>
> Martin
>
> 0001-Add-Wtsan.patch
>
> From 7c982d06749fd3650825a5fb417e5e3487ecbcaf Mon Sep 17 00:00:00 2001
> From: Martin Liska <mli...@suse.cz>
> Date: Mon, 7 Dec 2020 15:55:59 +0100
> Subject: [PATCH] Add -Wtsan.
>
> gcc/ChangeLog:
>
> PR sanitizer/97868
> * common.opt: Add new warning -Wtsan.
> * doc/invoke.texi: Likewise.
> * tsan.c (instrument_builtin_call): Warn users about unsupported
> std::atomic_thread_fence.
>
> gcc/testsuite/ChangeLog:
>
> PR sanitizer/97868
> * gcc.dg/tsan/atomic-fence.c: New test.
OK.  Please consider a more through description in invoke.texi
though.  What unsupported feature are we warning about and what are the
consequences of not supporting that feature.
jeff