]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: when merging instructions, prefer line number of faulting insn
authorKeith Randall <khr@google.com>
Tue, 8 Jan 2019 21:46:49 +0000 (13:46 -0800)
committerKeith Randall <khr@golang.org>
Mon, 14 Jan 2019 22:41:33 +0000 (22:41 +0000)
commit7502ed3b90eeb4d8f1f9bd781df3517f41ea912c
treef02337be543b5f76ca3e6badfe7236c9a73357b8
parent70931c087b7ceb660aa969382b8c273efba63426
cmd/compile: when merging instructions, prefer line number of faulting insn

Normally this happens when combining a sign extension and a load.  We
want the resulting combo-instruction to get the line number of the
load, not the line number of the sign extension.

For each rule, compute where we should get its line number by finding
a value on the match side that can fault.  Use that line number for
all the new values created on the right-hand side.

Fixes #27201

Change-Id: I19b3c6f468fff1a3c0bfbce2d6581828557064a3
Reviewed-on: https://go-review.googlesource.com/c/156937
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/ssa/gen/rulegen.go
src/cmd/compile/internal/ssa/rewrite386.go
src/cmd/compile/internal/ssa/rewriteAMD64.go
src/cmd/compile/internal/ssa/rewriteARM64.go
src/cmd/compile/internal/ssa/rewriteMIPS.go
src/cmd/compile/internal/ssa/rewritePPC64.go
src/cmd/compile/internal/ssa/rewriteS390X.go
test/fixedbugs/issue27201.go [new file with mode: 0644]