]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/ssa: fix endless compile loop on AMD64
authorIlya Tocar <ilya.tocar@intel.com>
Mon, 23 Apr 2018 19:11:40 +0000 (14:11 -0500)
committerIlya Tocar <ilya.tocar@intel.com>
Tue, 24 Apr 2018 16:20:41 +0000 (16:20 +0000)
commitfb017c60bc60f8df771ac2a9119ec55ea915929c
tree144f5794c308620ef7f736acbf655572fbbb1e3e
parentcd037bce09ec1aecd40d9c91c23d09f5b60549f4
cmd/compile/internal/ssa: fix endless compile loop on AMD64

We currently rewrite
(TESTQ (MOVQconst [c] x)) into (TESTQconst [c] x)
and (TESTQconst [-1] x) into (TESTQ x x)
if x is a (MOVQconst [-1]) we will be stuck in the endless rewrite loop.
Don't perform the rewrite in such cases.

Fixes #25006

Change-Id: I77f561ba2605fc104f1e5d5c57f32e9d67a2c000
Reviewed-on: https://go-review.googlesource.com/108879
Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/ssa/gen/AMD64.rules
src/cmd/compile/internal/ssa/rewriteAMD64.go
test/fixedbugs/issue25006.go [new file with mode: 0644]