• Keith Randall's avatar
    cmd/compile: remove more nil ptr checks after newobject · f1517ec6
    Keith Randall authored
    For code like the following (where x escapes):
    
       x := []int{1}
    
    We're currently generating a nil check.  The line above is really 3 operations:
    
    	t := new([1]int)
    	t[0] = 1
    	x := t[:]
    
    We remove the nil check for t[0] = 1, but not for t[:].
    
    Our current nil check removal rule is too strict about the possible
    memory arguments of the nil check. Unlike zeroing or storing to the
    result of runtime.newobject, the nilness of runtime.newobject is
    always false, even after other stores have happened in the meantime.
    
    Change-Id: I95fad4e3a59c27effdb37c43ea215e18f30b1e5f
    Reviewed-on: https://go-review.googlesource.com/58711
    Run-TryBot: Keith Randall <khr@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
    f1517ec6
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...