]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: move statement marks from jumps to targets
authorDavid Chase <drchase@google.com>
Mon, 28 Jan 2019 23:00:01 +0000 (18:00 -0500)
committerDavid Chase <drchase@google.com>
Wed, 13 Mar 2019 14:40:36 +0000 (14:40 +0000)
commit82af9e67493b14ad1e10f28a384645e904a88d6f
tree38d6a365de891a1b301709af3c50cc6f4d56a2aa
parentbd680d94a030962efbdb20a51eb19e50ba286e56
cmd/compile: move statement marks from jumps to targets

When a jump at the end of a block is about to be marked as
a statement, if the first real instruction in the target
block is also a statement for the same line, remove the
mark from the jump.

This is a first effort at a minimal-harm heuristic.
A better heuristic might skip over any "not-statement"
values preceding a definitely marked value.

Fixes #29443.

Change-Id: Ibd52783713b4936e0c2dfda8d708bf186f33b00a
Reviewed-on: https://go-review.googlesource.com/c/go/+/159977
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alessandro Arzilli <alessandro.arzilli@gmail.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/compile/internal/gc/ssa.go
src/cmd/compile/internal/ssa/numberlines.go