aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2024-08-09 13:11:03 -0700
committerGopher Robot <gobot@golang.org>2024-08-09 20:53:07 +0000
commit3de175f38348f82f6cc7bfb49c3609e72a5f8f41 (patch)
tree1a666776d37f21d977bb96e6431bbd929cc3ac2c /src
parentf259e4c916bcde5221dca99ce7d77095a21b9801 (diff)
downloadgo-3de175f38348f82f6cc7bfb49c3609e72a5f8f41.tar.xz
cmd/compile: in prove pass, check for unsat before adding local facts
Local facts can get us to unsatisfiable because there is an unconditional panic in the block. That shouldn't declare the whole block as unreachable, because we do still need to enter it to get that panic. Fixes #68816 Change-Id: I9220edb46089690702d2eb61d112815c7ac91f16 Reviewed-on: https://go-review.googlesource.com/c/go/+/604118 Reviewed-by: Keith Randall <khr@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com> Auto-Submit: Keith Randall <khr@golang.org>
Diffstat (limited to 'src')
-rw-r--r--src/cmd/compile/internal/ssa/prove.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cmd/compile/internal/ssa/prove.go b/src/cmd/compile/internal/ssa/prove.go
index d563204565..7c95922f4d 100644
--- a/src/cmd/compile/internal/ssa/prove.go
+++ b/src/cmd/compile/internal/ssa/prove.go
@@ -1501,9 +1501,6 @@ func prove(f *Func) {
addBranchRestrictions(ft, parent, branch)
}
- // Add facts about the values in the current block.
- addLocalFacts(ft, node.block)
-
if ft.unsat {
// node.block is unreachable.
// Remove it and don't visit
@@ -1516,6 +1513,9 @@ func prove(f *Func) {
// taking this branch. We'll restore
// ft when we unwind.
+ // Add facts about the values in the current block.
+ addLocalFacts(ft, node.block)
+
work = append(work, bp{
block: node.block,
state: simplify,