]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: enforce 32-bit restrictions on ops
authorKeith Randall <khr@golang.org>
Fri, 18 Mar 2016 17:45:30 +0000 (10:45 -0700)
committerKeith Randall <khr@golang.org>
Sun, 20 Mar 2016 00:12:47 +0000 (00:12 +0000)
commit8dc04cbedcab9a769bb9f74d897c35ed9bc73ba2
treedd69cb38e1fbd514c81e5ea1987cd5ee1b34f5f7
parentd246eedcaa5105450ecfe72b626e955147c383b2
cmd/compile: enforce 32-bit restrictions on ops

Most 64-bit x86 ops can only take a signed 32-bit constant.
Clean up our rewrite rules to enforce this restriction.

Modify the assembler to fail if the offset does not fit
in the instruction.

That last check triggers a few times on weird testing code.
Suppress those errors if the compiler itself generated errors.

Fixes #14862

Change-Id: I76559af035b38483b1e59621a8029fc66b3a5d1e
Reviewed-on: https://go-review.googlesource.com/20815
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
src/cmd/compile/internal/gc/dcl.go
src/cmd/compile/internal/ssa/gen/AMD64.rules
src/cmd/compile/internal/ssa/rewrite.go
src/cmd/compile/internal/ssa/rewriteAMD64.go
src/cmd/internal/obj/x86/asm6.go