From: Than McIntosh Date: Tue, 14 Nov 2017 18:56:18 +0000 (-0500) Subject: cmd/compile: ignore RegKill ops for non-phi after phi check X-Git-Tag: go1.10beta1~185 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=63ef3cde335e5b46fc3c8027b5e2f474a26717e8;p=gostls13.git cmd/compile: ignore RegKill ops for non-phi after phi check Relax the 'phi after non-phi' SSA sanity check to allow RegKill ops interspersed with phi ops in a block. This fixes a sanity check failure when -dwarflocationlists is enabled. Updates #22694. Change-Id: Iaae604ab6f1a8b150664dd120003727a6fb2f698 Reviewed-on: https://go-review.googlesource.com/77610 Run-TryBot: Than McIntosh TryBot-Result: Gobot Gobot Reviewed-by: David Chase --- diff --git a/src/cmd/compile/internal/ssa/check.go b/src/cmd/compile/internal/ssa/check.go index fad57970d0..d0d1a7b912 100644 --- a/src/cmd/compile/internal/ssa/check.go +++ b/src/cmd/compile/internal/ssa/check.go @@ -456,11 +456,16 @@ func memCheck(f *Func) { for _, b := range f.Blocks { seenNonPhi := false for _, v := range b.Values { - if v.Op == OpPhi { + switch v.Op { + case OpPhi: if seenNonPhi { f.Fatalf("phi after non-phi @ %s: %s", b, v) } - } else { + case OpRegKill: + if f.RegAlloc == nil { + f.Fatalf("RegKill seen before register allocation @ %s: %s", b, v) + } + default: seenNonPhi = true } }