Skip to content

cmd/compile: ppc64le: sign extension issue in go 1.21rc2 #61297

Closed

Description

@eliben

Reported by Jan Mercl on golang-dev@

What version of Go are you using (go version)?

$ go version
go version go1.21rc2 linux/ppc64le

What operating system and processor architecture are you using (go env)?

$ uname -a
        Linux sqlite1 5.10.0-18-powerpc64le #1 SMP Debian 5.10.140-1 (2022-09-02) ppc64le GNU/Linux

What did you do?

Minimized reproducer at https://go.dev/play/p/ccmhhPkt0PI?v=gotip outputs

        55282
        55282

in the playground. Running the same code on linux/ppc64le:

        debian@sqlite1:~/tmp$ cat bug.go
        package main
       
        import (
                "fmt"
                "strconv"
        )
       
        func f(n int) int8 {
                return int8(n)
        }
       
        func main() {
                n, _ := strconv.Atoi("9")
                fmt.Println(int64(0xd7f2) & int64(f(-n)))
                fmt.Println(int64(0xd7f2) & int64(f(-9)))
        }

        debian@sqlite1:~/tmp$ go run bug.go
        242
        55282

Activity

  1. eliben commented on Jul 11, 2023

    @eliben
    MemberAuthor

    cc @golang/ppc64

  2. self-assigned this
    on Jul 11, 2023
  3. changed the title [-]ppc64le: sign extension issue in go 1.21rc2[/-] [+]cmd/compile: ppc64le: sign extension issue in go 1.21rc2[/+] on Jul 11, 2023
  4. gopherbot commented on Jul 11, 2023

    @gopherbot
    Contributor

    Change https://go.dev/cl/508775 mentions this issue: cmd/compile: On PPC64, preserve sign extension when masking

  5. pmur commented on Jul 12, 2023

    @pmur
    Contributor

    @gopherbot please consider a backport for 1.20 and 1.19, this is a compiler bug without a workaround.

  6. gopherbot commented on Jul 12, 2023

    @gopherbot
    Contributor

    Backport issue(s) opened: #61319 (for 1.19), #61320 (for 1.20).

    Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases.

  7. added this to the Go1.21 milestone on Jul 14, 2023
  8. added
    NeedsFixThe path to resolution is known, but the work has not been done.
    on Jul 14, 2023
  9. added a commit that references this issue on Jul 15, 2023
    4450832
  10. added a commit that references this issue on Feb 27, 2024
    5e4000a
  11. locked and limited conversation to collaborators on Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.arch-ppc64xcompiler/runtimeIssues related to the Go compiler and/or runtime.

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions