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.

Change-Id: I6d29cf0b29e0561a2f8fc14f958c29129bf30a0e
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/166817
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2 files changed