1
0
mirror of https://github.com/golang/go synced 2024-11-17 14:04:48 -07:00

cmd/compile, cmd/internal/obj: ignore AUSEFIELD

When using GOEXPERIMENT=fieldtrack, we can see AUSEFIELD instructions.
We generally want to ignore them.

No tests because as far as I can tell there are no tests for
GOEXPERIMENT=fieldtrack.

Change-Id: Iee26f25592158e5db691a36cf8d77fc54d051314
Reviewed-on: https://go-review.googlesource.com/17610
Reviewed-by: David Symonds <dsymonds@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Ian Lance Taylor 2015-12-08 18:29:26 -08:00
parent 371e44e5a1
commit 0b37a6f47b
8 changed files with 16 additions and 12 deletions

View File

@ -1365,7 +1365,8 @@ func copyu(p *obj.Prog, v *obj.Addr, s *obj.Addr) int {
case obj.APCDATA,
obj.AFUNCDATA,
obj.AVARDEF,
obj.AVARKILL:
obj.AVARKILL,
obj.AUSEFIELD:
return 0
}
}

View File

@ -710,7 +710,8 @@ func copyu(p *obj.Prog, v *obj.Addr, s *obj.Addr) int {
obj.APCDATA,
obj.AFUNCDATA,
obj.AVARDEF,
obj.AVARKILL:
obj.AVARKILL,
obj.AUSEFIELD:
return 0
}
}

View File

@ -687,7 +687,8 @@ func copyu(p *obj.Prog, v *obj.Addr, s *obj.Addr) int {
case obj.APCDATA,
obj.AFUNCDATA,
obj.AVARDEF,
obj.AVARKILL:
obj.AVARKILL,
obj.AUSEFIELD:
return 0
}
}

View File

@ -952,7 +952,8 @@ func copyu(p *obj.Prog, v *obj.Addr, s *obj.Addr) int {
case obj.APCDATA,
obj.AFUNCDATA,
obj.AVARDEF,
obj.AVARKILL:
obj.AVARKILL,
obj.AUSEFIELD:
return 0
}
}

View File

@ -614,7 +614,7 @@ func span5(ctxt *obj.Link, cursym *obj.LSym) {
}
}
if m == 0 && (p.As != obj.AFUNCDATA && p.As != obj.APCDATA && p.As != ADATABUNDLEEND && p.As != obj.ANOP) {
if m == 0 && (p.As != obj.AFUNCDATA && p.As != obj.APCDATA && p.As != ADATABUNDLEEND && p.As != obj.ANOP && p.As != obj.AUSEFIELD) {
ctxt.Diag("zero-width instruction\n%v", p)
continue
}
@ -710,7 +710,7 @@ func span5(ctxt *obj.Link, cursym *obj.LSym) {
if m/4 > len(out) {
ctxt.Diag("instruction size too large: %d > %d", m/4, len(out))
}
if m == 0 && (p.As != obj.AFUNCDATA && p.As != obj.APCDATA && p.As != ADATABUNDLEEND && p.As != obj.ANOP) {
if m == 0 && (p.As != obj.AFUNCDATA && p.As != obj.APCDATA && p.As != ADATABUNDLEEND && p.As != obj.ANOP && p.As != obj.AUSEFIELD) {
if p.As == obj.ATEXT {
ctxt.Autosize = int32(p.To.Offset + 4)
continue

View File

@ -550,7 +550,7 @@ func span7(ctxt *obj.Link, cursym *obj.LSym) {
o = oplook(ctxt, p)
m = int(o.size)
if m == 0 {
if p.As != obj.ANOP && p.As != obj.AFUNCDATA && p.As != obj.APCDATA {
if p.As != obj.ANOP && p.As != obj.AFUNCDATA && p.As != obj.APCDATA && p.As != obj.AUSEFIELD {
ctxt.Diag("zero-width instruction\n%v", p)
}
continue
@ -618,7 +618,7 @@ func span7(ctxt *obj.Link, cursym *obj.LSym) {
m = int(o.size)
if m == 0 {
if p.As != obj.ANOP && p.As != obj.AFUNCDATA && p.As != obj.APCDATA {
if p.As != obj.ANOP && p.As != obj.AFUNCDATA && p.As != obj.APCDATA && p.As != obj.AUSEFIELD {
ctxt.Diag("zero-width instruction\n%v", p)
}
continue

View File

@ -342,7 +342,7 @@ func span0(ctxt *obj.Link, cursym *obj.LSym) {
o = oplook(ctxt, p)
m = int(o.size)
if m == 0 {
if p.As != obj.ANOP && p.As != obj.AFUNCDATA && p.As != obj.APCDATA {
if p.As != obj.ANOP && p.As != obj.AFUNCDATA && p.As != obj.APCDATA && p.As != obj.AUSEFIELD {
ctxt.Diag("zero-width instruction\n%v", p)
}
continue
@ -401,7 +401,7 @@ func span0(ctxt *obj.Link, cursym *obj.LSym) {
m = int(o.size)
if m == 0 {
if p.As != obj.ANOP && p.As != obj.AFUNCDATA && p.As != obj.APCDATA {
if p.As != obj.ANOP && p.As != obj.AFUNCDATA && p.As != obj.APCDATA && p.As != obj.AUSEFIELD {
ctxt.Diag("zero-width instruction\n%v", p)
}
continue

View File

@ -435,7 +435,7 @@ func span9(ctxt *obj.Link, cursym *obj.LSym) {
o = oplook(ctxt, p)
m = int(o.size)
if m == 0 {
if p.As != obj.ANOP && p.As != obj.AFUNCDATA && p.As != obj.APCDATA {
if p.As != obj.ANOP && p.As != obj.AFUNCDATA && p.As != obj.APCDATA && p.As != obj.AUSEFIELD {
ctxt.Diag("zero-width instruction\n%v", p)
}
continue
@ -492,7 +492,7 @@ func span9(ctxt *obj.Link, cursym *obj.LSym) {
m = int(o.size)
if m == 0 {
if p.As != obj.ANOP && p.As != obj.AFUNCDATA && p.As != obj.APCDATA {
if p.As != obj.ANOP && p.As != obj.AFUNCDATA && p.As != obj.APCDATA && p.As != obj.AUSEFIELD {
ctxt.Diag("zero-width instruction\n%v", p)
}
continue