]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: don't eliminate all registers when restricting to desired ones
authorKeith Randall <khr@google.com>
Tue, 30 Jul 2019 23:14:20 +0000 (16:14 -0700)
committerKeith Randall <khr@golang.org>
Thu, 1 Aug 2019 02:15:18 +0000 (02:15 +0000)
commit8a317ebc0f50339628c003bf06107cd865406dd4
tree1364c0115dfbaf21898b87f88cbe3b1b40addfc4
parent407010ef0b858a7fa6e6e95abe652fdff923da9a
cmd/compile: don't eliminate all registers when restricting to desired ones

We shouldn't mask to desired registers if we haven't masked out all the
forbidden registers yet.  In this path we haven't masked out the nospill
registers yet. If the resulting mask contains only nospill registers, then
allocReg fails.

This can only happen on resultNotInArgs-marked instructions, which exist
only on the ARM64, MIPS, MIPS64, and PPC64 ports.

Maybe there's a better way to handle resultNotInArgs instructions.
But for 1.13, this is a low-risk fix.

Fixes #33355

Change-Id: I1082f78f798d1371bde65c58cc265540480e4fa4
Reviewed-on: https://go-review.googlesource.com/c/go/+/188178
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/ssa/regalloc.go
test/fixedbugs/issue33355.go [new file with mode: 0644]