mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: in cse, allow for new ssa values
The table of rewrites in ssa/cse is not sized appropriately for ssa IDs that are created during copying of selects into new blocks. Fixes #17918 Change-Id: I65fe86c6aab5efa679aa473aadc4ee6ea882cd41 Reviewed-on: https://go-review.googlesource.com/33240 Reviewed-by: Cherry Zhang <cherryyz@google.com> Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
277bcbbdcd
commit
a34fddf46c
2 changed files with 45 additions and 1 deletions
|
|
@ -188,7 +188,10 @@ func cse(f *Func) {
|
|||
for _, b := range f.Blocks {
|
||||
out:
|
||||
for _, v := range b.Values {
|
||||
if rewrite[v.ID] != nil {
|
||||
// New values are created when selectors are copied to
|
||||
// a new block. We can safely ignore those new values,
|
||||
// since they have already been copied (issue 17918).
|
||||
if int(v.ID) >= len(rewrite) || rewrite[v.ID] != nil {
|
||||
continue
|
||||
}
|
||||
if v.Op != OpSelect0 && v.Op != OpSelect1 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue