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 was Martin's suggestion. I'm fine either way > and just wanted to err on the conservative side.
We've discussed it with Martin and the end result is that it shouldn't be Optimization, because we don't want to support mixing it. Essentially, it is an ABI decision of the tsan implementation, which can be only one in the whole process, because if somebody tries to mix code that distinguishes them and other that doesn't, one still needs to use an implementation that does distinguish them and will assume that code that was built without --param=tsan-distinguish-volatile=1 is never using volatiles, even when it means we don't know as the information is lost. Note, for LTO that will mean the param needs to be specified on the link line too. Jakub