This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] tell gcc optimizer to never introduce new data races
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Peter Zijlstra <peterz at infradead dot org>
- Cc: Marek Polacek <polacek at redhat dot com>, Jiri Kosina <jkosina at suse dot cz>, Linus Torvalds <torvalds at linux-foundation dot org>, "Paul E. McKenney" <paulmck at linux dot vnet dot ibm dot com>, Andrew Morton <akpm at linux-foundation dot org>, Martin Jambor <mjambor at suse dot cz>, Petr Mladek <pmladek at suse dot cz>, linux-kernel at vger dot kernel dot org, gcc at gcc dot gnu dot org
- Date: Tue, 10 Jun 2014 17:17:35 +0200
- Subject: Re: [PATCH] tell gcc optimizer to never introduce new data races
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LNX dot 2 dot 00 dot 1406101517300 dot 9378 at pobox dot suse dot cz> <20140610145327 dot GJ6758 at twins dot programming dot kicks-ass dot net> <20140610150455 dot GC7335 at redhat dot com> <20140610151329 dot GL6758 at twins dot programming dot kicks-ass dot net>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Jun 10, 2014 at 05:13:29PM +0200, Peter Zijlstra wrote:
> On Tue, Jun 10, 2014 at 05:04:55PM +0200, Marek Polacek wrote:
> > On Tue, Jun 10, 2014 at 04:53:27PM +0200, Peter Zijlstra wrote:
> > > On Tue, Jun 10, 2014 at 03:23:36PM +0200, Jiri Kosina wrote:
> > > > +# Tell gcc to never replace conditional load with a non-conditional one
> > > > +KBUILD_CFLAGS += $(call cc-option,--param allow-store-data-races=0)
> > > > +
> > >
> > > Why do we not want: -fmemory-model=safe? And should we not at the very
> > > least also disable packed-store-data-races?
> > Note that the option does not exist, even though it is mentioned in the
> > documentation.
> Urgh.. ok. Any word on the packed-store-data thing?
That is recognized, undocumented and never used in the compiler (not in 4.7
or any later release till now). Most of the spots in the compiler that
could introduce data races were actually just changed, there is (already
since 4.7) just a single conditional on the --param allow-store-data-races=X