]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.14] cmd/compile: sign extend constant folding properly
authorKeith Randall <khr@golang.org>
Fri, 20 Nov 2020 22:02:37 +0000 (14:02 -0800)
committerCarlos Amedee <carlos@golang.org>
Thu, 3 Dec 2020 13:58:36 +0000 (13:58 +0000)
commit679482fc602445b9b2d37739e7b048e2d4913646
treec56a2148d8cc3067141bea561b21cf17eafcae1d
parent9e27a089d644950cba52108f6634badc5880c6e0
[release-branch.go1.14] cmd/compile: sign extend constant folding properly

MOVLconst must have a properly sign-extended auxint constant.
The bit operations in these rules don't enforce that invariant.

Fixes #42755

Change-Id: I729afcad18752d9b7739e49709020e3be7b3653e
Reviewed-on: https://go-review.googlesource.com/c/go/+/272030
Trust: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/ssa/gen/AMD64.rules
src/cmd/compile/internal/ssa/rewriteAMD64.go
test/fixedbugs/issue42753.go [new file with mode: 0644]