]> Cypherpunks repositories - gostls13.git/commit
[dev.ssa] cmd/compile/internal/ssa: handle returns correctly
authorKeith Randall <khr@golang.org>
Tue, 8 Sep 2015 23:04:37 +0000 (16:04 -0700)
committerKeith Randall <khr@golang.org>
Wed, 9 Sep 2015 04:19:14 +0000 (04:19 +0000)
commita7cfc759f2b03cb1155477d99384578f2910139c
tree5d6db8c55b14693b6b45808f3cf129467285c112
parent1c2975c305b2b2c32f2673c93ab51204c5a5bff5
[dev.ssa] cmd/compile/internal/ssa: handle returns correctly

Make sure that return blocks take a store as their control.  Without
this, code was getting inserted between the return and exit blocks.

Use AEND to mark the end of code.  The live variable analysis gets
confused when routines end like:
    JMP earlier
    RET
because the RET is unreachable.  The RET was incorrectly added to the
last basic block, rendering the JMP invisible to the CFG builder.

Change-Id: I91b32c8b37075347243ff039b4e4385856fba7cd
Reviewed-on: https://go-review.googlesource.com/14398
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
src/cmd/compile/internal/gc/plive.go
src/cmd/compile/internal/gc/ssa.go
src/cmd/compile/internal/ssa/check.go
src/cmd/compile/internal/ssa/gen/genericOps.go