diff options
author | Keith Randall <khr@google.com> | 2019-01-08 13:46:49 -0800 |
---|---|---|
committer | Keith Randall <khr@golang.org> | 2019-01-14 22:41:33 +0000 |
commit | 7502ed3b90eeb4d8f1f9bd781df3517f41ea912c (patch) | |
tree | f02337be543b5f76ca3e6badfe7236c9a73357b8 /src/cmd/compile/internal/ssa/rewriteMIPS.go | |
parent | 70931c087b7ceb660aa969382b8c273efba63426 (diff) | |
download | go-7502ed3b90eeb4d8f1f9bd781df3517f41ea912c.tar.gz go-7502ed3b90eeb4d8f1f9bd781df3517f41ea912c.zip |
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>
Diffstat (limited to 'src/cmd/compile/internal/ssa/rewriteMIPS.go')
-rw-r--r-- | src/cmd/compile/internal/ssa/rewriteMIPS.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cmd/compile/internal/ssa/rewriteMIPS.go b/src/cmd/compile/internal/ssa/rewriteMIPS.go index 951c5a5ef8..55bef5a792 100644 --- a/src/cmd/compile/internal/ssa/rewriteMIPS.go +++ b/src/cmd/compile/internal/ssa/rewriteMIPS.go @@ -3502,7 +3502,7 @@ func rewriteValueMIPS_OpMIPSMOVBUreg_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpMIPSMOVBUload, t) + v0 := b.NewValue0(x.Pos, OpMIPSMOVBUload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -3663,7 +3663,7 @@ func rewriteValueMIPS_OpMIPSMOVBreg_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpMIPSMOVBload, t) + v0 := b.NewValue0(x.Pos, OpMIPSMOVBload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -4359,7 +4359,7 @@ func rewriteValueMIPS_OpMIPSMOVHUreg_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpMIPSMOVHUload, t) + v0 := b.NewValue0(x.Pos, OpMIPSMOVHUload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -4570,7 +4570,7 @@ func rewriteValueMIPS_OpMIPSMOVHreg_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpMIPSMOVHload, t) + v0 := b.NewValue0(x.Pos, OpMIPSMOVHload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off |