39b533e [release-branch.go1.12] cmd/compile: fix range analysis of small signed integers

2 files Authored by Matthew Dempsky 4 years ago, Committed by Russ Cox 4 years ago,
    [release-branch.go1.12] cmd/compile: fix range analysis of small signed integers
    
    For int8, int16, and int32, comparing their unsigned value to MaxInt64
    to determine non-negativity doesn't make sense, because they have
    negative values whose unsigned representation is smaller than that.
    Fix is simply to compare with the appropriate upper bound based on the
    value type's size.
    
    Fixes #32583.
    
    Change-Id: Ie7afad7a56af92bd890ba5ff33c86d1df06cfd9a
    Reviewed-on: https://go-review.googlesource.com/c/go/+/181797
    Run-TryBot: Matthew Dempsky <mdempsky@google.com>
    Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
    Reviewed-by: David Chase <drchase@google.com>
    Reviewed-by: Keith Randall <khr@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    (cherry picked from commit f44404ebbfeff57f3e45ebf4b314a320bb89841f)
    Reviewed-on: https://go-review.googlesource.com/c/go/+/181978
    Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>