[go] cmd/compile: rewriteFixedLoad: ensure AuxInt is sign-extended

7 views
Skip to first unread message

Rongrong (Gerrit)

unread,
Feb 12, 2026, 4:23:33 AM (13 days ago) Feb 12
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Rongrong has uploaded the change for review

Commit message

cmd/compile: rewriteFixedLoad: ensure AuxInt is sign-extended

CL 701297 accidentailly broke the type casting behavior for Hash.

Previously, the generated rules for Hash shared a common pattern:

v.AuxInt = int32ToAuxInt(fixed32(config, sym, off))

which inherently equaled to a signed-extend:

v.AuxInt = int64(int32(types.TypeHash(...)))

The pattern in CL 701297 was however:

v.AuxInt = int64(types.TypeHash(t))

Since types.TypeHash() returns a uint32, casting it to a wider integer
implies zero-extend. This diverges from the definition of AuxInt, in
which "Unused portions are filled by sign-extending the used portion,
even if the represented value is unsigned."

As a result, ssa.checkFunc(), where AuxInt is checked against the
mentioned rule, is unhappy and shouts:

internal compiler error: 'typeAsserts': bad int32 AuxInt value for v1317

Reproduce it with:

GOARCH=mips go tool compile -m -d=ssa/check/on test/devirtualization.go

This is only reproducible with GOARCH=mips/mipsle (cross and native).
Probably the rewrite rules of other architectures prevent Hash from
running into rewriteFixedLoad.

Fix it by emit sign-extend properly. Additionally, do the same for Kind_
as reflectdata.ABIKindOfType() also returns a fragile unsigned interger
(uint8).

Updates #67304
Change-Id: Ib4f3c94c0e3908698868449db2fdcdf4541f2e7e

Change diff

diff --git a/src/cmd/compile/internal/ssa/rewrite.go b/src/cmd/compile/internal/ssa/rewrite.go
index 04989d9..58c5669 100644
--- a/src/cmd/compile/internal/ssa/rewrite.go
+++ b/src/cmd/compile/internal/ssa/rewrite.go
@@ -2171,11 +2171,11 @@
return v
case "Hash":
v.reset(OpConst32)
- v.AuxInt = int64(types.TypeHash(t))
+ v.AuxInt = int64(int32(types.TypeHash(t)))
return v
case "Kind_":
v.reset(OpConst8)
- v.AuxInt = int64(reflectdata.ABIKindOfType(t))
+ v.AuxInt = int64(int8(reflectdata.ABIKindOfType(t)))
return v
case "GCData":
gcdata, _ := reflectdata.GCSym(t, true)

Change information

Files:
  • M src/cmd/compile/internal/ssa/rewrite.go
Change size: XS
Delta: 1 file changed, 2 insertions(+), 2 deletions(-)
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ib4f3c94c0e3908698868449db2fdcdf4541f2e7e
Gerrit-Change-Number: 744860
Gerrit-PatchSet: 1
Gerrit-Owner: Rongrong <rongrong...@oss.cipunited.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Julian Zhu (Gerrit)

unread,
Feb 12, 2026, 5:17:56 AM (13 days ago) Feb 12
to goph...@pubsubhelper.golang.org, Keith Randall, Martin Möhrmann, Gopher Robot, golang-co...@googlegroups.com
Attention needed from Keith Randall, Martin Möhrmann and Rongrong

Julian Zhu voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Keith Randall
  • Martin Möhrmann
  • Rongrong
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ib4f3c94c0e3908698868449db2fdcdf4541f2e7e
Gerrit-Change-Number: 744860
Gerrit-PatchSet: 1
Gerrit-Owner: Rongrong <rongrong...@oss.cipunited.com>
Gerrit-Reviewer: Julian Zhu <jz53...@gmail.com>
Gerrit-Reviewer: Keith Randall <k...@golang.org>
Gerrit-Reviewer: Martin Möhrmann <moeh...@google.com>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-Attention: Keith Randall <k...@golang.org>
Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
Gerrit-Attention: Rongrong <rongrong...@oss.cipunited.com>
Gerrit-Comment-Date: Thu, 12 Feb 2026 10:17:52 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
satisfied_requirement
open
diffy

