]> Cypherpunks repositories - gostls13.git/commit
[dev.ssa] cmd/compile: fix spill sizes
authorKeith Randall <khr@golang.org>
Mon, 4 Jan 2016 21:34:54 +0000 (13:34 -0800)
committerKeith Randall <khr@golang.org>
Wed, 13 Jan 2016 18:39:15 +0000 (18:39 +0000)
commit9094e3ada2de3cc8129b70730c2c0782a4040201
treef14eaad87729d614af5ecc554d6c30e119dc7202
parent035fcc0c4d0354adb1a8c837035f4ef3426bb5ed
[dev.ssa] cmd/compile: fix spill sizes

In code that does:

    var x, z int32
    var y int64
    z = phi(x, int32(y))

We silently drop the int32 cast because truncation is a no-op.
The phi operation needs to make sure it uses the size of the
phi, not the size of its arguments, when generating spills.

Change-Id: I1f7baf44f019256977a46fdd3dad1972be209042
Reviewed-on: https://go-review.googlesource.com/18390
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/gc/ssa.go
src/cmd/compile/internal/gc/ssa_test.go
src/cmd/compile/internal/gc/testdata/phi_ssa.go [new file with mode: 0644]
src/cmd/compile/internal/ssa/regalloc.go