You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cmd/compile: recent regression in ppc64x builders: internal compiler error: pointer in non-pointer register g #25504
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (go env)?
ppc64 & ppc64le
A regression was introduced earlier today which then hid 2 more regressions introduced after which affect the ppc64 & ppc64le builders. The first two were fixed, now seeing this:
--- FAIL: TestCoverpkgAllRuntime (7.07s)
go_test.go:6004: running testgo [test -coverpkg=all x]
go_test.go:6004: standard output:
go_test.go:6004: FAIL x [build failed]
Assuming this is related to the reg changes that have been just added?
It is. @dr2chase has been digging into the cause of this, which is quite peculiar. For some reason we're spilling the g register to the stack and then reloading it back into the g register, which is completely ridiculous and quite possible unsafe (e.g., if there's a setg between the spill and the reload, this would clobber it's effect).
I might temporarily ignore the g register in liveness analysis, just to get the build green again.
I think I understand what's going on, though not completely.
The two moving parts are in runtime/proc.go.
On line 4079: _g_ := getg()
which end up producing this assembly language (line number is off-by-one, sigh):
I.e., _g_ gets register-allocated to the g register.
And then, a few blocks later:
v1210 00572 (4106) CALL "".runqempty(SB)
which clobbers all the registers, including the one with _g_ in it (which is g).
Because _g_ is live in the same loop, it is subsequently reloaded (into g) to be an input to the phi function at the top of the loop. It appears that the register allocator is just following orders.
Activity
aclements commentedon May 22, 2018
It is. @dr2chase has been digging into the cause of this, which is quite peculiar. For some reason we're spilling the g register to the stack and then reloading it back into the g register, which is completely ridiculous and quite possible unsafe (e.g., if there's a setg between the spill and the reload, this would clobber it's effect).
I might temporarily ignore the g register in liveness analysis, just to get the build green again.
/cc @khr
gopherbot commentedon May 22, 2018
Change https://golang.org/cl/114081 mentions this issue:
cmd/compile: ignore g register in liveness analysiscmd/compile: ignore g register in liveness analysis
gopherbot commentedon May 23, 2018
Change https://golang.org/cl/114087 mentions this issue:
Revert "cmd/compile: ignore g register in liveness analysis"dr2chase commentedon May 24, 2018
I think I understand what's going on, though not completely.
The two moving parts are in runtime/proc.go.
On line 4079:
_g_ := getg()which end up producing this assembly language (line number is off-by-one, sigh):
I.e.,
_g_gets register-allocated to the g register.And then, a few blocks later:
which clobbers all the registers, including the one with
_g_in it (which is g).Because
_g_is live in the same loop, it is subsequently reloaded (into g) to be an input to the phi function at the top of the loop. It appears that the register allocator is just following orders.The SSA dump after trim:
gopherbot commentedon May 25, 2018
Change https://golang.org/cl/114695 mentions this issue:
cmd/compile: do not allow regalloc to LoadReg G registerRevert "cmd/compile: ignore g register in liveness analysis"