]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix ephemeral pointer problem on amd64
authorKeith Randall <khr@golang.org>
Sat, 28 Mar 2020 05:03:33 +0000 (22:03 -0700)
committerKeith Randall <khr@golang.org>
Mon, 30 Mar 2020 17:25:29 +0000 (17:25 +0000)
commit33b648c0e9428c8775043db75fdff5864a64219a
tree8eea75f3d8068e06f4ae6c8b06a1be9274df025a
parent5a312288799c0a433e2061550ff92689b627e080
cmd/compile: fix ephemeral pointer problem on amd64

Make sure we don't use the rewrite ptr + (c + x) -> c + (ptr + x), as
that may create an ephemeral out-of-bounds pointer.

I have not seen an actual bug caused by this yet, but we've seen
them in the 386 port so I'm fixing this issue for amd64 as well.

The load-combining rules needed to be reworked somewhat to still
work without the above broken rule.

Update #37881

Change-Id: I8046d170e89e2035195f261535e34ca7d8aca68a
Reviewed-on: https://go-review.googlesource.com/c/go/+/226437
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/compile/internal/ssa/gen/AMD64.rules
src/cmd/compile/internal/ssa/rewrite.go
src/cmd/compile/internal/ssa/rewriteAMD64.go
test/codegen/memcombine.go