Skip to content

Commit

Permalink
cmd/compile: classify more nodes as "poor choices" for statements
Browse files Browse the repository at this point in the history
Aggregate-making nodes that are later decomposed
are poor choices for statements, because the decomposition
phase turns them into multiple sub-values, some of which may be
dead.  Better to look elsewhere for a statement mark.

Change-Id: Ibd9584138ab3d1384548686896a28580a2e43f54
Reviewed-on: https://go-review.googlesource.com/c/go/+/198477
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
  • Loading branch information
dr2chase committed Oct 3, 2019
1 parent 6139019 commit 53bd915
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cmd/compile/internal/ssa/numberlines.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ func isPoorStatementOp(op Op) bool {
switch op {
// Note that Nilcheck often vanishes, but when it doesn't, you'd love to start the statement there
// so that a debugger-user sees the stop before the panic, and can examine the value.
case OpAddr, OpLocalAddr, OpOffPtr, OpStructSelect, OpConstBool, OpConst8, OpConst16, OpConst32, OpConst64, OpConst32F, OpConst64F:
case OpAddr, OpLocalAddr, OpOffPtr, OpStructSelect,
OpIMake, OpStringMake, OpSliceMake, OpStructMake0, OpStructMake1, OpStructMake2, OpStructMake3, OpStructMake4,
OpConstBool, OpConst8, OpConst16, OpConst32, OpConst64, OpConst32F, OpConst64F:
return true
}
return false
Expand Down

0 comments on commit 53bd915

Please sign in to comment.