mirror of
https://github.com/golang/go
synced 2024-11-23 03:40:02 -07:00
cmd/internal/obj/arm64: fix the wrong error message of out-of-range checking
The error message of checking whether the offset value of load/store instruction is out of range is wrong. The right range is [-256, 255], not [-255, 254]. The CL fixes it. Change-Id: Ia342957f1f6bcec65eceb45944221d3972641bed Reviewed-on: https://go-review.googlesource.com/c/go/+/313891 Reviewed-by: eric fang <eric.fang@arm.com> Reviewed-by: Cherry Zhang <cherryyz@google.com> Trust: eric fang <eric.fang@arm.com> Run-TryBot: eric fang <eric.fang@arm.com>
This commit is contained in:
parent
c9f43507c6
commit
f439a76253
@ -59,8 +59,8 @@ TEXT errors(SB),$0
|
|||||||
LDP (R0), (R3, ZR) // ERROR "invalid register pair"
|
LDP (R0), (R3, ZR) // ERROR "invalid register pair"
|
||||||
LDXPW (RSP), (R2, R2) // ERROR "constrained unpredictable behavior"
|
LDXPW (RSP), (R2, R2) // ERROR "constrained unpredictable behavior"
|
||||||
LDAXPW (R5), (R2, R2) // ERROR "constrained unpredictable behavior"
|
LDAXPW (R5), (R2, R2) // ERROR "constrained unpredictable behavior"
|
||||||
MOVD.P 300(R2), R3 // ERROR "offset out of range [-255,254]"
|
MOVD.P 300(R2), R3 // ERROR "offset out of range [-256,255]"
|
||||||
MOVD.P R3, 344(R2) // ERROR "offset out of range [-255,254]"
|
MOVD.P R3, 344(R2) // ERROR "offset out of range [-256,255]"
|
||||||
MOVD (R3)(R7.SXTX<<2), R8 // ERROR "invalid index shift amount"
|
MOVD (R3)(R7.SXTX<<2), R8 // ERROR "invalid index shift amount"
|
||||||
MOVWU (R5)(R4.UXTW<<3), R10 // ERROR "invalid index shift amount"
|
MOVWU (R5)(R4.UXTW<<3), R10 // ERROR "invalid index shift amount"
|
||||||
MOVWU (R5)(R4<<1), R10 // ERROR "invalid index shift amount"
|
MOVWU (R5)(R4<<1), R10 // ERROR "invalid index shift amount"
|
||||||
|
@ -3621,7 +3621,7 @@ func (c *ctxt7) asmout(p *obj.Prog, o *Optab, out []uint32) {
|
|||||||
v := int32(p.From.Offset)
|
v := int32(p.From.Offset)
|
||||||
|
|
||||||
if v < -256 || v > 255 {
|
if v < -256 || v > 255 {
|
||||||
c.ctxt.Diag("offset out of range [-255,254]: %v", p)
|
c.ctxt.Diag("offset out of range [-256,255]: %v", p)
|
||||||
}
|
}
|
||||||
o1 = c.opldr(p, p.As)
|
o1 = c.opldr(p, p.As)
|
||||||
if o.scond == C_XPOST {
|
if o.scond == C_XPOST {
|
||||||
@ -3639,7 +3639,7 @@ func (c *ctxt7) asmout(p *obj.Prog, o *Optab, out []uint32) {
|
|||||||
v := int32(p.To.Offset)
|
v := int32(p.To.Offset)
|
||||||
|
|
||||||
if v < -256 || v > 255 {
|
if v < -256 || v > 255 {
|
||||||
c.ctxt.Diag("offset out of range [-255,254]: %v", p)
|
c.ctxt.Diag("offset out of range [-256,255]: %v", p)
|
||||||
}
|
}
|
||||||
o1 = c.opstr(p, p.As)
|
o1 = c.opstr(p, p.As)
|
||||||
if o.scond == C_XPOST {
|
if o.scond == C_XPOST {
|
||||||
|
Loading…
Reference in New Issue
Block a user