On Fri, Jun 12, 2020 at 09:21:59AM +0200, Marco Elver wrote: > Adds param tsan-instrument-func-entry-exit, which controls if > __tsan_func_{entry,exit} calls should be emitted or not. The default > behaviour is to emit the calls.
If you want that, I wonder if the spots you've chosen are the best ones. E.g. shouldn't if (sanitize_flags_p (SANITIZE_THREAD)) { gcall *call = gimple_build_call_internal (IFN_TSAN_FUNC_EXIT, 0); ... in gimplify.c have this && param_tsan_instrument_func_entry_exit, so that we don't waste a call or several in every function when we are going to dump them all? And in tsan.c, perhaps instead of changing instrument_gimple twice change: fentry_exit_instrument |= instrument_gimple (&gsi); to: fentry_exit_instrument |= (instrument_gimple (&gsi) && param_tsan_instrument_func_entry_exit); ? > gcc/ChangeLog: > > * params.opt: Add --param=tsan-instrument-func-entry-exit=. > * tsan.c (instrument_gimple): Make return value if > func entry and exit should be instrumented dependent on > param. No tab + 2 spaces please, the further lines should be just tab indented. And s/ / /. Jakub