compiler: update iota handling, fix using iota in array length

CL 71750 changed the definition of how iota works.  This patch updates
gccgo for the new definition.

We've been mishandling iota appearing in a type that appears in a
const expression, as in `c = len([iota]int{})`.  Correct that by copying
type expressions when we copy an expression.  For simplicity only copy
when it can change the size of a type, as that is the only case where
iota in a type can affect the value of a constant (I think).  This is
still a bunch of changes, but almost all boilerplate.

Fixes golang/go#22341

Change-Id: I7c96215ec0c373434facf2564e2911314b9e36ad
Reviewed-on: https://go-review.googlesource.com/91475
Reviewed-by: Than McIntosh <thanm@google.com>
6 files changed