diff options
author | Cherry Zhang <cherryyz@google.com> | 2021-03-01 19:23:42 -0500 |
---|---|---|
committer | Cherry Zhang <cherryyz@google.com> | 2021-03-05 22:42:10 +0000 |
commit | a22bd3dc73bfcc9bf37cbd651933c54c82799c2a (patch) | |
tree | 2267b7432854ef635c3a5855136dce03a9d3d18a /src/cmd/compile/internal/base | |
parent | a829114b21b5a4238dea13dc97b030d650935ed8 (diff) | |
download | go-a22bd3dc73bfcc9bf37cbd651933c54c82799c2a.tar.gz go-a22bd3dc73bfcc9bf37cbd651933c54c82799c2a.zip |
cmd/compile: use getcallerpc for racefuncentry
Currently, when instrumenting for the race detector, the compiler
inserts racefuncentry/racefuncentryfp at the entry of instrumented
functions. racefuncentry takes the caller's PC. On AMD64, we synthesize
a node which points to -8(FP) which is where the return address is
stored. Later this node turns to a special Arg in SSA that is not
really an argument. This causes problems in the new ABI work so that
special node has to be special-cased.
This CL changes the special node to a call to getcallerpc, which lowers
to an intrinsic in SSA. This also unifies AMD64 code path and LR machine
code path, as getcallerpc works on all platforms.
Change-Id: I1377e140b91e0473cfcadfda221f26870c1b124d
Reviewed-on: https://go-review.googlesource.com/c/go/+/297929
Trust: Cherry Zhang <cherryyz@google.com>
Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/cmd/compile/internal/base')
-rw-r--r-- | src/cmd/compile/internal/base/base.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/base/base.go b/src/cmd/compile/internal/base/base.go index 3b9bc3a8af..4c2516f60e 100644 --- a/src/cmd/compile/internal/base/base.go +++ b/src/cmd/compile/internal/base/base.go @@ -70,6 +70,6 @@ var NoInstrumentPkgs = []string{ "internal/cpu", } -// Don't insert racefuncenterfp/racefuncexit into the following packages. +// Don't insert racefuncenter/racefuncexit into the following packages. // Memory accesses in the packages are either uninteresting or will cause false positives. var NoRacePkgs = []string{"sync", "sync/atomic"} |