• Cherry Zhang's avatar
    cmd/compile: fix MIPS SGTconst-with-shift rules · 6a64efc2
    Cherry Zhang authored
    (SGTconst [c] (SRLconst _ [d])) && 0 <= int32(c) && uint32(d) <= 31 && 1<<(32-uint32(d)) <= int32(c) -> (MOVWconst [1])
    
    This rule is problematic. 1<<(32-uint32(d)) <= int32(c) meant to
    say that it is true if c is greater than the largest possible
    value of the right shift. But when d==1, 1<<(32-1) is negative
    and results in the wrong comparison.
    
    Rewrite the rules in a more direct way.
    
    Fixes #29402.
    
    Change-Id: I5940fc9538d9bc3a4bcae8aa34672867540dc60e
    Reviewed-on: https://go-review.googlesource.com/c/155798
    Run-TryBot: Cherry Zhang <cherryyz@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarKeith Randall <khr@golang.org>
    6a64efc2
Name
Last commit
Last update
..
addr2line Loading commit data...
api Loading commit data...
asm Loading commit data...
buildid Loading commit data...
cgo Loading commit data...
compile Loading commit data...
cover Loading commit data...
dist Loading commit data...
doc Loading commit data...
fix Loading commit data...
go Loading commit data...
gofmt Loading commit data...
internal Loading commit data...
link Loading commit data...
nm Loading commit data...
objdump Loading commit data...
pack Loading commit data...
pprof Loading commit data...
test2json Loading commit data...
trace Loading commit data...
vendor Loading commit data...
vet Loading commit data...