]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: turn jump tables off with -N
authorKeith Randall <khr@golang.org>
Thu, 14 Apr 2022 22:04:34 +0000 (15:04 -0700)
committerGopher Robot <gobot@golang.org>
Fri, 15 Apr 2022 00:53:40 +0000 (00:53 +0000)
commit78bea702cd38ac5004a97f110e7f659336a04d57
treefd3d9603c490981e92ae644b67027f95b3191bcd
parentcc43e191ce562cd879a9baaf7a2e4fb1a7216d31
cmd/compile: turn jump tables off with -N

The noopt builder is broken, because with -N we get two OpSB opcodes
(one for the function as a whole, one introduced by the jumptable
rewrite rule), and they fight each other for a register.

Without -N, the two OpSB get CSEd, so optimized builds are ok.

Maybe we fix regalloc to deal with this case, but it's simpler
(and maybe more correct?) to disable jump tables with -N.

Change-Id: I75c87f12de6262955d1df787f47c53de976f8a5f
Reviewed-on: https://go-review.googlesource.com/c/go/+/400455
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Keith Randall <khr@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
src/cmd/compile/internal/walk/switch.go