aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/check.go
diff options
context:
space:
mode:
authorThan McIntosh <thanm@google.com>2017-11-14 13:56:18 -0500
committerThan McIntosh <thanm@google.com>2017-11-21 18:14:52 +0000
commit63ef3cde335e5b46fc3c8027b5e2f474a26717e8 (patch)
treee80f4a9edaa7fa19d06838cc4f03cc4dc633576d /src/cmd/compile/internal/ssa/check.go
parent4fbf54fa0a4532753d2aac880e6d91202899a54e (diff)
downloadgo-63ef3cde335e5b46fc3c8027b5e2f474a26717e8.tar.gz
go-63ef3cde335e5b46fc3c8027b5e2f474a26717e8.zip
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 <thanm@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/cmd/compile/internal/ssa/check.go')
-rw-r--r--src/cmd/compile/internal/ssa/check.go9
1 files changed, 7 insertions, 2 deletions
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
}
}