<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/griesemer/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/griesemer">@griesemer</a> suggested this was worth looking into, as does a TODO by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/rsc/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/rsc">@rsc</a> in syntax.go.</p>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/josharian/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/josharian">@josharian</a> described some initial attempts at this <a href="https://groups.google.com/d/msg/golang-dev/iOF44IL_i1M/CWI9U8XFKsEJ" rel="nofollow">last year on golang-dev</a>.  <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/rsc/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/rsc">@rsc</a> also pointed out that a nil <code class="notranslate">[]*Node</code> takes up 3x as much space as a nil <code class="notranslate">*NodeList</code>, so it might be desirable to use <code class="notranslate">*[]*Node</code> for variables that are commonly nil.</p>
<p dir="auto">I've been playing around with this with some success.  One small gotcha I've noticed is that the "Phase 2" and "Phase 3" typecheck calls can append new Nodes to xtop, so those phases must not use <code class="notranslate">range</code> iterations otherwise they'll stop prematurely without iterating over the newly appended Nodes.</p>
<p dir="auto">Filing an issue to track discussion/progress.</p>
<pre class="notranslate">1. What is a short input program that triggers the error?

package main
import "fmt"
func main() {
  lg := 1 &lt;&lt; 1
  i := 1 &lt;&lt; uint64(lg)
  fmt.Printf("i = %v\n", i)
}

Note that the program compiles just fine if you were to inline the value of 'lg' in the
following line.


2. What is the full compiler output?

bits.go:5: internal compiler error: agen OREGISTER


3. What version of the compiler are you using?  (Run it with the -V flag.)

8g version release.r57.1 8294</pre>