]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix x=x assignments
authorKeith Randall <khr@golang.org>
Fri, 1 Apr 2016 18:05:30 +0000 (11:05 -0700)
committerKeith Randall <khr@golang.org>
Wed, 6 Apr 2016 15:04:32 +0000 (15:04 +0000)
commit309144b7f1090cbc7c3a90eb252d20a939caf398
tree3cfd99f07ba7ddfd9c1520f989c8ba84d4512207
parent5c7ae10f66eae34b8a786fc2fdf753bf48a3d116
cmd/compile: fix x=x assignments

No point in doing anything for x=x assignments.
In addition, skipping these assignments prevents generating:
    VARDEF x
    COPY x -> x
which is bad because x is incorrectly considered
dead before the vardef.

Fixes #14904

Change-Id: I6817055ec20bcc34a9648617e0439505ee355f82
Reviewed-on: https://go-review.googlesource.com/21470
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
src/cmd/compile/internal/gc/ssa.go
src/cmd/compile/internal/gc/ssa_test.go
src/cmd/compile/internal/gc/testdata/namedReturn.go [new file with mode: 0644]
test/live_ssa.go