Rongrong (Gerrit)

unread,
Feb 23, 2026, 10:02:55 PM (2 days ago) Feb 23
to goph...@pubsubhelper.golang.org, Jake Bailey, Mark Freeman, Go LUCI, Julian Zhu, Keith Randall, Martin Möhrmann, Gopher Robot, golang-co...@googlegroups.com
Attention needed from Keith Randall and Martin Möhrmann

Rongrong added 1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Rongrong . resolved

Gentle ping.

+CC: CL 701297's author and reviewers

Open in Gerrit

Related details

Attention is currently required from:
  • Keith Randall
  • Martin Möhrmann
Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    • requirement satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib4f3c94c0e3908698868449db2fdcdf4541f2e7e
    Gerrit-Change-Number: 744860
    Gerrit-PatchSet: 1
    Gerrit-Owner: Rongrong <rongrong...@oss.cipunited.com>
    Gerrit-Reviewer: Julian Zhu <jz53...@gmail.com>
    Gerrit-Reviewer: Keith Randall <k...@golang.org>
    Gerrit-Reviewer: Martin Möhrmann <moeh...@google.com>
    Gerrit-CC: Florian Lehner <lehner.f...@gmail.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-CC: Jake Bailey <jacob.b...@gmail.com>
    Gerrit-CC: Mark Freeman <markf...@google.com>
    Gerrit-Attention: Keith Randall <k...@golang.org>
    Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
    Gerrit-Comment-Date: Tue, 24 Feb 2026 03:02:46 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Jake Bailey (Gerrit)

    unread,
    Feb 24, 2026, 3:30:53 AM (yesterday) Feb 24
    to goph...@pubsubhelper.golang.org, Keith Randall, Mark Freeman, Go LUCI, Julian Zhu, Keith Randall, Martin Möhrmann, Gopher Robot, golang-co...@googlegroups.com
    Attention needed from Keith Randall, Martin Möhrmann and Rongrong

    Jake Bailey voted and added 1 comment

    Votes added by Jake Bailey

    Code-Review+1

    1 comment

    Patchset-level comments
    Jake Bailey . resolved

    My +1 isn't helpful, but here it is anyway 😅

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Keith Randall
    • Martin Möhrmann
    • Rongrong
    Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    • requirement satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib4f3c94c0e3908698868449db2fdcdf4541f2e7e
    Gerrit-Change-Number: 744860
    Gerrit-PatchSet: 1
    Gerrit-Owner: Rongrong <rongrong...@oss.cipunited.com>
    Gerrit-Reviewer: Jake Bailey <jacob.b...@gmail.com>
    Gerrit-Reviewer: Julian Zhu <jz53...@gmail.com>
    Gerrit-Reviewer: Keith Randall <k...@golang.org>
    Gerrit-Reviewer: Martin Möhrmann <moeh...@google.com>
    Gerrit-CC: Florian Lehner <lehner.f...@gmail.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-CC: Keith Randall <k...@google.com>
    Gerrit-CC: Mark Freeman <markf...@google.com>
    Gerrit-Attention: Keith Randall <k...@golang.org>
    Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
    Gerrit-Attention: Rongrong <rongrong...@oss.cipunited.com>
    Gerrit-Comment-Date: Tue, 24 Feb 2026 08:30:49 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Keith Randall (Gerrit)

    unread,
    Feb 24, 2026, 3:47:51 PM (13 hours ago) Feb 24
    to goph...@pubsubhelper.golang.org, Keith Randall, Jake Bailey, Keith Randall, Mark Freeman, Go LUCI, Julian Zhu, Martin Möhrmann, Gopher Robot, golang-co...@googlegroups.com
    Attention needed from Martin Möhrmann and Rongrong

    Keith Randall voted and added 1 comment

    Votes added by Keith Randall

    Auto-Submit+1
    Code-Review+2

    1 comment

    Patchset-level comments
    Keith Randall . unresolved

    Will this need to be backported to 1.26?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Martin Möhrmann
    • Rongrong
    Submit Requirements:
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    • requirement satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib4f3c94c0e3908698868449db2fdcdf4541f2e7e
    Gerrit-Change-Number: 744860
    Gerrit-PatchSet: 1
    Gerrit-Owner: Rongrong <rongrong...@oss.cipunited.com>
    Gerrit-Reviewer: Jake Bailey <jacob.b...@gmail.com>
    Gerrit-Reviewer: Julian Zhu <jz53...@gmail.com>
    Gerrit-Reviewer: Keith Randall <k...@golang.org>
    Gerrit-Reviewer: Martin Möhrmann <moeh...@google.com>
    Gerrit-CC: Florian Lehner <lehner.f...@gmail.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-CC: Keith Randall <k...@google.com>
    Gerrit-CC: Mark Freeman <markf...@google.com>
    Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
    Gerrit-Attention: Rongrong <rongrong...@oss.cipunited.com>
    Gerrit-Comment-Date: Tue, 24 Feb 2026 20:47:47 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Keith Randall (Gerrit)

    unread,
    Feb 24, 2026, 3:48:00 PM (13 hours ago) Feb 24
    to goph...@pubsubhelper.golang.org, Keith Randall, Jake Bailey, Mark Freeman, Go LUCI, Julian Zhu, Martin Möhrmann, Gopher Robot, golang-co...@googlegroups.com
    Attention needed from Martin Möhrmann and Rongrong

    Keith Randall voted Code-Review+1

    Code-Review+1
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Martin Möhrmann
    • Rongrong
    Submit Requirements:
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    • requirement satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib4f3c94c0e3908698868449db2fdcdf4541f2e7e
    Gerrit-Change-Number: 744860
    Gerrit-PatchSet: 1
    Gerrit-Owner: Rongrong <rongrong...@oss.cipunited.com>
    Gerrit-Reviewer: Jake Bailey <jacob.b...@gmail.com>
    Gerrit-Reviewer: Julian Zhu <jz53...@gmail.com>
    Gerrit-Reviewer: Keith Randall <k...@golang.org>
    Gerrit-Reviewer: Keith Randall <k...@google.com>
    Gerrit-Reviewer: Martin Möhrmann <moeh...@google.com>
    Gerrit-CC: Florian Lehner <lehner.f...@gmail.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-CC: Mark Freeman <markf...@google.com>
    Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
    Gerrit-Attention: Rongrong <rongrong...@oss.cipunited.com>
    Gerrit-Comment-Date: Tue, 24 Feb 2026 20:47:56 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Rongrong (Gerrit)

    unread,
    Feb 24, 2026, 10:31:06 PM (7 hours ago) Feb 24
    to goph...@pubsubhelper.golang.org, Keith Randall, Keith Randall, Jake Bailey, Mark Freeman, Go LUCI, Julian Zhu, Martin Möhrmann, Gopher Robot, golang-co...@googlegroups.com
    Attention needed from Keith Randall and Martin Möhrmann

    Rongrong added 1 comment

    Patchset-level comments
    Keith Randall . unresolved

    Will this need to be backported to 1.26?

    Rongrong

    Ah yes. This will fix the only failing CI test in go{1.26,tip}-linux-mipsle, see https://logs.chromium.org/logs/golang/buildbucket/cr-buildbucket/8689298350493009505/+/u/step/22/log/2

    I am not very sure what I should do to backport it, considering there is no "Fixes" issue for it. Should I simply open a cherry-pick CL via Gerrit after this gets merged?

    And thanks for your review :)

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Keith Randall
    • Martin Möhrmann
    Submit Requirements:
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    • requirement satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib4f3c94c0e3908698868449db2fdcdf4541f2e7e
    Gerrit-Change-Number: 744860
    Gerrit-PatchSet: 1
    Gerrit-Owner: Rongrong <rongrong...@oss.cipunited.com>
    Gerrit-Reviewer: Jake Bailey <jacob.b...@gmail.com>
    Gerrit-Reviewer: Julian Zhu <jz53...@gmail.com>
    Gerrit-Reviewer: Keith Randall <k...@golang.org>
    Gerrit-Reviewer: Keith Randall <k...@google.com>
    Gerrit-Reviewer: Martin Möhrmann <moeh...@google.com>
    Gerrit-CC: Florian Lehner <lehner.f...@gmail.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-CC: Mark Freeman <markf...@google.com>
    Gerrit-Attention: Keith Randall <k...@golang.org>
    Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
    Gerrit-Comment-Date: Wed, 25 Feb 2026 03:30:57 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Keith Randall <k...@golang.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Cherry Mui (Gerrit)

    unread,
    Feb 24, 2026, 11:10:06 PM (6 hours ago) Feb 24
    to goph...@pubsubhelper.golang.org, Keith Randall, Keith Randall, Jake Bailey, Mark Freeman, Go LUCI, Julian Zhu, Martin Möhrmann, Gopher Robot, golang-co...@googlegroups.com
    Attention needed from Keith Randall, Martin Möhrmann and Rongrong

    Cherry Mui voted Code-Review+1

    Code-Review+1
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Keith Randall
    • Martin Möhrmann
    • Rongrong
    Submit Requirements:
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement satisfiedReview-Enforcement
      • requirement satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: Ib4f3c94c0e3908698868449db2fdcdf4541f2e7e
      Gerrit-Change-Number: 744860
      Gerrit-PatchSet: 1
      Gerrit-Owner: Rongrong <rongrong...@oss.cipunited.com>
      Gerrit-Reviewer: Cherry Mui <cher...@google.com>
      Gerrit-Reviewer: Jake Bailey <jacob.b...@gmail.com>
      Gerrit-Reviewer: Julian Zhu <jz53...@gmail.com>
      Gerrit-Reviewer: Keith Randall <k...@golang.org>
      Gerrit-Reviewer: Keith Randall <k...@google.com>
      Gerrit-Reviewer: Martin Möhrmann <moeh...@google.com>
      Gerrit-CC: Florian Lehner <lehner.f...@gmail.com>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Mark Freeman <markf...@google.com>
      Gerrit-Attention: Keith Randall <k...@golang.org>
      Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
      Gerrit-Attention: Rongrong <rongrong...@oss.cipunited.com>
      Gerrit-Comment-Date: Wed, 25 Feb 2026 04:10:02 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Keith Randall (Gerrit)

      unread,
      1:26 AM (4 hours ago) 1:26 AM
      to goph...@pubsubhelper.golang.org, Cherry Mui, Keith Randall, Keith Randall, Jake Bailey, Mark Freeman, Go LUCI, Julian Zhu, Martin Möhrmann, Gopher Robot, golang-co...@googlegroups.com
      Attention needed from Martin Möhrmann and Rongrong

      Keith Randall added 1 comment

      Patchset-level comments
      Keith Randall . resolved

      Will this need to be backported to 1.26?

      Rongrong

      Ah yes. This will fix the only failing CI test in go{1.26,tip}-linux-mipsle, see https://logs.chromium.org/logs/golang/buildbucket/cr-buildbucket/8689298350493009505/+/u/step/22/log/2

      I am not very sure what I should do to backport it, considering there is no "Fixes" issue for it. Should I simply open a cherry-pick CL via Gerrit after this gets merged?

      And thanks for your review :)

      Keith Randall

      I opened 77785 for this issue, and gopherbot will open a backport issue for 1.26.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Martin Möhrmann
      • Rongrong
      Submit Requirements:
      • requirement satisfiedCode-Review
      • requirement satisfiedNo-Unresolved-Comments
      • requirement satisfiedReview-Enforcement
      • requirement satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: Ib4f3c94c0e3908698868449db2fdcdf4541f2e7e
      Gerrit-Change-Number: 744860
      Gerrit-PatchSet: 1
      Gerrit-Owner: Rongrong <rongrong...@oss.cipunited.com>
      Gerrit-Reviewer: Cherry Mui <cher...@google.com>
      Gerrit-Reviewer: Jake Bailey <jacob.b...@gmail.com>
      Gerrit-Reviewer: Julian Zhu <jz53...@gmail.com>
      Gerrit-Reviewer: Keith Randall <k...@golang.org>
      Gerrit-Reviewer: Keith Randall <k...@google.com>
      Gerrit-Reviewer: Martin Möhrmann <moeh...@google.com>
      Gerrit-CC: Florian Lehner <lehner.f...@gmail.com>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Mark Freeman <markf...@google.com>
      Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
      Gerrit-Attention: Rongrong <rongrong...@oss.cipunited.com>
      Gerrit-Comment-Date: Wed, 25 Feb 2026 06:26:29 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Keith Randall <k...@golang.org>
      Comment-In-Reply-To: Rongrong <rongrong...@oss.cipunited.com>
      satisfied_requirement
      open
      diffy

      Keith Randall (Gerrit)

      unread,
      1:26 AM (4 hours ago) 1:26 AM
      to Keith Randall, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Cherry Mui, Keith Randall, Jake Bailey, Mark Freeman, Go LUCI, Julian Zhu, Martin Möhrmann, Gopher Robot, golang-co...@googlegroups.com

      Keith Randall submitted the change

      Change information

      Reviewed-by: Cherry Mui <cher...@google.com>
      Reviewed-by: Jake Bailey <jacob.b...@gmail.com>
      Reviewed-by: Keith Randall <k...@golang.org>
      Auto-Submit: Keith Randall <k...@golang.org>
      Reviewed-by: Keith Randall <k...@google.com>
      Files:
      • M src/cmd/compile/internal/ssa/rewrite.go
      Change size: XS
      Delta: 1 file changed, 2 insertions(+), 2 deletions(-)
      Branch: refs/heads/master
      Submit Requirements:
      • requirement satisfiedCode-Review: +1 by Jake Bailey, +2 by Keith Randall, +1 by Keith Randall, +1 by Cherry Mui
      • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
      Open in Gerrit
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: merged
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: Ib4f3c94c0e3908698868449db2fdcdf4541f2e7e
      Gerrit-Change-Number: 744860
      Gerrit-PatchSet: 2
      open
      diffy
      satisfied_requirement

      Keith Randall (Gerrit)

      unread,
      1:27 AM (4 hours ago) 1:27 AM
      to goph...@pubsubhelper.golang.org, Keith Randall, golang-co...@googlegroups.com

      Keith Randall has uploaded the change for review

      Commit message

      [release-branch.go1.26] cmd/compile: rewriteFixedLoad: ensure AuxInt is sign-extended


      CL 701297 accidentailly broke the type casting behavior for Hash.

      Previously, the generated rules for Hash shared a common pattern:

      v.AuxInt = int32ToAuxInt(fixed32(config, sym, off))

      which inherently equaled to a signed-extend:

      v.AuxInt = int64(int32(types.TypeHash(...)))

      The pattern in CL 701297 was however:

      v.AuxInt = int64(types.TypeHash(t))

      Since types.TypeHash() returns a uint32, casting it to a wider integer
      implies zero-extend. This diverges from the definition of AuxInt, in
      which "Unused portions are filled by sign-extending the used portion,
      even if the represented value is unsigned."

      As a result, ssa.checkFunc(), where AuxInt is checked against the
      mentioned rule, is unhappy and shouts:

      internal compiler error: 'typeAsserts': bad int32 AuxInt value for v1317

      Reproduce it with:

      GOARCH=mips go tool compile -m -d=ssa/check/on test/devirtualization.go

      This is only reproducible with GOARCH=mips/mipsle (cross and native).
      Probably the rewrite rules of other architectures prevent Hash from
      running into rewriteFixedLoad.

      Fix it by emit sign-extend properly. Additionally, do the same for Kind_
      as reflectdata.ABIKindOfType() also returns a fragile unsigned interger
      (uint8).

      Updates #67304
      Fixes #77786


      Change-Id: Ib4f3c94c0e3908698868449db2fdcdf4541f2e7e
      Reviewed-on: https://go-review.googlesource.com/c/go/+/744860
      Reviewed-by: Cherry Mui <cher...@google.com>
      Reviewed-by: Jake Bailey <jacob.b...@gmail.com>
      Reviewed-by: Keith Randall <k...@golang.org>
      Auto-Submit: Keith Randall <k...@golang.org>
      Reviewed-by: Keith Randall <k...@google.com>
      LUCI-TryBot-Result: Go LUCI <golang...@luci-project-accounts.iam.gserviceaccount.com>
      (cherry picked from commit a78df5aa0afcd64935f89577c0da0ed2315014ea)

      Change diff

      diff --git a/src/cmd/compile/internal/ssa/rewrite.go b/src/cmd/compile/internal/ssa/rewrite.go
      index 032915f..29222ff 100644
      --- a/src/cmd/compile/internal/ssa/rewrite.go
      +++ b/src/cmd/compile/internal/ssa/rewrite.go
      @@ -2169,11 +2169,11 @@

      return v
      case "Hash":
      v.reset(OpConst32)
      - v.AuxInt = int64(types.TypeHash(t))
      + v.AuxInt = int64(int32(types.TypeHash(t)))
      return v
      case "Kind_":
      v.reset(OpConst8)
      - v.AuxInt = int64(reflectdata.ABIKindOfType(t))
      + v.AuxInt = int64(int8(reflectdata.ABIKindOfType(t)))
      return v
      case "GCData":
      gcdata, _ := reflectdata.GCSym(t, true)

      Change information

      Files:
      • M src/cmd/compile/internal/ssa/rewrite.go
      Change size: XS
      Delta: 1 file changed, 2 insertions(+), 2 deletions(-)
      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
      • requirement is not satisfiedCode-Review
      • requirement satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      • requirement is not satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: newchange
      Gerrit-Project: go
      Gerrit-Branch: release-branch.go1.26
      Gerrit-Change-Id: Ib4f3c94c0e3908698868449db2fdcdf4541f2e7e
      Gerrit-Change-Number: 748780
      Gerrit-PatchSet: 1
      Gerrit-Owner: Keith Randall <k...@golang.org>
      Gerrit-CC: Rongrong <rongrong...@oss.cipunited.com>
      unsatisfied_requirement
      satisfied_requirement
      open
      diffy

      Keith Randall (Gerrit)

      unread,
      1:27 AM (4 hours ago) 1:27 AM
      to Keith Randall, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

      Keith Randall voted Commit-Queue+1

      Commit-Queue+1
      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
      • requirement is not satisfiedCode-Review
      • requirement satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      • requirement is not satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: release-branch.go1.26
      Gerrit-Change-Id: Ib4f3c94c0e3908698868449db2fdcdf4541f2e7e
      Gerrit-Change-Number: 748780
      Gerrit-PatchSet: 1
      Gerrit-Owner: Keith Randall <k...@golang.org>
      Gerrit-Reviewer: Keith Randall <k...@golang.org>
      Gerrit-CC: Rongrong <rongrong...@oss.cipunited.com>
      Gerrit-Comment-Date: Wed, 25 Feb 2026 06:27:48 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      unsatisfied_requirement
      satisfied_requirement
      open
      diffy

      Keith Randall (Gerrit)

      unread,
      1:28 AM (4 hours ago) 1:28 AM
      to Keith Randall, goph...@pubsubhelper.golang.org, Go LUCI, golang-co...@googlegroups.com
      Attention needed from Keith Randall

      Keith Randall voted Code-Review+1

      Code-Review+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Keith Randall
      Submit Requirements:
      • requirement is not satisfiedCode-Review
      • requirement satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      • requirement is not satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: release-branch.go1.26
      Gerrit-Change-Id: Ib4f3c94c0e3908698868449db2fdcdf4541f2e7e
      Gerrit-Change-Number: 748780
      Gerrit-PatchSet: 1
      Gerrit-Owner: Keith Randall <k...@golang.org>
      Gerrit-Reviewer: Keith Randall <k...@golang.org>
      Gerrit-Reviewer: Keith Randall <k...@google.com>
      Gerrit-CC: Rongrong <rongrong...@oss.cipunited.com>
      Gerrit-Attention: Keith Randall <k...@golang.org>
      Gerrit-Comment-Date: Wed, 25 Feb 2026 06:28:03 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      unsatisfied_requirement
      satisfied_requirement
      open
      diffy
      Reply all
      Reply to author
      Forward
      0 new messages