]> Cypherpunks repositories - gostls13.git/commit
[dev.ssa] cmd/compile: only fold 32 bit integers for add/multiply
authorTodd Neal <todd@tneal.org>
Sat, 25 Jul 2015 17:53:58 +0000 (12:53 -0500)
committerTodd Neal <todd@tneal.org>
Mon, 27 Jul 2015 02:08:59 +0000 (02:08 +0000)
commitdb5232620a1722ae1bcdf5f0d8cd15ba0bac2077
tree8d83379eb817e7a0125788202a81541f20fcae76
parent52d76f7a6a02cf5834251a4ceadc686a9f83ac81
[dev.ssa] cmd/compile: only fold 32 bit integers for add/multiply

Fix an issue where doasm fails if trying to multiply by a larger
than 32 bit const (doasm: notfound ft=9 tt=14 00008 IMULQ
$34359738369, CX 9 14).  Fix truncation of 64 to 32 bit integer
when generating LEA causing incorrect values to be computed.

Change-Id: I1e65b63cc32ac673a9bb5a297b578b44c2f1ac8f
Reviewed-on: https://go-review.googlesource.com/12678
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/gc/ssa_test.go
src/cmd/compile/internal/gc/testdata/arith_ssa.go [new file with mode: 0644]
src/cmd/compile/internal/ssa/gen/AMD64.rules
src/cmd/compile/internal/ssa/rewrite.go
src/cmd/compile/internal/ssa/rewriteAMD64.go