Skip to content

cmd/compile: generic shift-by-constant canonicalization gives Const64 the wrong type [1.26 backport] #81869

Open

Description

@gopherbot

@Jorropo requested issue #81868 to be considered for backport to the next 1.26 minor release.

cc @gopherbot please open a backport issue for 1.26

This causes me confirmed crashes, maybe misscompilations too.

Activity

  1. added
    CherryPickCandidateUsed during the release process for point releases
    compiler/runtimeIssues related to the Go compiler and/or runtime.
    on Sep 29, 2026
  2. added this to the Go1.26.9 milestone on Sep 29, 2026
  3. prattmic commented on Sep 30, 2026

    @prattmic
    Member

    This is a request to backport https://go.dev/cl/795240.

    IIUC, #81706 is a 1.27 backport for a regression caused by https://go.dev/cl/795240.

    Thus if this request is approved, I believe we need to backport:

    https://go.dev/cl/795240
    https://go.dev/cl/837245

    @Jorropo is this corrrect?

  4. Jorropo commented on Oct 1, 2026

    @Jorropo
    Member

    @prattmic correct.

    There are three bugs here:

    1. Const64 typed with the underlying rotate, which can lead to Const64 with type of 32 16 or 8 bits.
    2. Const32 typed with the underlying rotate on 32 bits platforms, which can lead to Const32 with type 16 or 8 bits.
    3. Const32 typed with the previous Const64 type when canonicalizing 64bits rotates on 32 bits platforms.

    CL 795240 fixes 1 and 2 but it introduces 3.
    CL 837245 fixes 3.

  5. dmitshur commented on Oct 6, 2026

    @dmitshur
    Member

    Approving the backport to Go 1.26 for CL 795240 and CL 837245.

  6. added
    CherryPickApprovedUsed during the release process for point releases
    and removed
    CherryPickCandidateUsed during the release process for point releases
    on Oct 6, 2026
  7. gopherbot commented on Oct 6, 2026

    @gopherbot
    ContributorAuthor

    Change https://go.dev/cl/845965 mentions this issue: [release-branch.go1.26] cmd/compile: fix misscompile in rewrite generic rules

  8. modified the milestones: Go1.26.9, Go1.26.10 on Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CherryPickApprovedUsed during the release process for point releasescompiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions