cmd/compile: stack load line numbers wrong in non-regabi backend #60673
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
Here's a little program:
GOARCH=amd64 go tool compile -S
on amd64 produces:Note the inlined call to alloc at 0x000f (line 7) with the inlining mark (XCHGL AX, AX) above it.
No other inlining here.
Note in particular that between the two
CALL main.do
at 0x002b there is a reload ofx
frommain..autotmp_3
and it is attributed to line 12, because it is the setup for the next call on line 12.GOARCH=386 go tool compile -S
produces:Note the same inlining at 0x0016. But then note the LEAL/MOVL reloading
x
at 0x0032. It is attributed to line 7, the implementation of alloc, instead of to the setup for the next call. It says x.go:7 instead of x.go:12 like the GOARCH=amd64 one.This inconsistency is part of a problem I'm seeing with runtime.CallersFrames applied to the result of runtime.Callers.
It's not the most direct problem, though: using runtime.CallersFrames on runtime.Callers should not care about the line number of that instruction at all!
The text was updated successfully, but these errors were encountered: