compiler: set captured variable address to nonescape until further flooded
authorIan Lance Taylor <ian@gcc.gnu.org>
Tue, 9 Jan 2018 23:43:23 +0000 (23:43 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Tue, 9 Jan 2018 23:43:23 +0000 (23:43 +0000)
commit4a59d4472b9a0a4c25c4483a03c71def7cb3aa8c
tree7caa556f1ebfcdaa15f65cd2e09266a79be3a052
parent47e8a22a179a53f681ab4e2478ffd62d01fb5f52
compiler: set captured variable address to nonescape until further flooded

    The escape analysis models closures by flowing captured variable
    address to the closure node. However, the escape state for the
    address expressions remained unset as ESCAPE_UNKNOWN. This
    caused later passes to conclude that the address escapes. Fix this by
    setting its escape state to ESCAPE_NONE first. If it escapes
    (because the closure escapes), the flood phase will set its
    escape state properly.

    Reviewed-on: https://go-review.googlesource.com/86240

From-SVN: r256411
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/escape.cc