compiler: don't incorrectly evaluate range variable
commitc29f17b3d045bc3993ced68c3749461d75f05715
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 2 Feb 2018 13:44:41 +0000 (2 13:44 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 2 Feb 2018 13:44:41 +0000 (2 13:44 +0000)
tree5f72113b0c35cb7b1853573e3576880530b3dca3
parent4a7580c47cdef5be55b99c318d90713bb8bbf099
compiler: don't incorrectly evaluate range variable

    The language spec says that in `for i = range x`, in which there is no
    second iteration variable, if len(x) is constant, then x is not
    evaluated.  This only matters when x is an expression that panics but
    whose type is an array type; in such a case, we should not evaluate x,
    since len of any array type is a constant.

    Fixes golang/go#22313

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257330 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/statements.cc