mirror of
https://github.com/golang/go
synced 2024-10-05 18:21:21 -06:00
[dev.ssa] cmd/compile: handle OpCopy loops in rewrite
Change-Id: Icbaad6e5cbfc5430a651538fe90c0a9ee664faf4 Reviewed-on: https://go-review.googlesource.com/12360 Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
parent
c1593da817
commit
f421735bb4
@ -42,7 +42,10 @@ func applyRewrite(f *Func, rb func(*Block) bool, rv func(*Value, *Config) bool)
|
||||
if a.Op != OpCopy {
|
||||
continue
|
||||
}
|
||||
for a.Op == OpCopy {
|
||||
// Rewriting can generate OpCopy loops.
|
||||
// They are harmless (see removePredecessor),
|
||||
// but take care not to loop forever.
|
||||
for a.Op == OpCopy && a != a.Args[0] {
|
||||
a = a.Args[0]
|
||||
}
|
||||
v.Args[i] = a
|
||||
|
Loading…
Reference in New Issue
Block a user