Skip to content

cmd/compile: loong64 spills a byte-sized inlined result with an 8-byte MOVD, clobbering adjacent stack slots [1.27 backport] #81147

Open

Description

@gopherbot

@abner-chenc requested issue #81000 to be considered for backport to the next 1.27 minor release.

@gopherbot please open a backport issue

Activity

  1. added
    CherryPickCandidateUsed during the release process for point releases
    compiler/runtimeIssues related to the Go compiler and/or runtime.
    on Aug 27, 2026
  2. added this to the Go1.27.1 milestone on Aug 27, 2026
  3. changed the title [-]cmd/compile: loong64 spills a byte-sized inlined result with an 8-byte MOVD, clobbering adjacent stack slots (go1.27.0) [1.27 backport][/-] [+]cmd/compile: loong64 spills a byte-sized inlined result with an 8-byte MOVD, clobbering adjacent stack slots [1.27 backport][/+] on Sep 1, 2026
  4. prattmic commented on Sep 1, 2026

    @prattmic
    Member

    @abner-chenc since #81000 somehow has 200+ messages, could you confirm the CL to be backported, whether this impacts 1.26 and 1.27, and what the impact is (arbitrary memory corruption on the stack?).

  5. modified the milestones: Go1.27.1, Go1.27.2 on Sep 1, 2026
  6. abner-chenc commented on Sep 7, 2026

    @abner-chenc
    Contributor

    @abner-chenc since #81000 somehow has 200+ messages, could you confirm the CL to be backported, whether this impacts 1.26 and 1.27, and what the impact is (arbitrary memory corruption on the stack?).

    Thanks!

    Needs backporting to Go 1.26 and Go 1.27, otherwise the MOVD instruction could corrupt the stack. I have submitted a regression test case for this issue in CL 828625。

    Here is the original error message:

    Image
  7. gopherbot commented on Sep 7, 2026

    @gopherbot
    ContributorAuthor

    Change https://go.dev/cl/828625 mentions this issue: test: add regression test for go.dev/issue/81000

  8. added a commit that references this issue on Sep 11, 2026
    bbfb5b2
  9. 280 remaining items

  10. abner-chenc commented on Oct 12, 2026

    @abner-chenc
    Contributor

    @dmitshur

    • The input operands for Cvt{32,64}to{32,64}F are integer registers, and the output operands are floating-point registers. However, the corresponding Op implementations on loong64 require both the input and output operands to be floating-point registers. Therefore, we need to move the input operand to a floating-point register on loong64.

    • Similarly, the input operands for Cvt{32,64}Fto{32,64} are floating-point registers, and the output operands are integer registers. Since the loong64 Op implementations require both operands to be floating-point registers, we need to move the output operand to an integer register on loong64.

    • Here the test case for this bug. It fails when running on the Go 1.27 branch.

    ./bin/go version
    go version go1.27.2 linux/loong64
    
    ./bin/go run issue81000.go 
    panic: issue81000: {L:0.7222675830801158 A:-0.9031940815103348 B:1.301887514238097} = [184 0 255], want [0 0 0]
    	
    
    goroutine 1 [running]:
    main.main()
    	/home/chenguoqi/golang/go-upstream/issue81000.go:46 +0x460
    exit status 2
    

    Thanks!

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

    CherryPickCandidateUsed 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