Commit 3b817ef8 authored by Daniel Morsing's avatar Daniel Morsing

[dev.ssa] fix equivalence class after aux/auxint refactor.

This caused the following code snippet to be miscompiled

	var f int
	x := g(&f)
	f = 10

Moving the store of 10 above the function call.

Change-Id: Ic6951f5e7781b122cd881df324a38e519d6d66f0
Reviewed-on: https://go-review.googlesource.com/11073Reviewed-by: 's avatarKeith Randall <khr@golang.org>
parent c31b6dd0
...@@ -29,12 +29,13 @@ func cse(f *Func) { ...@@ -29,12 +29,13 @@ func cse(f *Func) {
op Op op Op
typ Type typ Type
aux interface{} aux interface{}
auxint int64
nargs int nargs int
} }
m := map[key]eqclass{} m := map[key]eqclass{}
for _, b := range f.Blocks { for _, b := range f.Blocks {
for _, v := range b.Values { for _, v := range b.Values {
k := key{v.Op, v.Type, v.Aux, len(v.Args)} k := key{v.Op, v.Type, v.Aux, v.AuxInt, len(v.Args)}
m[k] = append(m[k], v) m[k] = append(m[k], v)
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment