]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.15] cmd/compile: sign extend consant folding properly
authorKeith Randall <khr@golang.org>
Fri, 20 Nov 2020 21:53:05 +0000 (13:53 -0800)
committerCarlos Amedee <carlos@golang.org>
Thu, 3 Dec 2020 13:58:28 +0000 (13:58 +0000)
commita2adbc876e9362f064afffcb51ce677e2f988c5e
treedd0eef170fd18e20dd1fc91a9d49f31054f928d4
parent16ddb8bc763c33fb172d0c1bcd04d070f36f9cc8
[release-branch.go1.15] cmd/compile: sign extend consant folding properly

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

The easiest fix is just to turn on properly typed auxint fields
(which is what fixed this issue at tip).

Fixes #42753

Change-Id: I264245fad45067a6ade65326f7fe681feb5f3739
Reviewed-on: https://go-review.googlesource.com/c/go/+/272028
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]