diff options
| author | Daniel Morsing <daniel.morsing@gmail.com> | 2015-06-14 23:06:39 +0100 |
|---|---|---|
| committer | Daniel Morsing <daniel.morsing@gmail.com> | 2015-06-15 12:06:05 +0000 |
| commit | 3b817ef8f8e377e741ffa94ff3a5154bebe206cd (patch) | |
| tree | 678ef32f00a8ba49e4e605602ad1c136756fef41 /src/cmd/compile/internal | |
| parent | c31b6dd0be202698a142568d8a8762db74b4516d (diff) | |
| download | go-3b817ef8f8e377e741ffa94ff3a5154bebe206cd.tar.xz | |
[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/11073
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/compile/internal')
| -rw-r--r-- | src/cmd/compile/internal/ssa/cse.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/cmd/compile/internal/ssa/cse.go b/src/cmd/compile/internal/ssa/cse.go index aba24aeabc..660712612a 100644 --- a/src/cmd/compile/internal/ssa/cse.go +++ b/src/cmd/compile/internal/ssa/cse.go @@ -26,15 +26,16 @@ func cse(f *Func) { // Make initial partition based on opcode/type/aux/nargs // TODO(khr): types are not canonical, so we may split unnecessarily. Fix that. type key struct { - op Op - typ Type - aux interface{} - nargs int + op Op + typ Type + aux interface{} + auxint int64 + nargs int } m := map[key]eqclass{} for _, b := range f.Blocks { 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) } } |
