compiler: eliminate bound checks in append expression
authorIan Lance Taylor <ian@gcc.gnu.org>
Fri, 15 Mar 2019 04:34:43 +0000 (04:34 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Fri, 15 Mar 2019 04:34:43 +0000 (04:34 +0000)
commitb1403b691a24fae2a96fa7ce5b93c3395e7bfd05
tree9000ae815c21bbe19c77f3316301fd75964c6e93
parent928499cfeee9cba7cc63e4c8547f88306d8d45fb
compiler: eliminate bound checks in append expression

    The compiler generates two array index expressions when lowering
    an append expression. Currently they generate bound checks.
    Bound checks are not necessary in this case, as we know the slice
    has, or will grow to, enough length and capacity. Eliminate them.

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/166817

From-SVN: r269699
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/expressions.cc
gcc/go/gofrontend/expressions.h