cmd/compile: //go:norace should prohibit inlining into functions that will be instrumented #24651
Currently, compiling this package:
with "-S -race" shows that g is inlined into F, and the pointer assignment is instrumented with a race detector call, which seemingly defeats the intention of adding //go:norace.
Probably the easiest solution is that when instrumenting, we should treat //go:norace functions as non-inlinable.
Even better would be to avoid inlining //go:norace function calls only into instrumented functions (similar to how CL 102815 still allows inlining runtime calls within package runtime even during instrumented builds), but that would require tracking the //go:norace pragma across compilation units, which is a bit more involved.
The text was updated successfully, but these errors were encountered: