Skip to content

Commit a22ec6e

Browse files
committed
Revert "cmd/internal/obj: fix inline marker issue on s390x"
This reverts CL 247697. Reason for revert: This change broke the linux-arm builder. Change-Id: I8ca0d5b3b2ea0109ffbfadeab1406a1b60e7d18d Reviewed-on: https://go-review.googlesource.com/c/go/+/248718 Reviewed-by: Michael Munday <[email protected]> Run-TryBot: Michael Munday <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent d19fedd commit a22ec6e

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

src/cmd/internal/obj/pcln.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -278,21 +278,6 @@ func linkpcln(ctxt *Link, cursym *LSym) {
278278
funcpctab(ctxt, &pcln.Pcfile, cursym, "pctofile", pctofileline, pcln)
279279
funcpctab(ctxt, &pcln.Pcline, cursym, "pctoline", pctofileline, nil)
280280

281-
// Check that all the Progs used as inline markers are still reachable.
282-
// See issue #40473.
283-
inlMarkProgs := make(map[*Prog]struct{}, len(cursym.Func.InlMarks))
284-
for _, inlMark := range cursym.Func.InlMarks {
285-
inlMarkProgs[inlMark.p] = struct{}{}
286-
}
287-
for p := cursym.Func.Text; p != nil; p = p.Link {
288-
if _, ok := inlMarkProgs[p]; ok {
289-
delete(inlMarkProgs, p)
290-
}
291-
}
292-
if len(inlMarkProgs) > 0 {
293-
ctxt.Diag("one or more instructions used as inline markers are no longer reachable")
294-
}
295-
296281
pcinlineState := new(pcinlineState)
297282
funcpctab(ctxt, &pcln.Pcinline, cursym, "pctoinline", pcinlineState.pctoinline, nil)
298283
for _, inlMark := range cursym.Func.InlMarks {

src/cmd/internal/obj/s390x/objz.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,17 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
283283
ACMPUBNE:
284284
q = p
285285
p.Mark |= BRANCH
286+
if p.Pcond != nil {
287+
q := p.Pcond
288+
for q.As == obj.ANOP {
289+
q = q.Link
290+
p.Pcond = q
291+
}
292+
}
293+
294+
case obj.ANOP:
295+
q.Link = p.Link /* q is non-nop */
296+
p.Link.Mark |= p.Mark
286297

287298
default:
288299
q = p

0 commit comments

Comments
 (0)