Re: [PATCH v2] tsan: Add optional support for distinguishing volatiles

2020-06-09 Thread Jakub Jelinek via Gcc-patches
On Tue, Jun 09, 2020 at 12:01:24PM +0200, Marco Elver wrote: > > Do we need/want Optimization here? Optimization means the option is > > per-function, but to me whether you want to distinguish volatiles or not > > seems to be a global decision for the whole project. > > Adding Optimization here w

Re: [PATCH v2] tsan: Add optional support for distinguishing volatiles

2020-06-09 Thread Jakub Jelinek via Gcc-patches
On Tue, Jun 09, 2020 at 12:08:07PM +0200, Marco Elver wrote: > Just wanted to change this one, and noticed this > > > > +DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_VOLATILE_WRITE16, > > > "__tsan_volatile_write16", > > > + BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST) > > is precisely 80 ch

Re: [PATCH v2] tsan: Add optional support for distinguishing volatiles

2020-06-09 Thread Marco Elver via Gcc-patches
Just wanted to change this one, and noticed this > > +DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_VOLATILE_WRITE16, > > "__tsan_volatile_write16", > > + BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST) is precisely 80 characters. So if I read the style guide right, it's <= 80 chars (and not < 8

Re: [PATCH v2] tsan: Add optional support for distinguishing volatiles

2020-06-09 Thread Marco Elver via Gcc-patches
On Tue, 9 Jun 2020 at 11:50, Jakub Jelinek wrote: > > On Tue, Jun 09, 2020 at 09:48:34AM +0200, Marco Elver wrote: > > gcc/ > > * params.opt: Define --param=tsan-distinguish-volatile=[0,1]. > > * sanitizer.def (BUILT_IN_TSAN_VOLATILE_READ1): Define new > > builtin for volatile in

Re: [PATCH v2] tsan: Add optional support for distinguishing volatiles

2020-06-09 Thread Jakub Jelinek via Gcc-patches
On Tue, Jun 09, 2020 at 09:48:34AM +0200, Marco Elver wrote: > gcc/ > * params.opt: Define --param=tsan-distinguish-volatile=[0,1]. > * sanitizer.def (BUILT_IN_TSAN_VOLATILE_READ1): Define new > builtin for volatile instrumentation of reads/writes. > (BUILT_IN_TSAN_VOLATILE_

Re: [PATCH v2] tsan: Add optional support for distinguishing volatiles

2020-06-09 Thread Martin Liška
On 6/9/20 9:48 AM, Marco Elver wrote: v2: * Add Optimization keyword to -param=tsan-distinguish-volatile= as the parameter can be different per TU. * Add tree-dump check to test. Hello. I support the patch. @Jakub: Can you please approve the patch? Thanks, Martin

[PATCH v2] tsan: Add optional support for distinguishing volatiles

2020-06-09 Thread Marco Elver via Gcc-patches
Add support to optionally emit different instrumentation for accesses to volatile variables. While the default TSAN runtime likely will never require this feature, other runtimes for different environments that have subtly different memory models or assumptions may require distinguishing volatiles.