Descriptioncmd/5g, cmd/6g: fix out of registers with array indexing.
Compiling expressions like:
s[s[s[s[s[s[s[s[s[s[s[s[i]]]]]]]]]]]]
make 5g and 6g run out of registers. Such expressions can arise
if a slice is used to represent a permutation and the user wants
to iterate it.
This is due to the usual problem of allocating registers before
going down the expression tree, instead of allocating them in a
postfix way.
The functions cgenr and agenr (that generate a value to a newly
allocated register instead of an existing location), are either
introduced or modified when they already existed to allocate
the new register as late as possible, and sudoaddable is disabled
for OINDEX nodes so that igen/agenr is used instead.
Update issue 4207.
Patch Set 1 #Patch Set 2 : diff -r 11f0ba3b7006 https://go.googlecode.com/hg/ #Patch Set 3 : diff -r 11f0ba3b7006 https://go.googlecode.com/hg/ #Patch Set 4 : diff -r 8e87cb8dca7d https://go.googlecode.com/hg/ #Patch Set 5 : diff -r 8e87cb8dca7d https://go.googlecode.com/hg/ #Patch Set 6 : diff -r 8e87cb8dca7d https://go.googlecode.com/hg/ #
Total comments: 3
Patch Set 7 : diff -r 8e87cb8dca7d https://go.googlecode.com/hg/ #Patch Set 8 : diff -r 8e87cb8dca7d https://go.googlecode.com/hg/ #
Total comments: 1
Patch Set 9 : diff -r 4f5ad3a5b26d https://go.googlecode.com/hg/ #Patch Set 10 : diff -r 4f5ad3a5b26d https://go.googlecode.com/hg/ #
MessagesTotal messages: 19
|