]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: make alg gen prologue/epilogue match
authorJosh Bleecher Snyder <josharian@gmail.com>
Sun, 28 Feb 2016 23:56:21 +0000 (15:56 -0800)
committerJosh Bleecher Snyder <josharian@gmail.com>
Wed, 9 Mar 2016 22:52:22 +0000 (22:52 +0000)
With this, the start and end of geneq and genhash
are parallel. This removes a few rare nilchecks
from generated hash functions, but nothing
to write home about.

Change-Id: I3b4836111d04daa6f6834a579bbec374a3f42c70
Reviewed-on: https://go-review.googlesource.com/20456
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
src/cmd/compile/internal/gc/alg.go

index 4ef97ff56eebcbda03775607c98407fcdf5aabf1..7c9d6ca65eb5fb653452feee654f578d07e6d95c 100644 (file)
@@ -289,7 +289,9 @@ func genhash(sym *Sym, t *Type) {
        old_safemode := safemode
 
        safemode = 0
+       Disable_checknil++
        funccompile(fn)
+       Disable_checknil--
        safemode = old_safemode
 }
 
@@ -357,6 +359,7 @@ func geneq(sym *Sym, t *Type) {
        tfn.Rlist.Append(n)
 
        funchdr(fn)
+       typecheck(&fn.Func.Nname.Name.Param.Ntype, Etype)
 
        // geneq is only called for types that have equality but
        // cannot be handled by the standard algorithms,