]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: mark abi.PtrType.Elem sym as used
authorJake Bailey <jacob.b.bailey@gmail.com>
Fri, 5 Sep 2025 19:59:33 +0000 (12:59 -0700)
committerGopher Robot <gobot@golang.org>
Fri, 5 Sep 2025 20:52:20 +0000 (13:52 -0700)
commitd767064170aa3469404d25608d9ff9fa48962337
tree0781b6dc7103c38b1d1ad0ded80d47aab94b0152
parent0b1eed09a34f5a1e0a5c237bc9771eb036b35319
cmd/compile: mark abi.PtrType.Elem sym as used

CL 700336 let the compiler see into the abi.PtrType.Elem field,
but forgot the MarkTypeSymUsedInInterface to ensure that the symbol
is marked as referenced.

I am not sure how to write a test for this, but I noticed this when
working on further optimizations where I "fixed" this issue and
confusingly failed toolstash -cmp, with diffs like:

@@ -70582,6 +70582,7 @@ reflect.groupAndSlotOf<1> STEXT size=696 args=0x20 locals=0x1e0 funcid=0x0 align
  rel 3+0 t=R_USEIFACE type:*reflect.rtype<0>+0
  rel 3+0 t=R_USEIFACE type:*reflect.rtype<0>+0
  rel 3+0 t=R_USEIFACE type:*uint64<0>+0
+ rel 3+0 t=R_USEIFACE type:uint64<0>+0
  rel 71+0 t=R_CALLIND +0
  rel 92+4 t=R_PCREL go:itab.*reflect.rtype,reflect.Type<0>+0
  rel 114+4 t=R_CALL reflect.(*rtype).ptrTo<1>+0

Updates #75203

Change-Id: Ib8de8a32aeb8a7ea6fcf5d728a2e4944ef227ab2
Reviewed-on: https://go-review.googlesource.com/c/go/+/701296
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Keith Randall <khr@google.com>
src/cmd/compile/internal/ssa/_gen/generic.rules
src/cmd/compile/internal/ssa/rewrite.go
src/cmd/compile/internal/ssa/rewritegeneric.go