Skip to content

Commit

Permalink
[release-branch.go1.15] cmd/internal/obj: fix inline marker issue on …
Browse files Browse the repository at this point in the history
…s390x

The optimization that replaces inline markers with pre-existing
instructions assumes that 'Prog' values produced by the compiler are
still reachable after the assembler has run. This was not true on
s390x where the assembler was removing NOP instructions from the
linked list of 'Prog' values. This led to broken inlining data
which in turn caused an infinite loop in the runtime traceback code.

Fix this by stopping the s390x assembler backend removing NOP
values. It does not make any difference to the output of the
assembler because NOP instructions are 0 bytes long anyway.

Note: compiler check omitted from backport to reduce risk of change.

Fixes #40693.

Change-Id: I4eb570de13165cde342d5fb2ee3218945ddf4b52
Reviewed-on: https://go-review.googlesource.com/c/go/+/248478
Run-TryBot: Michael Munday <mike.munday@ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
  • Loading branch information
mundaym authored and dmitshur committed Sep 10, 2020
1 parent 9706f51 commit bbee523
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/cmd/internal/obj/s390x/objz.go
Expand Up @@ -283,17 +283,6 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
ACMPUBNE:
q = p
p.Mark |= BRANCH
if p.Pcond != nil {
q := p.Pcond
for q.As == obj.ANOP {
q = q.Link
p.Pcond = q
}
}

case obj.ANOP:
q.Link = p.Link /* q is non-nop */
p.Link.Mark |= p.Mark

default:
q = p
Expand Down

0 comments on commit bbee523

Please sign in to comment.