aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2021-07-02 15:46:51 -0700
committerMatthew Dempsky <mdempsky@google.com>2021-07-02 16:03:51 -0700
commitf35d86fd5febaa32a9a28b3a35bffaff43bc89bd (patch)
tree7b163c6f98a806ac72410bfa14aeef4fd42a012e /src/cmd/compile/internal/ssa
parentb994cc69e05d7821a08f75619f356ecfe5ca9b43 (diff)
parent912f0750472dd4f674b69ca1616bfaf377af1805 (diff)
downloadgo-f35d86fd5febaa32a9a28b3a35bffaff43bc89bd.tar.gz
go-f35d86fd5febaa32a9a28b3a35bffaff43bc89bd.zip
[dev.typeparams] all: merge master (912f075) into dev.typeparams
Conflicts: - src/cmd/compile/internal/escape/escape.go On master, CL 332230 changed the ">=" in HeapAllocReason to ">"; but on dev.typeparams, CL 329989 moved HeapAllocReason into utils.go. Merge List: + 2021-07-02 912f075047 net/http: mention socks5 support in proxy + 2021-07-02 287c5e8066 cmd/compile: fix stack growing algorithm + 2021-07-02 743f03eeb0 spec, unsafe: clarify unsafe.Slice docs + 2021-07-02 6125d0c426 cmd/dist: correct comment: SysProcAttri -> SysProcAttr + 2021-07-01 03761ede02 net: don't reject null mx records + 2021-07-01 877688c838 testing: add TB.Setenv + 2021-07-01 ef8ae82b37 cmd/compile: fix bug in dwarf-gen var location generation + 2021-07-01 770899f7e1 cmd/go: add a regression test for 'go mod vendor' path traversal + 2021-07-01 835d86a17e cmd/go: use path.Dir instead of filepath.Dir for package paths in 'go mod vendor' + 2021-07-01 eb437ba92c cmd/compile: make stack value size threshold comparisons consistent + 2021-07-01 9d65578b83 cmd/compile: fix typos in document Change-Id: I08aa852441af0f070aa32dd2f99b6fa4e9d79cfa
Diffstat (limited to 'src/cmd/compile/internal/ssa')
-rw-r--r--src/cmd/compile/internal/ssa/debug.go19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/cmd/compile/internal/ssa/debug.go b/src/cmd/compile/internal/ssa/debug.go
index eaa94975ec..8e2872363b 100644
--- a/src/cmd/compile/internal/ssa/debug.go
+++ b/src/cmd/compile/internal/ssa/debug.go
@@ -1115,8 +1115,14 @@ func (state *debugState) buildLocationLists(blockLocs []*BlockDebug) {
continue
}
+ mustBeFirst := func(v *Value) bool {
+ return v.Op == OpPhi || v.Op.isLoweredGetClosurePtr() ||
+ v.Op == OpArgIntReg || v.Op == OpArgFloatReg
+ }
+
zeroWidthPending := false
- apcChangedSize := 0 // size of changedVars for leading Args, Phi, ClosurePtr
+ blockPrologComplete := false // set to true at first non-zero-width op
+ apcChangedSize := 0 // size of changedVars for leading Args, Phi, ClosurePtr
// expect to see values in pattern (apc)* (zerowidth|real)*
for _, v := range b.Values {
slots := state.valueNames[v.ID]
@@ -1125,16 +1131,16 @@ func (state *debugState) buildLocationLists(blockLocs []*BlockDebug) {
if opcodeTable[v.Op].zeroWidth {
if changed {
- if hasAnyArgOp(v) || v.Op == OpPhi || v.Op.isLoweredGetClosurePtr() {
+ if mustBeFirst(v) || v.Op == OpArg {
// These ranges begin at true beginning of block, not after first instruction
- if zeroWidthPending {
- panic(fmt.Errorf("Unexpected op '%s' mixed with OpArg/OpPhi/OpLoweredGetClosurePtr at beginning of block %s in %s\n%s", v.LongString(), b, b.Func.Name, b.Func))
+ if blockPrologComplete && mustBeFirst(v) {
+ panic(fmt.Errorf("Unexpected placement of op '%s' appearing after non-pseudo-op at beginning of block %s in %s\n%s", v.LongString(), b, b.Func.Name, b.Func))
}
apcChangedSize = len(state.changedVars.contents())
+ // Other zero-width ops must wait on a "real" op.
+ zeroWidthPending = true
continue
}
- // Other zero-width ops must wait on a "real" op.
- zeroWidthPending = true
}
continue
}
@@ -1145,6 +1151,7 @@ func (state *debugState) buildLocationLists(blockLocs []*BlockDebug) {
// Not zero-width; i.e., a "real" instruction.
zeroWidthPending = false
+ blockPrologComplete = true
for i, varID := range state.changedVars.contents() {
if i < apcChangedSize { // buffered true start-of-block changes
state.updateVar(VarID(varID), v.Block, BlockStart)